mirror of
https://github.com/php/php-src.git
synced 2026-04-15 03:51:07 +02:00
Improve registers reuse
This commit is contained in:
@@ -1391,10 +1391,6 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
|
||||
*/
|
||||
available = ZEND_REGSET_DIFFERENCE(available, ZEND_REGSET_PRESERVED);
|
||||
|
||||
if (ZEND_REGSET_IS_EMPTY(available)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set freeUntilPos of all physical registers to maxInt */
|
||||
for (i = 0; i < ZREG_NUM; i++) {
|
||||
freeUntilPos[i] = 0xffffffff;
|
||||
@@ -1432,6 +1428,10 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
|
||||
}
|
||||
}
|
||||
|
||||
if (hint == ZREG_NONE && ZEND_REGSET_IS_EMPTY(available)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See "Linear Scan Register Allocation on SSA Form", Christian Wimmer and
|
||||
Michael Franz, CGO'10 (2010), Figure 6. */
|
||||
if (current->flags & ZREG_SPLIT) {
|
||||
@@ -1519,6 +1519,10 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ZEND_REGSET_IS_EMPTY(available)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pos = 0; reg = ZREG_NONE;
|
||||
pos2 = 0; reg2 = ZREG_NONE;
|
||||
low_priority_regs = *hints;
|
||||
|
||||
@@ -10947,7 +10947,7 @@ static zend_bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *op
|
||||
|
||||
static zend_bool zend_jit_may_reuse_reg(const zend_op *opline, const zend_ssa_op *ssa_op, zend_ssa *ssa, int def_var, int use_var)
|
||||
{
|
||||
if (ssa->var_info[def_var].type != ssa->var_info[use_var].type) {
|
||||
if ((ssa->var_info[def_var].type & ~MAY_BE_GUARD) != (ssa->var_info[use_var].type & ~MAY_BE_GUARD)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user