com php-src: Otimize out useless QM_ASSIGN: ext/opcache/O ptimizer/block_pass.c
| From: | Dmitry Stogov | Date: | Wed, 09 Oct 2019 06:08:25 +0000 |
| Subject: | com php-src: Otimize out useless QM_ASSIGN: ext/opcache/O ptimizer/block_pass.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108819@lists.php.net to get a copy of this message | ||
Commit: 170ed1f5a7b2f2f052445761080c96a3a3cfa884
Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Oct 2019 09:08:25 +0300
Parents: 95181553c84d5d02fbae773e2d4fc63fcf15ba23
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=170ed1f5a7b2f2f052445761080c96a3a3cfa884
Log:
Otimize out useless QM_ASSIGN
Changed paths:
M ext/opcache/Optimizer/block_pass.c
Diff:
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass..c
index 6ca3d02468b..4e4d270b62e 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -883,6 +883,18 @@ optimize_const_unary_op:
/* strip T = QM_ASSIGN(T) */
MAKE_NOP(opline);
++(*opt_count);
+ } else if (opline->op1_type == IS_TMP_VAR &&
+ opline->result_type == IS_TMP_VAR &&
+ !zend_bitset_in(used_ext, VAR_NUM(opline->op1.var))) {
+ /* T1 = ..., T2 = QM_ASSIGN(T1) to T2 = ..., NOP */
+ src = VAR_SOURCE(opline->op1);
+ if (src) {
+ src->result.var = opline->result.var;
+ VAR_SOURCE(opline->op1) = NULL;
+ VAR_SOURCE(opline->result) = src;
+ MAKE_NOP(opline);
+ ++(*opt_count);
+ }
}
break;
}