Lines Matching refs:scdf
80 scdf_ctx scdf; member
150 static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) { in set_value() argument
158 zend_dump_var(scdf->op_array, IS_CV, scdf->ssa->vars[var].var); in set_value()
169 scdf_add_to_worklist(scdf, var); in set_value()
179 scdf_add_to_worklist(scdf, var); in set_value()
191 return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant); in get_op1_value()
201 return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op2.constant); in get_op2_value()
303 if (ssa_op->op1_use == var && can_replace_op1(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op1()
306 if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op1()
320 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
328 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
332 zend_ssa_unlink_use_chain(ctx->scdf.ssa, ssa_op - ctx->scdf.ssa->ops, ssa_op->op2_use); in try_replace_op1()
348 if (ssa_op->op2_use == var && can_replace_op2(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op2()
351 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op2()
359 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline + 1, &zv)) { in try_replace_op2()
361 …zend_optimizer_remove_live_range_ex(ctx->scdf.op_array, opline->result.var, ssa_op - ctx->scdf.ssa… in try_replace_op2()
362 zend_ssa_unlink_use_chain(ctx->scdf.ssa, next_op - ctx->scdf.ssa->ops, next_op->op2_use); in try_replace_op2()
365 zend_ssa_remove_result_def(ctx->scdf.ssa, ssa_op); in try_replace_op2()
1029 set_value(scdf, ctx, ssa_op->op##_def, zv); \
1037 static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op) { in sccp_visit_instr() argument
1038 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_visit_instr()
1048 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1060 uint32_t type = ctx->scdf.ssa->var_info[ssa_op->op1_use].type; in sccp_visit_instr()
1079 if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) { in sccp_visit_instr()
1099 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1117 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1170 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1174 if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) { in sccp_visit_instr()
1253 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1260 ssa_op = &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1298 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1313 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1366 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1445 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE in sccp_visit_instr()
1491 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1542 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1778 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1779 name = CT_CONSTANT_EX(ctx->scdf.op_array, call->caller_init_opline->op2.constant); in sccp_visit_instr()
1800 &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1848 scdf_ctx *scdf, in sccp_mark_feasible_successors() argument
1851 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_mark_feasible_successors()
1863 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1864 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1873 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
1889 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1890 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1901 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1902 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1917 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1918 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1925 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
1929 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
2020 static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) { in sccp_visit_phi() argument
2021 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_visit_phi()
2022 zend_ssa *ssa = scdf->ssa; in sccp_visit_phi()
2036 if (scdf_is_edge_feasible(scdf, phi->pi, phi->block)) { in sccp_visit_phi()
2042 if (scdf_is_edge_feasible(scdf, predecessors[i], phi->block)) { in sccp_visit_phi()
2059 set_value(scdf, ctx, phi->ssa_var, &result); in sccp_visit_phi()
2065 zend_ssa *ssa = ctx->scdf.ssa; in value_from_type_and_range()
2068 if (ssa->vars[var_num].var >= ctx->scdf.op_array->last_var) { in value_from_type_and_range()
2104 zend_ssa *ssa = ctx->scdf.ssa; in remove_call()
2105 zend_op_array *op_array = ctx->scdf.op_array; in remove_call()
2143 zend_ssa *ssa = ctx->scdf.ssa; in try_remove_definition()
2144 zend_op_array *op_array = ctx->scdf.op_array; in try_remove_definition()
2197 zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, value); in try_remove_definition()
2345 zend_ssa *ssa = ctx->scdf.ssa; in replace_constant_operands()
2346 zend_op_array *op_array = ctx->scdf.op_array; in replace_constant_operands()
2437 for (i = sccp->scdf.op_array->last_var; i < sccp->scdf.ssa->vars_count; ++i) { in sccp_context_free()
2450 sccp.scdf.handlers.visit_instr = sccp_visit_instr; in sccp_optimize_op_array()
2451 sccp.scdf.handlers.visit_phi = sccp_visit_phi; in sccp_optimize_op_array()
2452 sccp.scdf.handlers.mark_feasible_successors = sccp_mark_feasible_successors; in sccp_optimize_op_array()
2454 scdf_init(ctx, &sccp.scdf, op_array, ssa); in sccp_optimize_op_array()
2455 scdf_solve(&sccp.scdf, "SCCP"); in sccp_optimize_op_array()
2480 removed_ops += scdf_remove_unreachable_blocks(&sccp.scdf); in sccp_optimize_op_array()