fixed DEL_ARR_F
[libfirm] / ir / be / bespillbelady.c
index cd1acec..7f6248b 100644 (file)
@@ -318,7 +318,7 @@ static void displace(belady_env_t *env, workset_t *new_vals, int is_usage) {
                        to_insert[demand++] = val;
                        if (is_usage) {
                                DBG((dbg, DBG_SPILL, "Reload %+F before %+F\n", val, env->instr));
-                               be_add_reload(env->senv, val, env->instr, env->cls);
+                               be_add_reload(env->senv, val, env->instr, env->cls, 1);
                        }
                }
                else {
@@ -680,7 +680,7 @@ static void fix_block_borders(ir_node *block, void *data) {
                        /* irnb is not in memory at the end of pred, so we have to reload it */
                        DBG((dbg, DBG_FIX, "    reload %+F\n", irnb));
                        DBG((dbg, DBG_SPILL, "Reload %+F before %+F,%d\n", irnb, block, i));
-                       be_add_reload_on_edge(env->senv, irnb, block, i, env->cls);
+                       be_add_reload_on_edge(env->senv, irnb, block, i, env->cls, 1);
 
 next_value:
                        /*epsilon statement :)*/;
@@ -700,6 +700,10 @@ void be_spill_belady_spill_env(be_irg_t *birg, const arch_register_class_t *cls,
        //firm_dbg_set_mask(dbg, DBG_SPILL);
 
        be_assure_liveness(birg);
+       /* construct control flow loop tree */
+       if(! (get_irg_loopinfo_state(irg) & loopinfo_cf_consistent)) {
+               construct_cf_backedges(irg);
+       }
 
        /* init belady env */
        obstack_init(&env.ob);
@@ -733,15 +737,10 @@ void be_spill_belady_spill_env(be_irg_t *birg, const arch_register_class_t *cls,
        obstack_free(&env.ob, NULL);
 }
 
-static void be_spill_belady_oldinterface(const be_chordal_env_t *chordal_env)
-{
-       be_spill_belady(chordal_env->birg, chordal_env->cls);
-}
-
 void be_init_spillbelady(void)
 {
        static be_spiller_t belady_spiller = {
-               be_spill_belady_oldinterface
+               be_spill_belady
        };
 
        be_register_spiller("belady", &belady_spiller);