X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestate.c;h=69e3e096a2af453d7830f70a9f31248c608a0df6;hb=03300a88ae8d61bb6c2129dcf55937f3250c1217;hp=521929d8321e714f307a726218a01f9dc604f1f7;hpb=fe43982e128771c98ee2b2d4fcc77881e72080e5;p=libfirm diff --git a/ir/be/bestate.c b/ir/be/bestate.c index 521929d83..69e3e096a 100644 --- a/ir/be/bestate.c +++ b/ir/be/bestate.c @@ -47,6 +47,7 @@ #include "belive_t.h" #include "bemodule.h" #include "benode.h" +#include "beirgmod.h" #include "bessaconstr.h" DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) @@ -182,7 +183,8 @@ static void spill_phi(minibelady_env_t *env, ir_node *phi) DBG((dbg, LEVEL_2, "\tcreate Phi-M for %+F\n", phi)); /* create a Phi-M */ - spill_info->spill = new_r_Phi(block, arity, in, mode_M); + spill_info->spill = be_new_Phi(block, arity, in, mode_M, NULL); + sched_add_after(block, spill_info->spill); if (spill_to_kill != NULL) { exchange(spill_to_kill, spill_info->spill); @@ -203,7 +205,7 @@ static void belady(minibelady_env_t *env, ir_node *block); * Collects all values live-in at block @p block and all phi results in this * block. * Then it adds the best values (at most n_regs) to the blocks start_workset. - * The phis among the remaining values get spilled: Introduce psudo-copies of + * The phis among the remaining values get spilled: Introduce pseudo-copies of * their args to break interference and make it possible to spill them to the * same spill slot. */ @@ -405,8 +407,9 @@ static void belady(minibelady_env_t *env, ir_node *block) } /* create a reload to match state if necessary */ if (need_val != NULL && need_val != current_state) { + ir_node *before = node; DBG((dbg, LEVEL_3, "\t... reloading %+F\n", need_val)); - create_reload(env, need_val, node, current_state); + create_reload(env, need_val, before, current_state); current_state = need_val; } @@ -557,7 +560,7 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env, info = env.spills; while (info != NULL) { be_ssa_construction_env_t senv; - int i, len; + size_t i, len; ir_node **phis; be_ssa_construction_init(&senv, irg); @@ -599,7 +602,7 @@ void be_assure_state(ir_graph *irg, const arch_register_t *reg, void *func_env, obstack_free(&env.obst, NULL); } -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_state); +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_state) void be_init_state(void) { FIRM_DBG_REGISTER(dbg, "firm.be.state");