Skip to content

Commit 9a2f500

Browse files
committed
Avoid useless iterations for first SSA variablesi, always marked BOT.
1 parent c57dd7c commit 9a2f500

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ static void replace_constant_operands(sccp_ctx *ctx) {
12171217

12181218
/* We iterate the variables backwards, so we can eliminate sequences like INIT_ROPE
12191219
* and INIT_ARRAY. */
1220-
for (i = ssa->vars_count - 1; i >= 0; i--) {
1220+
for (i = ssa->vars_count - 1; i >= op_array->last_var; i--) {
12211221
zend_ssa_var *var = &ssa->vars[i];
12221222
zval *value;
12231223
int use;
@@ -1364,7 +1364,7 @@ static void sccp_context_init(sccp_ctx *ctx,
13641364

13651365
static void sccp_context_free(sccp_ctx *ctx) {
13661366
int i;
1367-
for (i = 0; i < ctx->ssa->vars_count; ++i) {
1367+
for (i = ctx->op_array->last_var; i < ctx->ssa->vars_count; ++i) {
13681368
zval_ptr_dtor_nogc(&ctx->values[i]);
13691369
}
13701370
efree(ctx->values);

0 commit comments

Comments
 (0)