Lines Matching refs:var
47 …i(const zend_op_array *op_array, zend_dfg *dfg, zend_ssa *ssa, int from, int to, int var) /* {{{ */ in needs_pi() argument
52 if (!DFG_ISSET(dfg->in, dfg->size, to, var)) { in needs_pi()
81 int from, int to, int var) /* {{{ */ in add_pi() argument
84 if (!needs_pi(op_array, dfg, ssa, from, to, var)) { in add_pi()
97 phi->var = var; in add_pi()
105 DFG_SET(dfg->def, dfg->size, to, var); in add_pi()
111 DFG_SET(dfg->use, dfg->size, to, var); in add_pi()
136 static inline void pi_range_equals(zend_ssa_phi *phi, int var, zend_long val) { in pi_range_equals() argument
137 pi_range(phi, var, var, val, val, 0, 0, 0); in pi_range_equals()
139 static inline void pi_range_not_equals(zend_ssa_phi *phi, int var, zend_long val) { in pi_range_not_equals() argument
140 pi_range(phi, var, var, val, val, 0, 0, 1); in pi_range_not_equals()
142 static inline void pi_range_min(zend_ssa_phi *phi, int var, zend_long val) { in pi_range_min() argument
143 pi_range(phi, var, -1, val, ZEND_LONG_MAX, 0, 1, 0); in pi_range_min()
145 static inline void pi_range_max(zend_ssa_phi *phi, int var, zend_long val) { in pi_range_max() argument
146 pi_range(phi, -1, var, ZEND_LONG_MIN, val, 1, 0, 0); in pi_range_max()
179 if (op->result_type != IS_TMP_VAR || op->result.var != var_num) { in find_adjusted_tmp_var()
186 return EX_VAR_TO_NUM(op->op1.var); in find_adjusted_tmp_var()
191 return EX_VAR_TO_NUM(op->op1.var); in find_adjusted_tmp_var()
199 return EX_VAR_TO_NUM(op->op1.var); in find_adjusted_tmp_var()
206 return EX_VAR_TO_NUM(op->op2.var); in find_adjusted_tmp_var()
214 return EX_VAR_TO_NUM(op->op1.var); in find_adjusted_tmp_var()
271 opline->op1.var == (opline-1)->result.var) { in place_essa_pis()
279 var1 = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis()
282 op_array, build_flags, opline, (opline-1)->op1.var, &val2); in place_essa_pis()
286 var2 = EX_VAR_TO_NUM((opline-1)->op2.var); in place_essa_pis()
289 op_array, build_flags, opline, (opline-1)->op2.var, &val1); in place_essa_pis()
419 opline->op1.var == (opline-1)->result.var && in place_essa_pis()
421 int var = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis() local
424 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
427 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
431 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
434 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
441 opline->op1.var == (opline-1)->result.var && in place_essa_pis()
443 int var = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis() local
445 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
449 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
453 opline->op1.var == (opline-1)->result.var && (opline-1)->op1_type == IS_CV) { in place_essa_pis()
454 int var = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis() local
456 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
461 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
468 opline->op1.var == (opline-1)->result.var) { in place_essa_pis()
469 int var; in place_essa_pis() local
473 var = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis()
476 var = EX_VAR_TO_NUM((opline-1)->op2.var); in place_essa_pis()
490 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
493 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
497 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bf, var))) { in place_essa_pis()
500 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
505 opline->op1.var == (opline-1)->result.var && (opline-1)->op1_type == IS_CV && in place_essa_pis()
507 int var = EX_VAR_TO_NUM((opline-1)->op1.var); in place_essa_pis() local
517 if ((pi = add_pi(arena, op_array, dfg, ssa, j, bt, var))) { in place_essa_pis()
526 …name(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */ in zend_ssa_rename() argument
540 memcpy(tmp, var, sizeof(int) * (op_array->last_var + op_array->T)); in zend_ssa_rename()
541 var = tmp; in zend_ssa_rename()
549 var[phi->var] = ssa_vars_count; in zend_ssa_rename()
552 var[phi->var] = phi->ssa_var; in zend_ssa_rename()
566 ssa_ops[k + 1].op1_use = var[EX_VAR_TO_NUM(next->op1.var)]; in zend_ssa_rename()
569 ssa_ops[k + 1].op1_use = var[EX_VAR_TO_NUM(next->op1.var)]; in zend_ssa_rename()
573 ssa_ops[k + 1].op2_use = var[EX_VAR_TO_NUM(next->op2.var)]; in zend_ssa_rename()
576 ssa_ops[k + 1].op2_use = var[EX_VAR_TO_NUM(next->op2.var)]; in zend_ssa_rename()
581 ssa_ops[k].op1_use = var[EX_VAR_TO_NUM(opline->op1.var)]; in zend_ssa_rename()
586 ssa_ops[k].op2_use = var[EX_VAR_TO_NUM(opline->op2.var)]; in zend_ssa_rename()
589 var[EX_VAR_TO_NUM(opline->op2.var)] = ssa_vars_count; in zend_ssa_rename()
593 ssa_ops[k].op2_use = var[EX_VAR_TO_NUM(opline->op2.var)]; in zend_ssa_rename()
600 var[EX_VAR_TO_NUM(opline->op2.var)] = ssa_vars_count; in zend_ssa_rename()
606 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
615 var[EX_VAR_TO_NUM(opline->op2.var)] = ssa_vars_count; in zend_ssa_rename()
621 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
630 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
639 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
645 var[EX_VAR_TO_NUM(next->op1.var)] = ssa_vars_count; in zend_ssa_rename()
653 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
661 var[EX_VAR_TO_NUM(next->op1.var)] = ssa_vars_count; in zend_ssa_rename()
672 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
678 ssa_ops[k].result_use = var[EX_VAR_TO_NUM(opline->result.var)]; in zend_ssa_rename()
684 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
690 ssa_ops[k].result_use = var[EX_VAR_TO_NUM(opline->result.var)]; in zend_ssa_rename()
699 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
714 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
722 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
737 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
744 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
760 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
768 var[EX_VAR_TO_NUM(opline->op2.var)] = ssa_vars_count; in zend_ssa_rename()
777 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
784 var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; in zend_ssa_rename()
795 ssa_ops[k].result_use = var[EX_VAR_TO_NUM(opline->result.var)]; in zend_ssa_rename()
798 var[EX_VAR_TO_NUM(opline->result.var)] = ssa_vars_count; in zend_ssa_rename()
803 var[EX_VAR_TO_NUM(opline->result.var)] = ssa_vars_count; in zend_ssa_rename()
818 p->constraint.range.min_ssa_var = var[p->constraint.range.min_var]; in zend_ssa_rename()
821 p->constraint.range.max_ssa_var = var[p->constraint.range.max_var]; in zend_ssa_rename()
825 p->sources[j] = var[p->var]; in zend_ssa_rename()
838 p->sources[j] = var[p->var]; in zend_ssa_rename()
845 if (q->pi < 0 && q->var == p->var) { in zend_ssa_rename()
865 if (zend_ssa_rename(op_array, build_flags, ssa, var, j) != SUCCESS) in zend_ssa_rename()
885 int *var = NULL; in zend_build_ssa() local
963 var = do_alloca(sizeof(int) * (op_array->last_var + op_array->T), var_use_heap); in zend_build_ssa()
964 if (!var) { in zend_build_ssa()
985 phi->var = i; in zend_build_ssa()
1011 memset(var + op_array->last_var, 0xff, op_array->T * sizeof(int)); in zend_build_ssa()
1014 var[j] = j; in zend_build_ssa()
1017 if (zend_ssa_rename(op_array, build_flags, ssa, var, 0) != SUCCESS) { in zend_build_ssa()
1018 free_alloca(var, var_use_heap); in zend_build_ssa()
1023 free_alloca(var, var_use_heap); in zend_build_ssa()
1041 ssa_vars[i].var = i; in zend_ssa_compute_use_def_chains()
1047 ssa_vars[i].var = -1; in zend_ssa_compute_use_def_chains()
1069 ssa_vars[op->op1_def].var = EX_VAR_TO_NUM(op_array->opcodes[i].op1.var); in zend_ssa_compute_use_def_chains()
1073 ssa_vars[op->op2_def].var = EX_VAR_TO_NUM(op_array->opcodes[i].op2.var); in zend_ssa_compute_use_def_chains()
1077 ssa_vars[op->result_def].var = EX_VAR_TO_NUM(op_array->opcodes[i].result.var); in zend_ssa_compute_use_def_chains()
1086 ssa_vars[phi->ssa_var].var = phi->var; in zend_ssa_compute_use_def_chains()
1143 if (ssa_vars[i].var < op_array->last_var) { in zend_ssa_compute_use_def_chains()
1144 ssa_vars[i].alias = ssa_vars[ssa_vars[i].var].alias; in zend_ssa_compute_use_def_chains()
1152 int zend_ssa_unlink_use_chain(zend_ssa *ssa, int op, int var) /* {{{ */ in zend_ssa_unlink_use_chain() argument
1154 if (ssa->vars[var].use_chain == op) { in zend_ssa_unlink_use_chain()
1155 ssa->vars[var].use_chain = zend_ssa_next_use(ssa->ops, var, op); in zend_ssa_unlink_use_chain()
1158 int use = ssa->vars[var].use_chain; in zend_ssa_unlink_use_chain()
1161 if (ssa->ops[use].result_use == var) { in zend_ssa_unlink_use_chain()
1163 ssa->ops[use].res_use_chain = zend_ssa_next_use(ssa->ops, var, op); in zend_ssa_unlink_use_chain()
1168 } else if (ssa->ops[use].op1_use == var) { in zend_ssa_unlink_use_chain()
1170 ssa->ops[use].op1_use_chain = zend_ssa_next_use(ssa->ops, var, op); in zend_ssa_unlink_use_chain()
1175 } else if (ssa->ops[use].op2_use == var) { in zend_ssa_unlink_use_chain()
1177 ssa->ops[use].op2_use_chain = zend_ssa_next_use(ssa->ops, var, op); in zend_ssa_unlink_use_chain()
1224 static inline zend_ssa_phi **zend_ssa_next_use_phi_ptr(zend_ssa *ssa, int var, zend_ssa_phi *p) /* … in zend_ssa_next_use_phi_ptr() argument
1231 if (p->sources[j] == var) { in zend_ssa_next_use_phi_ptr()
1336 zend_ssa_var *var = &ssa->vars[var_num]; in zend_ssa_remove_uses_of_var() local
1339 FOREACH_PHI_USE(var, phi) { in zend_ssa_remove_uses_of_var()
1347 var->phi_use_chain = NULL; in zend_ssa_remove_uses_of_var()
1348 FOREACH_USE(var, use) { in zend_ssa_remove_uses_of_var()
1363 var->use_chain = -1; in zend_ssa_remove_uses_of_var()
1486 static void propagate_phi_type_widening(zend_ssa *ssa, int var) /* {{{ */ in propagate_phi_type_widening() argument
1489 FOREACH_PHI_USE(&ssa->vars[var], phi) { in propagate_phi_type_widening()
1490 if (ssa->var_info[var].type & ~ssa->var_info[phi->ssa_var].type) { in propagate_phi_type_widening()
1491 ssa->var_info[phi->ssa_var].type |= ssa->var_info[var].type; in propagate_phi_type_widening()