]> granicus.if.org Git - php/commitdiff
Eliminate useless mov(s)
authorDmitry Stogov <dmitry@zend.com>
Wed, 21 Oct 2020 13:03:28 +0000 (16:03 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 21 Oct 2020 13:03:28 +0000 (16:03 +0300)
ext/opcache/jit/zend_jit_x86.dasc

index 9f2b934c03850cacc907bdc2af24c808b29d0abe..b5fe131139c07c9d69b983b77f58e0e23c10fcfd 100644 (file)
@@ -4962,7 +4962,9 @@ static int zend_jit_long_math_helper(dasm_State    **Dst,
                |       LONG_MATH opcode, result_reg, op2_addr
        }
 
-       |       SET_ZVAL_LVAL res_addr, Ra(result_reg)
+       if (Z_MODE(res_addr) != IS_REG || Z_REG(res_addr) != result_reg) {
+               |       SET_ZVAL_LVAL res_addr, Ra(result_reg)
+       }
        if (Z_MODE(res_addr) == IS_MEM_ZVAL) {
                if (Z_MODE(op1_addr) != IS_MEM_ZVAL || Z_REG(op1_addr) != Z_REG(res_addr) || Z_OFFSET(op1_addr) != Z_OFFSET(res_addr)) {
                        if ((res_use_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF|MAY_BE_GUARD)) != MAY_BE_LONG) {
@@ -13138,7 +13140,9 @@ static int zend_jit_incdec_obj(dasm_State          **Dst,
                zend_jit_addr var_addr = prop_addr;
 
                var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0);
-               |       LOAD_ZVAL_ADDR FCARG1a, prop_addr
+               if (Z_REG(prop_addr) != ZREG_FCARG1a || Z_OFFSET(prop_addr) != 0) {
+                       |       LOAD_ZVAL_ADDR FCARG1a, prop_addr
+               }
 
                |       IF_NOT_ZVAL_TYPE var_addr, IS_REFERENCE, >2
                |       GET_ZVAL_PTR FCARG1a, var_addr