]> granicus.if.org Git - php/commitdiff
More accurate live range construction
authorDmitry Stogov <dmitry@zend.com>
Wed, 21 Oct 2020 13:05:13 +0000 (16:05 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 21 Oct 2020 13:05:13 +0000 (16:05 +0300)
ext/opcache/jit/zend_jit_trace.c

index 2353ec0a93351636ddf425949989dfc240fd027e..6e2015f158c1f0dba9749bd0a2b0600f204ad336 100644 (file)
@@ -2476,7 +2476,7 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
 
                while (phi) {
                        i = phi->sources[1];
-                       if (start[i] >= 0) {
+                       if (start[i] >= 0 && !ssa->vars[phi->ssa_var].no_val) {
                                end[i] = idx;
                                flags[i] &= ~ZREG_LAST_USE;
                        }
@@ -2487,6 +2487,8 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
                        if (start[i] >= 0 && !ssa->vars[i].phi_use_chain) {
                                end[i] = idx;
                                flags[i] &= ~ZREG_LAST_USE;
+                       } else {
+                               zend_jit_close_var(stack, i, start, end, flags, idx);
                        }
                }
        } else {