mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Zend/Optimizer: add const qualifier to visit_phi's phi parameter
This commit is contained in:
@@ -2037,7 +2037,7 @@ static void join_phi_values(zval *a, zval *b, bool escape) {
|
||||
}
|
||||
}
|
||||
|
||||
static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) {
|
||||
static void sccp_visit_phi(scdf_ctx *scdf, const zend_ssa_phi *phi) {
|
||||
sccp_ctx *ctx = (sccp_ctx *) scdf;
|
||||
zend_ssa *ssa = scdf->ssa;
|
||||
ZEND_ASSERT(phi->ssa_var >= 0);
|
||||
|
||||
@@ -71,8 +71,7 @@ void scdf_mark_edge_feasible(scdf_ctx *scdf, int from, int to) {
|
||||
/* Block is already executable, only a new edge became feasible.
|
||||
* Reevaluate phi nodes to account for changed source operands. */
|
||||
const zend_ssa_block *ssa_block = &scdf->ssa->blocks[to];
|
||||
zend_ssa_phi *phi;
|
||||
for (phi = ssa_block->phis; phi; phi = phi->next) {
|
||||
for (const zend_ssa_phi *phi = ssa_block->phis; phi; phi = phi->next) {
|
||||
zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var);
|
||||
scdf->handlers.visit_phi(scdf, phi);
|
||||
}
|
||||
@@ -109,7 +108,7 @@ void scdf_solve(scdf_ctx *scdf, const char *name) {
|
||||
) {
|
||||
int i;
|
||||
while ((i = zend_bitset_pop_first(scdf->phi_var_worklist, scdf->phi_var_worklist_len)) >= 0) {
|
||||
zend_ssa_phi *phi = ssa->vars[i].definition_phi;
|
||||
const zend_ssa_phi *phi = ssa->vars[i].definition_phi;
|
||||
ZEND_ASSERT(phi);
|
||||
if (zend_bitset_in(scdf->executable_blocks, phi->block)) {
|
||||
scdf->handlers.visit_phi(scdf, phi);
|
||||
@@ -145,12 +144,9 @@ void scdf_solve(scdf_ctx *scdf, const char *name) {
|
||||
DEBUG_PRINT("Pop block %d from worklist\n", i);
|
||||
zend_bitset_incl(scdf->executable_blocks, i);
|
||||
|
||||
{
|
||||
zend_ssa_phi *phi;
|
||||
for (phi = ssa_block->phis; phi; phi = phi->next) {
|
||||
zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var);
|
||||
scdf->handlers.visit_phi(scdf, phi);
|
||||
}
|
||||
for (const zend_ssa_phi *phi = ssa_block->phis; phi; phi = phi->next) {
|
||||
zend_bitset_excl(scdf->phi_var_worklist, phi->ssa_var);
|
||||
scdf->handlers.visit_phi(scdf, phi);
|
||||
}
|
||||
|
||||
if (block->len == 0) {
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef struct _scdf_ctx {
|
||||
void (*visit_instr)(
|
||||
struct _scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op);
|
||||
void (*visit_phi)(
|
||||
struct _scdf_ctx *scdf, zend_ssa_phi *phi);
|
||||
struct _scdf_ctx *scdf, const zend_ssa_phi *phi);
|
||||
void (*mark_feasible_successors)(
|
||||
struct _scdf_ctx *scdf, int block_num, zend_basic_block *block,
|
||||
zend_op *opline, zend_ssa_op *ssa_op);
|
||||
|
||||
Reference in New Issue
Block a user