Skip to content

Commit a247cee

Browse files
committed
Perform DCE pass before other DFA optimisations, to properly reconstruct "no value" use-def chains.
1 parent a651564 commit a247cee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ext/opcache/Optimizer/dfa_pass.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,15 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
470470
}
471471
}
472472

473+
if (ZEND_OPTIMIZER_PASS_14 & ctx->optimization_level) {
474+
if (dce_optimize_op_array(op_array, ssa, 0)) {
475+
remove_nops = 1;
476+
}
477+
if (ctx->debug_level & ZEND_DUMP_AFTER_PASS_14) {
478+
zend_dump_op_array(op_array, ZEND_DUMP_SSA, "after dce pass", ssa);
479+
}
480+
}
481+
473482
for (v = op_array->last_var; v < ssa->vars_count; v++) {
474483

475484
op_1 = ssa->vars[v].definition;
@@ -719,15 +728,6 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
719728
}
720729
}
721730

722-
if (ZEND_OPTIMIZER_PASS_14 & ctx->optimization_level) {
723-
if (dce_optimize_op_array(op_array, ssa, 0)) {
724-
remove_nops = 1;
725-
}
726-
if (ctx->debug_level & ZEND_DUMP_AFTER_PASS_14) {
727-
zend_dump_op_array(op_array, ZEND_DUMP_SSA, "after dce pass", ssa);
728-
}
729-
}
730-
731731
if (remove_nops) {
732732
zend_ssa_remove_nops(op_array, ssa);
733733
}

0 commit comments

Comments
 (0)