Skip to content

Commit a60bc06

Browse files
committed
Allow registr allocation for math instructions, if at least one of operands is known to be numeric.
1 parent d5ac3d7 commit a60bc06

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9379,7 +9379,7 @@ static zend_bool zend_jit_opline_supports_reg(zend_op_array *op_array, zend_ssa
93799379
op1_info = OP1_INFO();
93809380
op2_info = OP2_INFO();
93819381
return
9382-
!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-(MAY_BE_LONG|MAY_BE_DOUBLE))) &&
9382+
!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-(MAY_BE_LONG|MAY_BE_DOUBLE))) ||
93839383
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-(MAY_BE_LONG|MAY_BE_DOUBLE)));
93849384
case ZEND_BW_OR:
93859385
case ZEND_BW_AND:
@@ -9456,7 +9456,8 @@ static zend_bool zend_jit_may_be_in_reg(zend_op_array *op_array, zend_ssa *ssa,
94569456
int use = ssa->vars[var].use_chain;
94579457

94589458
do {
9459-
if (!zend_jit_opline_supports_reg(op_array, ssa, op_array->opcodes + use, var)) {
9459+
if (!zend_ssa_is_no_val_use(op_array->opcodes + use, ssa->ops + use, var) &&
9460+
!zend_jit_opline_supports_reg(op_array, ssa, op_array->opcodes + use, var)) {
94609461
return 0;
94619462
}
94629463
use = zend_ssa_next_use(ssa->ops, var, use);

0 commit comments

Comments
 (0)