Lines Matching refs:scdf
79 scdf_ctx scdf; member
149 static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, const zval *new) { in set_value() argument
157 zend_dump_var(scdf->op_array, IS_CV, scdf->ssa->vars[var].var); in set_value()
168 scdf_add_to_worklist(scdf, var); in set_value()
178 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()
294 if (ssa_op->op1_use == var && can_replace_op1(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op1()
297 if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op1()
307 if (ssa_op->op2_use == var && can_replace_op2(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op2()
310 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op2()
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
874 sccp_ctx *ctx = (sccp_ctx *) scdf; 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()
898 if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) { in sccp_visit_instr()
987 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
989 zend_ssa_var_info *var_info = &ctx->scdf.ssa->var_info[ssa_op->op1_use]; in sccp_visit_instr()
1076 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1083 ssa_op = &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1212 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1339 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1390 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1658 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1659 name = CT_CONSTANT_EX(ctx->scdf.op_array, call->caller_init_opline->op2.constant); in sccp_visit_instr()
1681 &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1697 if (ct_eval_func_call(scdf->op_array, &zv, Z_STR_P(name), call->num_args, args) == SUCCESS) { in sccp_visit_instr()
1732 … args[2] = get_op1_value(ctx, op_data, &ctx->scdf.ssa->ops[op_data - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1736 … args[1] = get_op2_value(ctx, opline, &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1739 … args[0] = get_op1_value(ctx, opline, &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1753 if (ct_eval_func_call_ex(scdf->op_array, &zv, func, num_args, args) == SUCCESS) { in sccp_visit_instr()
1773 zend_ssa *ssa = ctx->scdf.ssa; in value_from_type_and_range()
1788 … && ctx->scdf.op_array->opcodes[ssa->vars[var_num].definition].opcode == ZEND_VERIFY_RETURN_TYPE) { in value_from_type_and_range()
1796 … && ctx->scdf.op_array->opcodes[ssa->vars[var_num].definition].opcode == ZEND_VERIFY_RETURN_TYPE) { in value_from_type_and_range()
1804 … && ctx->scdf.op_array->opcodes[ssa->vars[var_num].definition].opcode == ZEND_VERIFY_RETURN_TYPE) { in value_from_type_and_range()
1825 scdf_ctx *scdf, in sccp_mark_feasible_successors() argument
1828 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_mark_feasible_successors()
1839 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1840 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1853 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
1868 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1869 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1880 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1881 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1899 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1900 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1917 zend_op_array *op_array = scdf->op_array; in sccp_mark_feasible_successors()
1918 zend_ssa *ssa = scdf->ssa; in sccp_mark_feasible_successors()
1930 scdf_mark_edge_feasible(scdf, block_num, target); in sccp_mark_feasible_successors()
1933 zend_op_array *op_array = scdf->op_array; in sccp_mark_feasible_successors()
1934 zend_ssa *ssa = scdf->ssa; in sccp_mark_feasible_successors()
1936 scdf_mark_edge_feasible(scdf, block_num, target); in sccp_mark_feasible_successors()
1944 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
1948 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
2039 static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) { in sccp_visit_phi() argument
2040 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_visit_phi()
2041 zend_ssa *ssa = scdf->ssa; in sccp_visit_phi()
2055 if (scdf_is_edge_feasible(scdf, phi->pi, phi->block)) { in sccp_visit_phi()
2061 if (scdf_is_edge_feasible(scdf, predecessors[i], phi->block)) { in sccp_visit_phi()
2078 set_value(scdf, ctx, phi->ssa_var, &result); in sccp_visit_phi()
2086 zend_ssa *ssa = ctx->scdf.ssa; in remove_call()
2087 zend_op_array *op_array = ctx->scdf.op_array; in remove_call()
2125 zend_ssa *ssa = ctx->scdf.ssa; in try_remove_definition()
2126 zend_op_array *op_array = ctx->scdf.op_array; in try_remove_definition()
2221 zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, value); in try_remove_definition()
2372 zend_ssa *ssa = ctx->scdf.ssa; in replace_constant_operands()
2373 zend_op_array *op_array = ctx->scdf.op_array; in replace_constant_operands()
2464 for (i = sccp->scdf.op_array->last_var; i < sccp->scdf.ssa->vars_count; ++i) { in sccp_context_free()
2477 sccp.scdf.handlers.visit_instr = sccp_visit_instr; in sccp_optimize_op_array()
2478 sccp.scdf.handlers.visit_phi = sccp_visit_phi; in sccp_optimize_op_array()
2479 sccp.scdf.handlers.mark_feasible_successors = sccp_mark_feasible_successors; in sccp_optimize_op_array()
2481 scdf_init(ctx, &sccp.scdf, op_array, ssa); in sccp_optimize_op_array()
2482 scdf_solve(&sccp.scdf, "SCCP"); in sccp_optimize_op_array()
2507 removed_ops += scdf_remove_unreachable_blocks(&sccp.scdf); in sccp_optimize_op_array()