Lines Matching refs:ssa
24 static inline bool is_in_use_chain(zend_ssa *ssa, int var, int check) { in is_in_use_chain() argument
26 FOREACH_USE(&ssa->vars[var], use) { in is_in_use_chain()
34 static inline bool is_in_phi_use_chain(zend_ssa *ssa, int var, zend_ssa_phi *check) { in is_in_phi_use_chain() argument
36 FOREACH_PHI_USE(&ssa->vars[var], phi) { in is_in_phi_use_chain()
44 static inline bool is_used_by_op(zend_ssa *ssa, int op, int check) { in is_used_by_op() argument
45 zend_ssa_op *ssa_op = &ssa->ops[op]; in is_used_by_op()
51 static inline bool is_defined_by_op(zend_ssa *ssa, int op, int check) { in is_defined_by_op() argument
52 zend_ssa_op *ssa_op = &ssa->ops[op]; in is_defined_by_op()
58 static inline bool is_in_phi_sources(zend_ssa *ssa, zend_ssa_phi *phi, int check) { in is_in_phi_sources() argument
92 static inline bool is_defined(const zend_ssa *ssa, const zend_op_array *op_array, int var) { in is_defined() argument
93 const zend_ssa_var *ssa_var = &ssa->vars[var]; in is_defined()
109 (i), (ssa->vars[i].var < op_array->last_var ? "CV $" : "TMP"), \
110 (ssa->vars[i].var < op_array->last_var ? ZSTR_VAL(op_array->vars[ssa->vars[i].var]) : "")
116 void ssa_verify_integrity(zend_op_array *op_array, zend_ssa *ssa, const char *extra) { in ssa_verify_integrity() argument
117 zend_cfg *cfg = &ssa->cfg; in ssa_verify_integrity()
123 for (i = 0; i < ssa->vars_count; i++) { in ssa_verify_integrity()
124 zend_ssa_var *var = &ssa->vars[i]; in ssa_verify_integrity()
126 uint32_t type = ssa->var_info[i].type; in ssa_verify_integrity()
140 if (!is_defined_by_op(ssa, var->definition, i)) { in ssa_verify_integrity()
155 use = zend_ssa_next_use(ssa->ops, var - ssa->vars, use); in ssa_verify_integrity()
156 second_use = zend_ssa_next_use(ssa->ops, var - ssa->vars, second_use); in ssa_verify_integrity()
160 second_use = zend_ssa_next_use(ssa->ops, var - ssa->vars, second_use); in ssa_verify_integrity()
168 if (!is_used_by_op(ssa, use, i)) { in ssa_verify_integrity()
177 phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, phi); in ssa_verify_integrity()
178 second_phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, second_phi); in ssa_verify_integrity()
182 second_phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, second_phi); in ssa_verify_integrity()
190 if (!is_in_phi_sources(ssa, phi, i)) { in ssa_verify_integrity()
201 if ((type & MAY_BE_REF) && ssa->var_info[i].ce) { in ssa_verify_integrity()
208 zend_ssa_op *ssa_op = &ssa->ops[i]; in ssa_verify_integrity()
239 if (ssa_op->op1_use >= ssa->vars_count) { in ssa_verify_integrity()
242 if (!is_defined(ssa, op_array, ssa_op->op1_use)) { in ssa_verify_integrity()
246 if (!is_in_use_chain(ssa, ssa_op->op1_use, i)) { in ssa_verify_integrity()
250 if (VAR_NUM(opline->op1.var) != ssa->vars[ssa_op->op1_use].var) { in ssa_verify_integrity()
256 if (ssa_op->op2_use >= ssa->vars_count) { in ssa_verify_integrity()
259 if (!is_defined(ssa, op_array, ssa_op->op2_use)) { in ssa_verify_integrity()
263 if (!is_in_use_chain(ssa, ssa_op->op2_use, i)) { in ssa_verify_integrity()
267 if (VAR_NUM(opline->op2.var) != ssa->vars[ssa_op->op2_use].var) { in ssa_verify_integrity()
273 if (ssa_op->result_use >= ssa->vars_count) { in ssa_verify_integrity()
276 if (!is_defined(ssa, op_array, ssa_op->result_use)) { in ssa_verify_integrity()
280 if (!is_in_use_chain(ssa, ssa_op->result_use, i)) { in ssa_verify_integrity()
284 if (VAR_NUM(opline->result.var) != ssa->vars[ssa_op->result_use].var) { in ssa_verify_integrity()
290 if (ssa_op->op1_def >= ssa->vars_count) { in ssa_verify_integrity()
293 if (ssa->vars[ssa_op->op1_def].definition != i) { in ssa_verify_integrity()
297 if (VAR_NUM(opline->op1.var) != ssa->vars[ssa_op->op1_def].var) { in ssa_verify_integrity()
303 if (ssa_op->op2_def >= ssa->vars_count) { in ssa_verify_integrity()
306 if (ssa->vars[ssa_op->op2_def].definition != i) { in ssa_verify_integrity()
310 if (VAR_NUM(opline->op2.var) != ssa->vars[ssa_op->op2_def].var) { in ssa_verify_integrity()
316 if (ssa_op->result_def >= ssa->vars_count) { in ssa_verify_integrity()
319 if (ssa->vars[ssa_op->result_def].definition != i) { in ssa_verify_integrity()
323 if (VAR_NUM(opline->result.var) != ssa->vars[ssa_op->result_def].var) { in ssa_verify_integrity()
338 if (!is_in_phi_use_chain(ssa, source, phi)) { in ssa_verify_integrity()
341 if (ssa->vars[source].var != ssa->vars[phi->ssa_var].var) { in ssa_verify_integrity()
354 if (ssa->vars[phi->ssa_var].definition_phi != phi) { in ssa_verify_integrity()
381 if (ssa->blocks[i].phis) { in ssa_verify_integrity()
422 zend_dump_op_array(op_array, ZEND_DUMP_SSA, "at SSA integrity verification", ssa); in ssa_verify_integrity()