Lines Matching refs:ssa_op
189 static zval *get_op1_value(sccp_ctx *ctx, zend_op *opline, const zend_ssa_op *ssa_op) { in get_op1_value() argument
192 } else if (ssa_op->op1_use != -1) { in get_op1_value()
193 return &ctx->values[ssa_op->op1_use]; in get_op1_value()
199 static zval *get_op2_value(sccp_ctx *ctx, const zend_op *opline, const zend_ssa_op *ssa_op) { in get_op2_value() argument
202 } else if (ssa_op->op2_use != -1) { in get_op2_value()
203 return &ctx->values[ssa_op->op2_use]; in get_op2_value()
210 const zend_op_array *op_array, const zend_op *opline, const zend_ssa_op *ssa_op) { in can_replace_op1() argument
270 if (ssa_op->op1_def != -1) { in can_replace_op1()
280 const zend_op_array *op_array, zend_op *opline, zend_ssa_op *ssa_op) { in can_replace_op2() argument
293 sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op, int var, zval *value) { in try_replace_op1() argument
294 if (ssa_op->op1_use == var && can_replace_op1(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op1()
306 sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op, int var, zval *value) { in try_replace_op2() argument
307 if (ssa_op->op2_use == var && can_replace_op2(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op2()
864 if (ssa_op->op##_def >= 0) { \
865 set_value(scdf, ctx, ssa_op->op##_def, zv); \
873 static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op) { in sccp_visit_instr() argument
877 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_visit_instr()
878 op2 = get_op2_value(ctx, opline, ssa_op); in sccp_visit_instr()
885 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
895 zval *data = get_op1_value(ctx, opline+1, ssa_op+1); in sccp_visit_instr()
898 if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) { in sccp_visit_instr()
917 if (ssa_op->op1_def >= 0) { in sccp_visit_instr()
934 && ssa_op->op1_def >= 0) { in sccp_visit_instr()
986 if (ssa_op->op1_def >= 0 in sccp_visit_instr()
987 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
988 zval *data = get_op1_value(ctx, opline+1, ssa_op+1); in sccp_visit_instr()
989 zend_ssa_var_info *var_info = &ctx->scdf.ssa->var_info[ssa_op->op1_use]; in sccp_visit_instr()
1083 ssa_op = &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1092 result = &ctx->values[ssa_op->result_use]; in sccp_visit_instr()
1120 if (ssa_op->result_def >= 0) { in sccp_visit_instr()
1134 if (ssa_op->result_def >= 0) { in sccp_visit_instr()
1186 zval *result = &ctx->values[ssa_op->result_use]; in sccp_visit_instr()
1211 if (ssa_op->result_def >= 0 in sccp_visit_instr()
1212 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1228 ssa_op++; in sccp_visit_instr()
1294 && ssa_op->op1_def >= 0 && op2) { in sccp_visit_instr()
1296 zval *data = get_op1_value(ctx, opline+1, ssa_op+1); in sccp_visit_instr()
1338 && ssa_op->op1_def >= 0 in sccp_visit_instr()
1339 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1341 zval *data = get_op1_value(ctx, opline+1, ssa_op+1); in sccp_visit_instr()
1389 && ssa_op->op1_def >= 0 in sccp_visit_instr()
1390 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1662 if (ssa_op->result_def < 0 || IS_BOT(&ctx->values[ssa_op->result_def])) { in sccp_visit_instr()
1693 if (!IS_TOP(&ctx->values[ssa_op->result_def])) { in sccp_visit_instr()
1721 if (ssa_op->result_def < 0 || IS_BOT(&ctx->values[ssa_op->result_def])) { in sccp_visit_instr()
1827 zend_op *opline, zend_ssa_op *ssa_op) { in sccp_mark_feasible_successors() argument
1844 op1 = get_op1_value(ctx, opline, ssa_op); in sccp_mark_feasible_successors()
1846 ZEND_ASSERT(ssa_op->op1_use >= 0); in sccp_mark_feasible_successors()
1847 op1 = value_from_type_and_range(ctx, ssa_op->op1_use, &zv); in sccp_mark_feasible_successors()
2084 static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op) in remove_call() argument
2095 zend_ssa_remove_instr(ssa, opline, ssa_op); in remove_call()
2131 zend_ssa_op *ssa_op = &ssa->ops[var->definition]; in try_remove_definition() local
2133 if (ssa_op->result_def == var_num) { in try_remove_definition()
2138 zend_ssa_remove_result_def(ssa, ssa_op); in try_remove_definition()
2142 if (ssa_op->op1_def >= 0 || ssa_op->op2_def >= 0) { in try_remove_definition()
2169 zend_ssa_remove_result_def(ssa, ssa_op); in try_remove_definition()
2204 ssa_op->result_def = -1; in try_remove_definition()
2206 removed_ops = remove_call(ctx, opline, ssa_op) - 1; in try_remove_definition()
2209 zend_ssa_remove_instr(ssa, opline, ssa_op); in try_remove_definition()
2212 zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1); in try_remove_definition()
2216 ssa_op->result_def = var_num; in try_remove_definition()
2225 && (!value_known(&ctx->values[ssa_op->op2_use]) in try_remove_definition()
2226 || IS_PARTIAL_ARRAY(&ctx->values[ssa_op->op2_use]) in try_remove_definition()
2227 || IS_PARTIAL_OBJECT(&ctx->values[ssa_op->op2_use]))) { in try_remove_definition()
2230 && (!value_known(&ctx->values[ssa_op->op1_use]) in try_remove_definition()
2231 || IS_PARTIAL_ARRAY(&ctx->values[ssa_op->op1_use]) in try_remove_definition()
2232 || IS_PARTIAL_OBJECT(&ctx->values[ssa_op->op1_use]))) { in try_remove_definition()
2235 zend_ssa_remove_result_def(ssa, ssa_op); in try_remove_definition()
2246 zend_ssa_remove_result_def(ssa, ssa_op); in try_remove_definition()
2248 removed_ops = remove_call(ctx, opline, ssa_op); in try_remove_definition()
2251 zend_ssa_remove_instr(ssa, opline, ssa_op); in try_remove_definition()
2254 zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1); in try_remove_definition()
2259 } else if (ssa_op->op1_def == var_num) { in try_remove_definition()
2276 if ((ssa_op->op2_use >= 0 && !value_known(&ctx->values[ssa_op->op2_use])) in try_remove_definition()
2277 || ((ssa_op+1)->op1_use >= 0 &&!value_known(&ctx->values[(ssa_op+1)->op1_use]))) { in try_remove_definition()
2285 if (ssa_op->op2_use >= 0 && !value_known(&ctx->values[ssa_op->op2_use])) { in try_remove_definition()
2296 if (zend_may_throw(opline, ssa_op, op_array, ssa)) { in try_remove_definition()
2304 if (ssa_op->result_def >= 0) { in try_remove_definition()
2305 if (ssa->vars[ssa_op->result_def].use_chain < 0 in try_remove_definition()
2306 && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) { in try_remove_definition()
2307 zend_ssa_remove_result_def(ssa, ssa_op); in try_remove_definition()
2319 } else if (ssa_op->op2_use >= 0) { in try_remove_definition()
2320 if (ssa_op->op2_use != ssa_op->op1_use) { in try_remove_definition()
2321 zend_ssa_unlink_use_chain(ssa, var->definition, ssa_op->op2_use); in try_remove_definition()
2323 ssa_op->op2_use = -1; in try_remove_definition()
2324 ssa_op->op2_use_chain = -1; in try_remove_definition()
2332 zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1); in try_remove_definition()
2338 zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1); in try_remove_definition()
2354 zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, 1); in try_remove_definition()
2356 zend_ssa_remove_op1_def(ssa, ssa_op); in try_remove_definition()
2357 zend_ssa_remove_instr(ssa, opline, ssa_op); in try_remove_definition()
2406 zend_ssa_op *ssa_op = &ssa->ops[use]; in replace_constant_operands() local
2407 if (try_replace_op1(ctx, opline, ssa_op, i, value)) { in replace_constant_operands()
2411 ZEND_ASSERT(ssa_op->op1_def == -1); in replace_constant_operands()
2412 if (ssa_op->op1_use != ssa_op->op2_use) { in replace_constant_operands()
2413 zend_ssa_unlink_use_chain(ssa, use, ssa_op->op1_use); in replace_constant_operands()
2415 ssa_op->op2_use_chain = ssa_op->op1_use_chain; in replace_constant_operands()
2417 ssa_op->op1_use = -1; in replace_constant_operands()
2418 ssa_op->op1_use_chain = -1; in replace_constant_operands()
2420 if (try_replace_op2(ctx, opline, ssa_op, i, value)) { in replace_constant_operands()
2421 ZEND_ASSERT(ssa_op->op2_def == -1); in replace_constant_operands()
2422 if (ssa_op->op2_use != ssa_op->op1_use) { in replace_constant_operands()
2423 zend_ssa_unlink_use_chain(ssa, use, ssa_op->op2_use); in replace_constant_operands()
2425 ssa_op->op2_use = -1; in replace_constant_operands()
2426 ssa_op->op2_use_chain = -1; in replace_constant_operands()