include "obst.h" instead of hand generated code
[libfirm] / ir / be / bechordal_main.c
index b423b2c..7cada80 100644 (file)
 
 
 void be_ra_chordal_check(be_chordal_env_t *chordal_env) {
-       firm_dbg_module_t *dbg = chordal_env->dbg;
        const arch_env_t *arch_env = chordal_env->birg->main_env->arch_env;
        struct obstack ob;
        pmap_entry *pme;
        ir_node **nodes, *n1, *n2;
        int i, o;
+       DEBUG_ONLY(firm_dbg_module_t *dbg = chordal_env->dbg;)
 
        /* Collect all irns */
        obstack_init(&ob);
@@ -98,13 +98,13 @@ void be_ra_chordal_check(be_chordal_env_t *chordal_env) {
 static void check_pressure_walker(ir_node *bl, void *data)
 {
        be_chordal_env_t *env = data;
-       firm_dbg_module_t *dbg = env->dbg;
        int n_regs = arch_register_class_n_regs(env->cls);
 
        pset *live = pset_new_ptr_default();
        int step = 0;
        ir_node *irn;
        irn_live_t *li;
+       DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;)
 
        live_foreach(bl, li) {
                if(live_is_end(li) && chordal_has_class(env, li->irn)) {
@@ -240,11 +240,11 @@ static void dump(unsigned mask, ir_graph *irg,
                if(cls) {
                        char buf[256];
                        snprintf(buf, sizeof(buf), "-%s%s", cls->name, suffix);
-                       dump_func(irg, buf);
+                       be_dump(irg, buf, dump_func);
                }
 
                else
-                       dump_func(irg, suffix);
+                       be_dump(irg, suffix, dump_func);
        }
 }
 
@@ -260,9 +260,9 @@ static void be_ra_chordal_main(const be_irg_t *bi)
 
        chordal_env.opts         = &options;
        chordal_env.irg          = irg;
-       chordal_env.dbg          = firm_dbg_register("firm.be.chordal");
-       chordal_env.birg                 = bi;
+       chordal_env.birg         = bi;
        chordal_env.dom_front    = be_compute_dominance_frontiers(irg);
+       FIRM_DBG_REGISTER(chordal_env.dbg, "firm.be.chordal");
 
        obstack_init(&chordal_env.obst);
 
@@ -292,9 +292,6 @@ static void be_ra_chordal_main(const be_irg_t *bi)
                be_liveness(irg);
                be_check_pressure(&chordal_env);
 
-               be_liveness(irg);
-               be_check_pressure(&chordal_env);
-
                /* Color the graph. */
                be_ra_chordal_color(&chordal_env);
                dump(BE_CH_DUMP_CONSTR, irg, chordal_env.cls, "-color", dump_ir_block_graph_sched);
@@ -304,7 +301,6 @@ static void be_ra_chordal_main(const be_irg_t *bi)
                be_ifg_check(chordal_env.ifg);
 
                /* copy minimization */
-               copystat_collect_cls(&chordal_env);
 #ifdef COPYOPT_STAT
                co_compare_solvers(&chordal_env);
 #else
@@ -323,7 +319,7 @@ static void be_ra_chordal_main(const be_irg_t *bi)
                be_ssa_destruction(&chordal_env);
                dump(BE_CH_DUMP_SSADESTR, irg, chordal_env.cls, "-ssadestr", dump_ir_block_graph_sched);
                be_ssa_destruction_check(&chordal_env);
-//             be_ra_chordal_check(&chordal_env);
+               be_ra_chordal_check(&chordal_env);
 
                copystat_dump(irg);