Lines Matching refs:scdf

81 	scdf_ctx scdf;  member
151 static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) { in set_value() argument
159 zend_dump_var(scdf->op_array, IS_CV, scdf->ssa->vars[var].var); in set_value()
170 scdf_add_to_worklist(scdf, var); in set_value()
180 scdf_add_to_worklist(scdf, var); in set_value()
193 return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op1.constant); in get_op1_value()
203 return CT_CONSTANT_EX(ctx->scdf.op_array, opline->op2.constant); in get_op2_value()
295 if (ssa_op->op1_use == var && can_replace_op1(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op1()
298 if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op1()
317 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
325 opline->op1.constant = zend_optimizer_add_literal(ctx->scdf.op_array, &zv); in try_replace_op1()
329 zend_ssa_unlink_use_chain(ctx->scdf.ssa, ssa_op - ctx->scdf.ssa->ops, ssa_op->op2_use); in try_replace_op1()
345 if (ssa_op->op2_use == var && can_replace_op2(ctx->scdf.op_array, opline, ssa_op)) { in try_replace_op2()
348 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline, &zv)) { in try_replace_op2()
356 if (zend_optimizer_update_op2_const(ctx->scdf.op_array, opline + 1, &zv)) { in try_replace_op2()
358 zend_ssa_unlink_use_chain(ctx->scdf.ssa, next_op - ctx->scdf.ssa->ops, next_op->op2_use); in try_replace_op2()
361 zend_ssa_remove_result_def(ctx->scdf.ssa, ssa_op); in try_replace_op2()
1002 set_value(scdf, ctx, ssa_op->op##_def, zv); \
1010 static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op) { in sccp_visit_instr() argument
1011 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_visit_instr()
1022 if (IS_BOT(op1) && (ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_REF)) { in sccp_visit_instr()
1034 uint32_t type = ctx->scdf.ssa->var_info[ssa_op->op1_use].type; in sccp_visit_instr()
1053 if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) { in sccp_visit_instr()
1142 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1144 zend_ssa_var_info *var_info = &ctx->scdf.ssa->var_info[ssa_op->op1_use]; in sccp_visit_instr()
1229 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1236 ssa_op = &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1365 && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1492 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1543 && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) { in sccp_visit_instr()
1816 call = ctx->call_map[opline - ctx->scdf.op_array->opcodes]; in sccp_visit_instr()
1817 name = CT_CONSTANT_EX(ctx->scdf.op_array, call->caller_init_opline->op2.constant); in sccp_visit_instr()
1838 &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]); in sccp_visit_instr()
1854 if (ct_eval_func_call(scdf->op_array, &zv, Z_STR_P(name), call->num_args, args) == SUCCESS) { in sccp_visit_instr()
1886 scdf_ctx *scdf, in sccp_mark_feasible_successors() argument
1889 sccp_ctx *ctx = (sccp_ctx *) scdf; 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()
1909 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
1925 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1926 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1937 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1938 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1956 scdf_mark_edge_feasible(scdf, block_num, block->successors[0]); in sccp_mark_feasible_successors()
1957 scdf_mark_edge_feasible(scdf, block_num, block->successors[1]); in sccp_mark_feasible_successors()
1974 zend_op_array *op_array = scdf->op_array; in sccp_mark_feasible_successors()
1975 zend_ssa *ssa = scdf->ssa; in sccp_mark_feasible_successors()
1987 scdf_mark_edge_feasible(scdf, block_num, target); in sccp_mark_feasible_successors()
1990 zend_op_array *op_array = scdf->op_array; in sccp_mark_feasible_successors()
1991 zend_ssa *ssa = scdf->ssa; in sccp_mark_feasible_successors()
1993 scdf_mark_edge_feasible(scdf, block_num, target); in sccp_mark_feasible_successors()
2001 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
2005 scdf_mark_edge_feasible(scdf, block_num, block->successors[s]); in sccp_mark_feasible_successors()
2096 static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) { in sccp_visit_phi() argument
2097 sccp_ctx *ctx = (sccp_ctx *) scdf; in sccp_visit_phi()
2098 zend_ssa *ssa = scdf->ssa; in sccp_visit_phi()
2112 if (scdf_is_edge_feasible(scdf, phi->pi, phi->block)) { in sccp_visit_phi()
2118 if (scdf_is_edge_feasible(scdf, predecessors[i], phi->block)) { in sccp_visit_phi()
2135 set_value(scdf, ctx, phi->ssa_var, &result); in sccp_visit_phi()
2141 zend_ssa *ssa = ctx->scdf.ssa; in value_from_type_and_range()
2184 zend_ssa *ssa = ctx->scdf.ssa; in remove_call()
2185 zend_op_array *op_array = ctx->scdf.op_array; in remove_call()
2223 zend_ssa *ssa = ctx->scdf.ssa; in try_remove_definition()
2224 zend_op_array *op_array = ctx->scdf.op_array; in try_remove_definition()
2309 zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, value); in try_remove_definition()
2450 zend_ssa *ssa = ctx->scdf.ssa; in replace_constant_operands()
2451 zend_op_array *op_array = ctx->scdf.op_array; in replace_constant_operands()
2542 for (i = sccp->scdf.op_array->last_var; i < sccp->scdf.ssa->vars_count; ++i) { in sccp_context_free()
2555 sccp.scdf.handlers.visit_instr = sccp_visit_instr; in sccp_optimize_op_array()
2556 sccp.scdf.handlers.visit_phi = sccp_visit_phi; in sccp_optimize_op_array()
2557 sccp.scdf.handlers.mark_feasible_successors = sccp_mark_feasible_successors; in sccp_optimize_op_array()
2559 scdf_init(ctx, &sccp.scdf, op_array, ssa); in sccp_optimize_op_array()
2560 scdf_solve(&sccp.scdf, "SCCP"); in sccp_optimize_op_array()
2585 removed_ops += scdf_remove_unreachable_blocks(&sccp.scdf); in sccp_optimize_op_array()