mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Use zend_ssa_is_no_val_use() instead of zend_has_improper_op1_use()
This commit is contained in:
parent
4b64dbb30d
commit
06f6eb0e68
2 changed files with 6 additions and 9 deletions
|
@ -228,10 +228,10 @@ static inline void add_operands_to_worklists(context *ctx, zend_op *opline, zend
|
||||||
if (ssa_op->result_use >= 0) {
|
if (ssa_op->result_use >= 0) {
|
||||||
add_to_worklists(ctx, ssa_op->result_use);
|
add_to_worklists(ctx, ssa_op->result_use);
|
||||||
}
|
}
|
||||||
if (ssa_op->op1_use >= 0 && !zend_has_improper_op1_use(opline)) {
|
if (ssa_op->op1_use >= 0 && !zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op1_use)) {
|
||||||
add_to_worklists(ctx, ssa_op->op1_use);
|
add_to_worklists(ctx, ssa_op->op1_use);
|
||||||
}
|
}
|
||||||
if (ssa_op->op2_use >= 0) {
|
if (ssa_op->op2_use >= 0 && !zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op2_use)) {
|
||||||
add_to_worklists(ctx, ssa_op->op2_use);
|
add_to_worklists(ctx, ssa_op->op2_use);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,10 +501,12 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reor
|
||||||
/* Improper uses don't count as "uses" for the purpose of instruction elimination,
|
/* Improper uses don't count as "uses" for the purpose of instruction elimination,
|
||||||
* but we have to retain phis defining them. Push those phis to the worklist. */
|
* but we have to retain phis defining them. Push those phis to the worklist. */
|
||||||
FOREACH_INSTR_NUM(i) {
|
FOREACH_INSTR_NUM(i) {
|
||||||
if (zend_has_improper_op1_use(&op_array->opcodes[i])) {
|
if (ssa->ops[i].op1_use >= 0 && zend_ssa_is_no_val_use(&op_array->opcodes[i], &ssa->ops[i], ssa->ops[i].op1_use)) {
|
||||||
ZEND_ASSERT(ssa->ops[i].op1_use >= 0);
|
|
||||||
add_to_phi_worklist_only(&ctx, ssa->ops[i].op1_use);
|
add_to_phi_worklist_only(&ctx, ssa->ops[i].op1_use);
|
||||||
}
|
}
|
||||||
|
if (ssa->ops[i].op2_use >= 0 && zend_ssa_is_no_val_use(&op_array->opcodes[i], &ssa->ops[i], ssa->ops[i].op2_use)) {
|
||||||
|
add_to_phi_worklist_only(&ctx, ssa->ops[i].op2_use);
|
||||||
|
}
|
||||||
} FOREACH_INSTR_NUM_END();
|
} FOREACH_INSTR_NUM_END();
|
||||||
|
|
||||||
/* Propagate this information backwards, marking any phi with an improperly used
|
/* Propagate this information backwards, marking any phi with an improperly used
|
||||||
|
|
|
@ -115,9 +115,4 @@ zend_uchar zend_compound_assign_to_binary_op(zend_uchar opcode);
|
||||||
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_arrya, zend_ssa *ssa, zend_call_info **call_map);
|
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_arrya, zend_ssa *ssa, zend_call_info **call_map);
|
||||||
int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reorder_dtor_effects);
|
int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reorder_dtor_effects);
|
||||||
|
|
||||||
static inline zend_bool zend_has_improper_op1_use(zend_op *opline) {
|
|
||||||
return opline->opcode == ZEND_ASSIGN
|
|
||||||
|| (opline->opcode == ZEND_UNSET_VAR && opline->extended_value & ZEND_QUICK_SET);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue