remove arch_irn_class_is macro as it hides usages of arch_irn_class_XXX from grep...
[libfirm] / ir / be / bespillslots.c
index 6a6906b..6fa43ca 100644 (file)
@@ -348,16 +348,19 @@ static void do_greedy_coalescing(be_fec_env_t *env)
        int affinity_edge_count;
        bitset_t **interferences;
        int* spillslot_unionfind;
+       struct obstack data;
 
        spillcount = set_count(env->spills);
        if (spillcount == 0)
                return;
 
+       obstack_init(&data);
+
        DB((dbg, DBG_COALESCING, "Coalescing %d spillslots\n", spillcount));
 
-       interferences       = ALLOCAN(bitset_t*, spillcount);
-       spillslot_unionfind = ALLOCAN(int,       spillcount);
-       spilllist           = ALLOCAN(spill_t*,  spillcount);
+       interferences       = OALLOCN(&data, bitset_t*, spillcount);
+       spillslot_unionfind = OALLOCN(&data, int,       spillcount);
+       spilllist           = OALLOCN(&data, spill_t*,  spillcount);
 
        uf_init(spillslot_unionfind, spillcount);
 
@@ -372,7 +375,7 @@ static void do_greedy_coalescing(be_fec_env_t *env)
        }
 
        for (i = 0; i < spillcount; ++i) {
-               interferences[i] = bitset_alloca(spillcount);
+               interferences[i] = bitset_obstack_alloc(&data, spillcount);
        }
 
        /* construct interferences */
@@ -462,6 +465,7 @@ static void do_greedy_coalescing(be_fec_env_t *env)
        }
 
        /*dump_interference_graph(env, interferences, "after");*/
+       obstack_free(&data, 0);
 }
 
 
@@ -812,11 +816,7 @@ static void collect_spills_walker(ir_node *node, void *data)
        const arch_register_class_t *cls;
        int align;
 
-       /* classify returns classification of the irn the proj is attached to */
-       if (is_Proj(node))
-               return;
-
-       if (!arch_irn_class_is(node, reload))
+       if (! (arch_irn_classify(node) & arch_irn_class_reload))
                return;
 
        mode  = get_irn_mode(node);
@@ -838,9 +838,8 @@ void be_coalesce_spillslots(be_irg_t *birg)
        be_free_frame_entity_coalescer(env);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);
 void be_init_spillslots(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.spillslots");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);