Lines Matching refs:ssa
78 if (!ssa->vars[var2].no_val) { \
80 zend_ssa_check_scc_var(op_array, ssa, var2, index, dfs, root, stack); \
82 if (ssa->vars[var2].scc < 0 && dfs[root[var]] >= dfs[root[var2]]) { \
90 if (ssa->vars[var2].scc != ssa->vars[var].scc) { \
91 ssa->vars[var2].scc_entry = 1; \
97 if (ssa->vars[_var].scc == scc) { \
104 if (ssa->vars[_var].scc == scc && \
112 if (ssa->ops[line].op1_def >= 0) { \
113 MACRO(ssa->ops[line].op1_def); \
115 if (ssa->ops[line].op2_def >= 0) { \
116 MACRO(ssa->ops[line].op2_def); \
118 if (ssa->ops[line].result_def >= 0) { \
119 MACRO(ssa->ops[line].result_def); \
122 if (ssa->ops[line-1].op1_def >= 0) { \
123 MACRO(ssa->ops[line-1].op1_def); \
125 if (ssa->ops[line-1].op2_def >= 0) { \
126 MACRO(ssa->ops[line-1].op2_def); \
128 if (ssa->ops[line-1].result_def >= 0) { \
129 MACRO(ssa->ops[line-1].result_def); \
133 if (ssa->ops[line+1].op1_def >= 0) { \
134 MACRO(ssa->ops[line+1].op1_def); \
136 if (ssa->ops[line+1].op2_def >= 0) { \
137 MACRO(ssa->ops[line+1].op2_def); \
139 if (ssa->ops[line+1].result_def >= 0) { \
140 MACRO(ssa->ops[line+1].result_def); \
148 zend_ssa_phi *p = ssa->vars[_var].phi_use_chain; \
149 int use = ssa->vars[_var].use_chain; \
152 use = zend_ssa_next_use(ssa->ops, _var, use); \
154 p = ssa->vars[_var].phi_use_chain; \
157 p = zend_ssa_next_use_phi(ssa, _var, p); \
172 static void zend_ssa_check_scc_var(const zend_op_array *op_array, zend_ssa *ssa, int var, int *inde… in zend_ssa_check_scc_var() argument
186 p = ssa->vars[var].sym_use_chain; in zend_ssa_check_scc_var()
194 ssa->vars[var].scc = ssa->sccs; in zend_ssa_check_scc_var()
201 ssa->vars[var2].scc = ssa->sccs; in zend_ssa_check_scc_var()
203 ssa->sccs++; in zend_ssa_check_scc_var()
210 int zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ in zend_ssa_find_sccs() argument
219 dfs = do_alloca(sizeof(int) * ssa->vars_count, dfs_use_heap); in zend_ssa_find_sccs()
220 memset(dfs, -1, sizeof(int) * ssa->vars_count); in zend_ssa_find_sccs()
221 root = do_alloca(sizeof(int) * ssa->vars_count, root_use_heap); in zend_ssa_find_sccs()
222 ZEND_WORKLIST_STACK_ALLOCA(&stack, ssa->vars_count, stack_use_heap); in zend_ssa_find_sccs()
225 for (j = 0; j < ssa->vars_count; j++) { in zend_ssa_find_sccs()
226 if (!ssa->vars[j].no_val && dfs[j] < 0) { in zend_ssa_find_sccs()
227 zend_ssa_check_scc_var(op_array, ssa, j, &index, dfs, root, &stack); in zend_ssa_find_sccs()
232 for (j = 0; j < ssa->vars_count; j++) { in zend_ssa_find_sccs()
233 if (ssa->vars[j].scc >= 0) { in zend_ssa_find_sccs()
234 ssa->vars[j].scc = ssa->sccs - (ssa->vars[j].scc + 1); in zend_ssa_find_sccs()
238 for (j = 0; j < ssa->vars_count; j++) { in zend_ssa_find_sccs()
239 if (ssa->vars[j].scc >= 0) { in zend_ssa_find_sccs()
242 ssa->vars[j].scc_entry = 1; in zend_ssa_find_sccs()
256 int zend_ssa_find_false_dependencies(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ in zend_ssa_find_false_dependencies() argument
258 zend_ssa_var *ssa_vars = ssa->vars; in zend_ssa_find_false_dependencies()
259 zend_ssa_op *ssa_ops = ssa->ops; in zend_ssa_find_false_dependencies()
260 int ssa_vars_count = ssa->vars_count; in zend_ssa_find_false_dependencies()
266 if (!op_array->function_name || !ssa->vars || !ssa->ops) { in zend_ssa_find_false_dependencies()
275 use = ssa->vars[i].use_chain; in zend_ssa_find_false_dependencies()
277 if (!zend_ssa_is_no_val_use(&op_array->opcodes[use], &ssa->ops[use], i)) { in zend_ssa_find_false_dependencies()
296 for (j = 0; j < ssa->cfg.blocks[p->block].predecessors_count; j++) { in zend_ssa_find_false_dependencies()
298 if (ssa->vars[p->sources[j]].no_val) { in zend_ssa_find_false_dependencies()
565 const zend_op_array *op_array, zend_ssa *ssa, in zend_inference_calc_binary_op_range() argument
849 int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int var, int widening, … in zend_inference_calc_range() argument
855 if (ssa->vars[var].definition_phi) { in zend_inference_calc_range()
856 zend_ssa_phi *p = ssa->vars[var].definition_phi; in zend_inference_calc_range()
866 if (ssa->var_info[p->sources[0]].has_range) { in zend_inference_calc_range()
867 *tmp = ssa->var_info[p->sources[0]].range; in zend_inference_calc_range()
878 ssa->var_info[p->ssa_var].has_range) { in zend_inference_calc_range()
882 ssa->var_info[p->ssa_var].range.min, in zend_inference_calc_range()
883 ssa->var_info[p->ssa_var].range.max, in zend_inference_calc_range()
899 } else if (ssa->var_info[p->sources[0]].has_range) { in zend_inference_calc_range()
901 *tmp = ssa->var_info[p->sources[0]].range; in zend_inference_calc_range()
906 } else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) { in zend_inference_calc_range()
907 tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow && tmp->underflow; in zend_inference_calc_range()
908 … if (!add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) { in zend_inference_calc_range()
909 …tmp->min = MAX(ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min, tmp->min); in zend_inference_calc_range()
917 } else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) { in zend_inference_calc_range()
918 … if (!add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) { in zend_inference_calc_range()
919 …tmp->max = MIN(ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max, tmp->max); in zend_inference_calc_range()
921 tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow && tmp->overflow; in zend_inference_calc_range()
929 } else if (narrowing && ssa->var_info[constraint->min_ssa_var].has_range) { in zend_inference_calc_range()
930 … if (add_will_overflow(ssa->var_info[constraint->min_ssa_var].range.min, constraint->range.min)) { in zend_inference_calc_range()
934 tmp->underflow = ssa->var_info[constraint->min_ssa_var].range.underflow; in zend_inference_calc_range()
935 tmp->min = ssa->var_info[constraint->min_ssa_var].range.min + constraint->range.min; in zend_inference_calc_range()
946 } else if (narrowing && ssa->var_info[constraint->max_ssa_var].has_range) { in zend_inference_calc_range()
947 … if (add_will_overflow(ssa->var_info[constraint->max_ssa_var].range.max, constraint->range.max)) { in zend_inference_calc_range()
951 tmp->max = ssa->var_info[constraint->max_ssa_var].range.max + constraint->range.max; in zend_inference_calc_range()
952 tmp->overflow = ssa->var_info[constraint->max_ssa_var].range.overflow; in zend_inference_calc_range()
961 for (i = 0; i < ssa->cfg.blocks[p->block].predecessors_count; i++) { in zend_inference_calc_range()
963 if (ssa->var_info[p->sources[i]].has_range) { in zend_inference_calc_range()
965 tmp->underflow |= ssa->var_info[p->sources[i]].range.underflow; in zend_inference_calc_range()
966 tmp->min = MIN(tmp->min, ssa->var_info[p->sources[i]].range.min); in zend_inference_calc_range()
967 tmp->max = MAX(tmp->max, ssa->var_info[p->sources[i]].range.max); in zend_inference_calc_range()
968 tmp->overflow |= ssa->var_info[p->sources[i]].range.overflow; in zend_inference_calc_range()
978 } else if (ssa->vars[var].definition < 0) { in zend_inference_calc_range()
990 line = ssa->vars[var].definition; in zend_inference_calc_range()
992 ssa_op = &ssa->ops[line]; in zend_inference_calc_range()
994 return zend_inference_propagate_range(op_array, ssa, opline, ssa_op, var, tmp); in zend_inference_calc_range()
997 int zend_inference_propagate_range(const zend_op_array *op_array, zend_ssa *ssa, zend_op *opline, z… in zend_inference_propagate_range() argument
1014 op_array, ssa, opline, ssa_op, opline->opcode, tmp); in zend_inference_propagate_range()
1228 op_array, ssa, opline, ssa_op, in zend_inference_propagate_range()
1318 type = zend_get_func_info(call_info, ssa); in zend_inference_propagate_range()
1345 void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, zend_bool und… in zend_inference_init_range() argument
1353 ssa->var_info[var].has_range = 1; in zend_inference_init_range()
1354 ssa->var_info[var].range.underflow = underflow; in zend_inference_init_range()
1355 ssa->var_info[var].range.min = min; in zend_inference_init_range()
1356 ssa->var_info[var].range.max = max; in zend_inference_init_range()
1357 ssa->var_info[var].range.overflow = overflow; in zend_inference_init_range()
1358 …LOG_SSA_RANGE(" change range (init SCC %2d) %2d [%s%ld..%ld%s]\n", ssa->vars[var].scc, var, … in zend_inference_init_range()
1389 static int zend_ssa_range_widening(const zend_op_array *op_array, zend_ssa *ssa, int var, int scc) in zend_ssa_range_widening() argument
1393 if (zend_inference_calc_range(op_array, ssa, var, 1, 0, &tmp)) { in zend_ssa_range_widening()
1394 if (zend_inference_widening_meet(&ssa->var_info[var], &tmp)) { in zend_ssa_range_widening()
1434 static int zend_ssa_range_narrowing(const zend_op_array *op_array, zend_ssa *ssa, int var, int scc) in zend_ssa_range_narrowing() argument
1438 if (zend_inference_calc_range(op_array, ssa, var, 0, 1, &tmp)) { in zend_ssa_range_narrowing()
1439 if (zend_inference_narrowing_meet(&ssa->var_info[var], &tmp)) { in zend_ssa_range_narrowing()
1450 if (ssa->vars[var2].scc == ssa->vars[var].scc && \
1451 !ssa->vars[var2].scc_entry && \
1453 zend_check_inner_cycles(op_array, ssa, worklist, visited, var2)) { \
1458 static int zend_check_inner_cycles(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset workli… in zend_check_inner_cycles() argument
1470 static void zend_infer_ranges_warmup(const zend_op_array *op_array, zend_ssa *ssa, int *scc_var, in… in zend_infer_ranges_warmup() argument
1472 int worklist_len = zend_bitset_len(ssa->vars_count); in zend_infer_ranges_warmup()
1486 zend_check_inner_cycles(op_array, ssa, worklist, visited, j)) { in zend_infer_ranges_warmup()
1499 if (ssa->vars[j].scc_entry) { in zend_infer_ranges_warmup()
1508 if (zend_inference_calc_range(op_array, ssa, j, 0, 0, &tmp)) { in zend_infer_ranges_warmup()
1511 ssa->var_info[j].has_range && in zend_infer_ranges_warmup()
1512 ssa->vars[j].definition_phi && in zend_infer_ranges_warmup()
1513 ssa->vars[j].definition_phi->pi >= 0 && in zend_infer_ranges_warmup()
1514 ssa->vars[j].definition_phi->has_range_constraint && in zend_infer_ranges_warmup()
1515 ssa->vars[j].definition_phi->constraint.range.negative && in zend_infer_ranges_warmup()
1516 ssa->vars[j].definition_phi->constraint.range.min_ssa_var < 0 && in zend_infer_ranges_warmup()
1517 ssa->vars[j].definition_phi->constraint.range.max_ssa_var < 0) { in zend_infer_ranges_warmup()
1519 &ssa->vars[j].definition_phi->constraint.range; in zend_infer_ranges_warmup()
1520 if (tmp.min == ssa->var_info[j].range.min && in zend_infer_ranges_warmup()
1521 tmp.max == ssa->var_info[j].range.max) { in zend_infer_ranges_warmup()
1526 } else if (tmp.min == ssa->var_info[j].range.min && in zend_infer_ranges_warmup()
1527 tmp.max == ssa->var_info[j].range.max + 1 && in zend_infer_ranges_warmup()
1538 } else if (tmp.max == ssa->var_info[j].range.max && in zend_infer_ranges_warmup()
1539 tmp.min == ssa->var_info[j].range.min - 1 && in zend_infer_ranges_warmup()
1556 if (zend_inference_narrowing_meet(&ssa->var_info[j], &tmp)) { in zend_infer_ranges_warmup()
1567 static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{{ */ in zend_infer_ranges() argument
1569 int worklist_len = zend_bitset_len(ssa->vars_count); in zend_infer_ranges()
1580 ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count) + in zend_infer_ranges()
1581 sizeof(int) * ssa->sccs, use_heap); in zend_infer_ranges()
1583 scc_var = (int*)((char*)next_scc_var + ZEND_MM_ALIGNED_SIZE(sizeof(int) * ssa->vars_count)); in zend_infer_ranges()
1588 memset(scc_var, -1, sizeof(int) * ssa->sccs); in zend_infer_ranges()
1589 for (j = 0; j < ssa->vars_count; j++) { in zend_infer_ranges()
1590 if (ssa->vars[j].scc >= 0) { in zend_infer_ranges()
1591 next_scc_var[j] = scc_var[ssa->vars[j].scc]; in zend_infer_ranges()
1592 scc_var[ssa->vars[j].scc] = j; in zend_infer_ranges()
1596 for (scc = 0; scc < ssa->sccs; scc++) { in zend_infer_ranges()
1600 if (zend_inference_calc_range(op_array, ssa, j, 0, 1, &tmp)) { in zend_infer_ranges()
1601 zend_inference_init_range(op_array, ssa, j, tmp.underflow, tmp.min, tmp.max, tmp.overflow); in zend_infer_ranges()
1603 zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1); in zend_infer_ranges()
1609 if (ssa->vars[j].scc_entry) { in zend_infer_ranges()
1616 zend_infer_ranges_warmup(op_array, ssa, scc_var, next_scc_var, scc); in zend_infer_ranges()
1626 if (zend_ssa_range_widening(op_array, ssa, j, scc)) { in zend_infer_ranges()
1633 if (!ssa->var_info[j].has_range) { in zend_infer_ranges()
1634 zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1); in zend_infer_ranges()
1641 if (zend_ssa_range_widening(op_array, ssa, j, scc)) { in zend_infer_ranges()
1648 if (ssa->vars[j].definition_phi in zend_infer_ranges()
1649 && ssa->vars[j].definition_phi->pi < 0) { in zend_infer_ranges()
1651 zend_ssa_range_narrowing(op_array, ssa, j, scc); in zend_infer_ranges()
1658 if (zend_ssa_range_narrowing(op_array, ssa, j, scc)) { in zend_infer_ranges()
1662 p = ssa->vars[j].sym_use_chain; in zend_infer_ranges()
1715 emit_type_narrowing_warning(op_array, ssa, __var); \
1720 add_usages(op_array, ssa, worklist, __var); \
1735 add_usages(op_array, ssa, worklist, var); \
1752 static void add_usages(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset worklist, int var) in add_usages() argument
1754 if (ssa->vars[var].phi_use_chain) { in add_usages()
1755 zend_ssa_phi *p = ssa->vars[var].phi_use_chain; in add_usages()
1758 p = zend_ssa_next_use_phi(ssa, var, p); in add_usages()
1761 if (ssa->vars[var].use_chain >= 0) { in add_usages()
1762 int use = ssa->vars[var].use_chain; in add_usages()
1766 op = ssa->ops + use; in add_usages()
1800 use = zend_ssa_next_use(ssa->ops, var, use); in add_usages()
1805 static void emit_type_narrowing_warning(const zend_op_array *op_array, zend_ssa *ssa, int var) in emit_type_narrowing_warning() argument
1807 int def_op_num = ssa->vars[var].definition; in emit_type_narrowing_warning()
1924 zend_ssa *ssa, zend_uchar opcode, uint32_t t1, uint32_t t2, int result_var, in binary_op_result_type() argument
1943 !ssa->var_info[result_var].has_range || in binary_op_result_type()
1944 ssa->var_info[result_var].range.underflow || in binary_op_result_type()
1945 ssa->var_info[result_var].range.overflow) { in binary_op_result_type()
1970 !ssa->var_info[result_var].has_range || in binary_op_result_type()
1971 ssa->var_info[result_var].range.underflow || in binary_op_result_type()
1972 ssa->var_info[result_var].range.overflow) { in binary_op_result_type()
2108 static zend_property_info *zend_fetch_prop_info(const zend_op_array *op_array, zend_ssa *ssa, zend_… in zend_fetch_prop_info() argument
2117 ce = ssa->var_info[ssa_op->op1_use].ce; in zend_fetch_prop_info()
2131 …prop_info(const zend_script *script, const zend_op_array *op_array, zend_ssa *ssa, zend_op *opline) in zend_fetch_static_prop_info() argument
2194 static zend_bool result_may_be_separated(zend_ssa *ssa, zend_ssa_op *ssa_op) in result_may_be_separated() argument
2198 if (ssa->vars[tmp_var].use_chain >= 0 in result_may_be_separated()
2199 && !ssa->vars[tmp_var].phi_use_chain) { in result_may_be_separated()
2200 zend_ssa_op *use_op = &ssa->ops[ssa->vars[tmp_var].use_chain]; in result_may_be_separated()
2215 zend_ssa *ssa, in _zend_update_type_info() argument
2226 zend_ssa_var *ssa_vars = ssa->vars; in _zend_update_type_info()
2227 zend_ssa_var_info *ssa_var_info = ssa->var_info; in _zend_update_type_info()
2270 tmp = binary_op_result_type(ssa, opline->opcode, t1, t2, ssa_op->result_def, optimization_level); in _zend_update_type_info()
2414 prop_info = zend_fetch_prop_info(op_array, ssa, opline, ssa_op); in _zend_update_type_info()
2426 prop_info = zend_fetch_static_prop_info(script, op_array, ssa, opline); in _zend_update_type_info()
2436 ssa, opline->extended_value, t1, t2, in _zend_update_type_info()
2669 zend_fetch_prop_info(op_array, ssa, opline, ssa_op), &ce); in _zend_update_type_info()
2757 if (ssa->vars[ssa_op->result_def].use_chain < 0 in _zend_update_type_info()
2758 || opline + 1 != op_array->opcodes + ssa->vars[ssa_op->result_def].use_chain) { in _zend_update_type_info()
2762 if (ssa->vars[ssa_op->result_def].use_chain < 0 in _zend_update_type_info()
2763 || opline + 1 != ssa_opcodes[ssa->vars[ssa_op->result_def].use_chain]) { in _zend_update_type_info()
3297 j = zend_ssa_next_use(ssa->ops, ssa_op->result_def, j); in _zend_update_type_info()
3331 if (ssa->vars[ssa_op->result_def].use_chain < 0 in _zend_update_type_info()
3332 || opline + 1 != op_array->opcodes + ssa->vars[ssa_op->result_def].use_chain) { in _zend_update_type_info()
3336 if (ssa->vars[ssa_op->result_def].use_chain < 0 in _zend_update_type_info()
3337 || opline + 1 != ssa_opcodes[ssa->vars[ssa_op->result_def].use_chain]) { in _zend_update_type_info()
3355 zend_property_info *prop_info = zend_fetch_prop_info(op_array, ssa, opline, ssa_op); in _zend_update_type_info()
3365 } else if (ssa_op->op1_use >= 0 && !ssa->var_info[ssa_op->op1_use].is_instanceof) { in _zend_update_type_info()
3366 ce = ssa->var_info[ssa_op->op1_use].ce; in _zend_update_type_info()
3371 if (ce && !ce->create_object && !result_may_be_separated(ssa, ssa_op)) { in _zend_update_type_info()
3375 if (ce && !ce->create_object && !ce->__get && !result_may_be_separated(ssa, ssa_op)) { in _zend_update_type_info()
3397 zend_fetch_static_prop_info(script, op_array, ssa, opline), &ce); in _zend_update_type_info()
3400 } else if (!result_may_be_separated(ssa, ssa_op)) { in _zend_update_type_info()
3426 tmp = zend_get_func_info(call_info, ssa, &ce, &ce_is_instanceof); in _zend_update_type_info()
3546 zend_ssa *ssa, in zend_update_type_info() argument
3553 …return _zend_update_type_info(op_array, ssa, script, NULL, opline, ssa_op, ssa_opcodes, optimizati… in zend_update_type_info()
3602 int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, ze… in zend_infer_types_ex() argument
3604 zend_basic_block *blocks = ssa->cfg.blocks; in zend_infer_types_ex()
3605 zend_ssa_var *ssa_vars = ssa->vars; in zend_infer_types_ex()
3606 zend_ssa_var_info *ssa_var_info = ssa->var_info; in zend_infer_types_ex()
3607 int ssa_vars_count = ssa->vars_count; in zend_infer_types_ex()
3620 tmp = get_ssa_var_info(ssa, p->sources[0]); in zend_infer_types_ex()
3654 tmp |= get_ssa_var_info(ssa, p->sources[i]); in zend_infer_types_ex()
3677 …if (_zend_update_type_info(op_array, ssa, script, worklist, op_array->opcodes + i, ssa->ops + i, N… in zend_infer_types_ex()
3724 const zend_op_array *op_array, zend_ssa *ssa, int var_num, in can_convert_to_double() argument
3726 zend_ssa_var *var = &ssa->vars[var_num]; in can_convert_to_double()
3736 for (use = var->use_chain; use >= 0; use = zend_ssa_next_use(ssa->ops, var_num, use)) { in can_convert_to_double()
3738 zend_ssa_op *ssa_op = &ssa->ops[use]; in can_convert_to_double()
3749 type = ssa->var_info[ssa_op->result_def].type; in can_convert_to_double()
3834 if (!can_convert_to_double(op_array, ssa, ssa_op->result_def, &orig_result, visited)) { in can_convert_to_double()
3840 for (phi = var->phi_use_chain; phi; phi = zend_ssa_next_use_phi(ssa, var_num, phi)) { in can_convert_to_double()
3842 type = ssa->var_info[phi->ssa_var].type; in can_convert_to_double()
3847 if (!can_convert_to_double(op_array, ssa, phi->ssa_var, value, visited)) { in can_convert_to_double()
3855 …rowing(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimiza… in zend_type_narrowing() argument
3857 uint32_t bitset_len = zend_bitset_len(ssa->vars_count); in zend_type_narrowing()
3869 for (v = op_array->last_var; v < ssa->vars_count; v++) { in zend_type_narrowing()
3870 if ((ssa->var_info[v].type & (MAY_BE_REF | MAY_BE_ANY | MAY_BE_UNDEF)) != MAY_BE_LONG) continue; in zend_type_narrowing()
3871 if (ssa->vars[v].definition < 0) continue; in zend_type_narrowing()
3872 if (ssa->vars[v].no_val) continue; in zend_type_narrowing()
3873 opline = op_array->opcodes + ssa->vars[v].definition; in zend_type_narrowing()
3881 if (can_convert_to_double(op_array, ssa, v, value, visited)) { in zend_type_narrowing()
3883 ssa->var_info[v].use_as_double = 1; in zend_type_narrowing()
3887 ssa->var_info[i].type &= ~MAY_BE_ANY; in zend_type_narrowing()
3899 if (zend_infer_types_ex(op_array, script, ssa, worklist, optimization_level) != SUCCESS) { in zend_type_narrowing()
3913 if (info->ssa.ops && info->ssa.vars && info->call_map && in is_recursive_tail_call()
3914 info->ssa.ops[opline - op_array->opcodes].op1_use >= 0 && in is_recursive_tail_call()
3915 info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use].definition >= 0) { in is_recursive_tail_call()
3917 …zend_op *op = op_array->opcodes + info->ssa.vars[info->ssa.ops[opline - op_array->opcodes].op1_use… in is_recursive_tail_call()
3954 zend_ssa *ssa = &info->ssa; in zend_func_return_info() local
3955 int blocks_count = info->ssa.cfg.blocks_count; in zend_func_return_info()
3956 zend_basic_block *blocks = info->ssa.cfg.blocks; in zend_func_return_info()
3981 zend_ssa_op *ssa_op = ssa->ops ? &ssa->ops[opline - op_array->opcodes] : NULL; in zend_func_return_info()
3982 if (!recursive && ssa_op && info->ssa.var_info && in zend_func_return_info()
3984 info->ssa.var_info[ssa_op->op1_use].recursive) { in zend_func_return_info()
4005 if (ssa_op && info->ssa.var_info && in zend_func_return_info()
4007 info->ssa.var_info[ssa_op->op1_use].ce) { in zend_func_return_info()
4008 arg_ce = info->ssa.var_info[ssa_op->op1_use].ce; in zend_func_return_info()
4009 arg_is_instanceof = info->ssa.var_info[ssa_op->op1_use].is_instanceof; in zend_func_return_info()
4093 } else if (ssa_op && info->ssa.var_info && ssa_op->op1_use >= 0) { in zend_func_return_info()
4094 if (info->ssa.var_info[ssa_op->op1_use].has_range) { in zend_func_return_info()
4097 tmp_range = info->ssa.var_info[ssa_op->op1_use].range; in zend_func_return_info()
4100 if (info->ssa.var_info[ssa_op->op1_use].range.underflow) { in zend_func_return_info()
4104 tmp_range.min = MIN(tmp_range.min, info->ssa.var_info[ssa_op->op1_use].range.min); in zend_func_return_info()
4106 if (info->ssa.var_info[ssa_op->op1_use].range.overflow) { in zend_func_return_info()
4110 tmp_range.max = MAX(tmp_range.max, info->ssa.var_info[ssa_op->op1_use].range.max); in zend_func_return_info()
4143 static int zend_infer_types(const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa… in zend_infer_types() argument
4145 zend_ssa_var_info *ssa_var_info = ssa->var_info; in zend_infer_types()
4146 int ssa_vars_count = ssa->vars_count; in zend_infer_types()
4160 if (zend_infer_types_ex(op_array, script, ssa, worklist, optimization_level) != SUCCESS) { in zend_infer_types()
4167 zend_type_narrowing(op_array, script, ssa, optimization_level); in zend_infer_types()
4178 …arena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimiza… in zend_ssa_inference() argument
4183 if (!ssa->var_info) { in zend_ssa_inference()
4184 ssa->var_info = zend_arena_calloc(arena, ssa->vars_count, sizeof(zend_ssa_var_info)); in zend_ssa_inference()
4186 ssa_var_info = ssa->var_info; in zend_ssa_inference()
4197 if (ssa->vars[i].alias) { in zend_ssa_inference()
4198 ssa_var_info[i].type |= get_ssa_alias_types(ssa->vars[i].alias); in zend_ssa_inference()
4202 for (i = op_array->last_var; i < ssa->vars_count; i++) { in zend_ssa_inference()
4207 if (zend_infer_ranges(op_array, ssa) != SUCCESS) { in zend_ssa_inference()
4211 if (zend_infer_types(op_array, script, ssa, optimization_level) != SUCCESS) { in zend_ssa_inference()
4227 if (!info->ssa.var_info || !(info->flags & ZEND_FUNC_RECURSIVE)) { in zend_inference_check_recursive_dependencies()
4230 worklist_len = zend_bitset_len(info->ssa.vars_count); in zend_inference_check_recursive_dependencies()
4236 info->ssa.ops[call_info->caller_call_opline - op_array->opcodes].result_def >= 0) { in zend_inference_check_recursive_dependencies()
4237 …zend_bitset_incl(worklist, info->ssa.ops[call_info->caller_call_opline - op_array->opcodes].result… in zend_inference_check_recursive_dependencies()
4242 if (!info->ssa.var_info[i].recursive) { in zend_inference_check_recursive_dependencies()
4243 info->ssa.var_info[i].recursive = 1; in zend_inference_check_recursive_dependencies()
4244 add_usages(op_array, &info->ssa, worklist, i); in zend_inference_check_recursive_dependencies()
4250 …pline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa, uint32_t t1, uint3… in zend_may_throw_ex() argument
4374 return zend_may_throw(opline + 1, ssa_op + 1, op_array, ssa); in zend_may_throw_ex()
4504 if (_ssa_op1_info(op_array, ssa, opline+1, ssa_op+1) & MAY_BE_UNDEF) { in zend_may_throw_ex()
4515 if (_ssa_op1_info(op_array, ssa, opline+1, ssa_op+1) & MAY_BE_UNDEF) { in zend_may_throw_ex()
4520 zend_ssa_var_info *var_info = ssa->var_info + ssa_op->op1_use; in zend_may_throw_ex()
4639 …row(const zend_op *opline, const zend_ssa_op *ssa_op, const zend_op_array *op_array, zend_ssa *ssa) in zend_may_throw() argument
4641 return zend_may_throw_ex(opline, ssa_op, op_array, ssa, OP1_INFO(), OP2_INFO()); in zend_may_throw()