spill_info->spills = spill;
}
-void be_add_reload2(spill_env_t *env, ir_node *to_spill, ir_node *before,
- const arch_register_class_t *reload_cls, int allow_remat)
+void be_add_reload(spill_env_t *env, ir_node *to_spill, ir_node *before, const arch_register_class_t *reload_cls, int allow_remat)
{
spill_info_t *info;
reloader_t *rel;
to_spill, before, allow_remat ? "" : " not"));
}
-void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before,
- const arch_register_class_t *reload_cls, int allow_remat)
-{
- be_add_reload2(senv, to_spill, before, reload_cls, allow_remat);
-
-}
-
ir_node *be_get_end_of_block_insertion_point(const ir_node *block)
{
ir_node *last = sched_last(block);
ir_graph *irg = env->irg;
ir_node *phi = spillinfo->to_spill;
ir_node *block = get_nodes_block(phi);
- ir_node *unknown;
- ir_node **ins;
spill_t *spill;
int i;
- int arity;
- assert(is_Phi(phi));
assert(!get_opt_cse());
DBG((dbg, LEVEL_1, "spilling Phi %+F:\n", phi));
/* build a new PhiM */
- arity = get_irn_arity(phi);
- ins = ALLOCAN(ir_node*, arity);
- unknown = new_r_Unknown(irg, mode_M);
+ int const arity = get_Phi_n_preds(phi);
+ ir_node **const ins = ALLOCAN(ir_node*, arity);
+ ir_node *const unknown = new_r_Unknown(irg, mode_M);
for (i = 0; i < arity; ++i) {
ins[i] = unknown;
}
if (is_Unknown(arg) || is_NoMem(arg))
return 1;
- if (be_is_Spill(skip_Proj_const(arg)))
+ if (arch_irn_is(skip_Proj_const(arg), spill))
return 1;
if (arg == get_irg_frame(env->irg))
{
int i, arity;
ir_node *res;
- ir_node *bl;
ir_node **ins;
- if (is_Block(reloader)) {
- bl = reloader;
- } else {
- bl = get_nodes_block(reloader);
- }
-
ins = ALLOCAN(ir_node*, get_irn_arity(spilled));
for (i = 0, arity = get_irn_arity(spilled); i < arity; ++i) {
ir_node *arg = get_irn_n(spilled, i);
}
/* create a copy of the node */
+ ir_node *const bl = get_nodes_block(reloader);
res = new_ir_node(get_irn_dbg_info(spilled), env->irg, bl,
get_irn_op(spilled), get_irn_mode(spilled),
get_irn_arity(spilled), ins);
be_ssa_construction_add_copies(&senv, copies, ARR_LEN(copies));
be_ssa_construction_fix_users(&senv, to_spill);
-#if 0
- /* no need to enable this as long as we invalidate liveness
- after this function... */
- be_ssa_construction_update_liveness_phis(&senv);
- be_liveness_update(to_spill);
- len = ARR_LEN(copies);
- for (i = 0; i < len; ++i) {
- be_liveness_update(lv, copies[i]);
- }
-#endif
be_ssa_construction_destroy(&senv);
}
/* need to reconstruct SSA form if we had multiple spills */