Skip to content

Commit 6f888b9

Browse files
committed
Eliminate more dead type stores
1 parent 5039999 commit 6f888b9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,8 +3280,19 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
32803280
uint32_t info = ssa->var_info[i].type;
32813281

32823282
if (!(info & MAY_BE_GUARD) && has_concrete_type(info)) {
3283-
SET_STACK_TYPE(stack, i, concrete_type(info),
3284-
(i >= parent_vars_count || STACK_REG(parent_stack, i) >= ZREG_NUM));
3283+
uint8_t type, mem_type;
3284+
3285+
type = concrete_type(info);
3286+
if (i < parent_vars_count
3287+
&& STACK_TYPE(parent_stack, i) == type) {
3288+
mem_type = STACK_MEM_TYPE(parent_stack, i);
3289+
if (mem_type != IS_UNKNOWN) {
3290+
SET_STACK_TYPE(stack, i, mem_type, 1);
3291+
}
3292+
SET_STACK_TYPE(stack, i, type, 0);
3293+
} else {
3294+
SET_STACK_TYPE(stack, i, type, 1);
3295+
}
32853296
} else if (zend_jit_var_may_alias(op_array, op_array_ssa, i) != NO_ALIAS) {
32863297
SET_STACK_TYPE(stack, i, IS_UNKNOWN, 1);
32873298
} else if (i < parent_vars_count

0 commit comments

Comments
 (0)