Skip to content

Commit 290c9ae

Browse files
authored
Eliminate useless spill stores (#19467)
1 parent 6004702 commit 290c9ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4177,6 +4177,11 @@ static int zend_jit_spill_store_inv(zend_jit_ctx *jit, zend_jit_addr src, zend_j
41774177
ZEND_ASSERT(Z_MODE(src) == IS_REG);
41784178
ZEND_ASSERT(Z_MODE(dst) == IS_MEM_ZVAL);
41794179

4180+
if (Z_LOAD(src) || Z_STORE(src)) {
4181+
/* it's not necessary to store register if it was previously loaded or already stored */
4182+
return 1;
4183+
}
4184+
41804185
if ((info & MAY_BE_ANY) == MAY_BE_LONG) {
41814186
jit_set_Z_LVAL(jit, dst, zend_jit_use_reg(jit, src));
41824187
if (Z_REG(dst) != ZREG_FP || !JIT_G(current_frame)) {

0 commit comments

Comments
 (0)