com php-src: Mark uses in UNSET_VAR op1 + FE_FETCH _R op2 as no_val: ext/opcache/Optimizer/zend_ inference.c

From: Date: Mon, 14 Mar 2016 16:57:07 +0000
Subject: com php-src: Mark uses in UNSET_VAR op1 + FE_FETCH _R op2 as no_val: ext/opcache/Optimizer/zend_ inference.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91340@lists.php.net to get a copy of this message
Commit: 47391961dd8aaa137636a1a4fb9203f2ded63371 Author: Nikita Popov <nikic@php.net> Wed, 2 Mar 2016 13:21:20 +0100 Parents: 64dae1ea76c2c226fc375bf93858f9b2f5dae27f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=47391961dd8aaa137636a1a4fb9203f2ded63371 Log: Mark uses in UNSET_VAR op1 + FE_FETCH_R op2 as no_val Changed paths: M ext/opcache/Optimizer/zend_inference.c Diff: diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index a1e2335..0177215 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -199,6 +199,18 @@ int zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ } /* }}} */ +static inline zend_bool is_no_val_use(const zend_op *opline, const zend_ssa_op *ssa_op, int var) +{ + if (opline->opcode == ZEND_ASSIGN || + (opline->opcode == ZEND_UNSET_VAR && (opline->extended_value & ZEND_QUICK_SET))) { + return ssa_op->op1_use == var && ssa_op->op2_use != var; + } + if (opline->opcode == ZEND_FE_FETCH_R) { + return ssa_op->op2_use == var && ssa_op->op1_use != var; + } + return 0; +} + int zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ { zend_ssa_var *ssa_vars = ssa->vars; @@ -220,9 +232,7 @@ int zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ss ssa_vars[i].no_val = 1; /* mark as unused */ use = ssa->vars[i].use_chain; while (use >= 0) { - if (op_array->opcodes[use].opcode != ZEND_ASSIGN || - ssa->ops[use].op1_use != i || - ssa->ops[use].op2_use == i) { + if (!is_no_val_use(&op_array->opcodes[use], &ssa->ops[use], i)) { ssa_vars[i].no_val = 0; /* used directly */ zend_bitset_incl(worklist, i); }

« previous php.cvs (#91340) next »