mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix more issues reported in GH-15852
* Fix incorrect register allocation * Avoid IR binding/spilling conflict * Add missing type guard
This commit is contained in:
parent
ab99161444
commit
98f07fcfca
2 changed files with 9 additions and 4 deletions
|
@ -1298,6 +1298,14 @@ static bool zend_jit_spilling_may_cause_conflict(zend_jit_ctx *jit, int var, ir_
|
|||
&& EX_VAR_TO_NUM(jit->ctx.ir_base[jit->ctx.ir_base[jit->ctx.ir_base[val].op2].op2].val.addr) < jit->current_op_array->last_var) {
|
||||
/* binding between different CVs may cause spill conflict */
|
||||
return 1;
|
||||
} else if (jit->ssa->vars[var].definition >= 0
|
||||
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_def == var
|
||||
&& jit->ssa->ops[jit->ssa->vars[var].definition].op1_use >= 0
|
||||
&& jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].no_val
|
||||
&& jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi
|
||||
&& (jit->ssa->cfg.blocks[jit->ssa->vars[jit->ssa->ops[jit->ssa->vars[var].definition].op1_use].definition_phi->block].flags & ZEND_BB_LOOP_HEADER)) {
|
||||
/* Avoid moving spill store out of loop */
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3295,9 +3295,7 @@ static zend_jit_reg_var* zend_jit_trace_allocate_registers(zend_jit_trace_rec *t
|
|||
RA_REG_FLAGS(def) |= ZREG_LOAD;
|
||||
}
|
||||
}
|
||||
} else if (RA_HAS_REG(use)
|
||||
&& (!ssa->vars[def].no_val
|
||||
)) {
|
||||
} else if (RA_HAS_REG(use)) {
|
||||
if (ssa->vars[use].use_chain >= 0) {
|
||||
RA_REG_FLAGS(use) |= ZREG_STORE; // TODO: ext/opcache/tests/jit/reg_alloc_00[67].phpt ???
|
||||
} else {
|
||||
|
@ -4206,7 +4204,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
|||
&& (trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP
|
||||
|| trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_CALL
|
||||
|| (trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET
|
||||
&& (opline-1)->result_type == IS_VAR
|
||||
&& EX_VAR_TO_NUM((opline-1)->result.var) == i))
|
||||
&& (ssa->vars[i].use_chain != -1
|
||||
|| (ssa->vars[i].phi_use_chain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue