refactored
authorDaniel Grund <grund@cs.uni-saarland.de>
Tue, 16 Aug 2005 18:19:22 +0000 (18:19 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Tue, 16 Aug 2005 18:19:22 +0000 (18:19 +0000)
ir/be/becopyoptmain.c

index 8393184..6451c54 100644 (file)
@@ -26,50 +26,50 @@ static firm_dbg_module_t *dbg = NULL;
 
 void be_copy_opt_init(void) {
        dbg = firm_dbg_register("ir.be.copyoptmain");
-       firm_dbg_set_mask(dbg, LEVEL_1);
+       firm_dbg_set_mask(dbg, DEBUG_LVL);
 }
 
 void be_copy_opt(be_chordal_env_t *chordal_env) {
        copy_opt_t *co;
-       int lb, copy_costs;
+       int costs, costs_init=-1, costs_heur=-1, costs_ilp=-1;
+       int lower_bound;
 
        /* BETTER: You can remove this if you replace all
         * `grep get_irn_out *.c` by the irouts.h module.*/
        compute_outs(chordal_env->session_env->irg);
 
-       co = new_copy_opt(chordal_env, get_costs_loop_depth);
+       co = new_copy_opt(chordal_env, get_costs_all_one);
        DBG((dbg, LEVEL_1, "----> CO: %s\n", co->name));
 
+
 #ifdef DO_STAT
-       lb = co_get_lower_bound(co);
-       copy_costs = co_get_copy_costs(co);
+       lower_bound = co_get_lower_bound(co);
+       DBG((dbg, LEVEL_1, "Lower Bound: %3d\n", lower_bound));
+       costs = co_get_copy_costs(co);
+       costs_init = costs;
        copystat_add_max_costs(co_get_max_copy_costs(co));
        copystat_add_inevit_costs(co_get_inevit_copy_costs(co));
-       copystat_add_init_costs(copy_costs);
-       DBG((dbg, LEVEL_1, "Init costs: %3d <= %3d\n", lb, copy_costs));
+       copystat_add_init_costs(costs_init);
+       DBG((dbg, LEVEL_1, "Init costs: %3d\n", costs_init));
 #endif
 
 #ifdef DO_HEUR
        co_heur_opt(co);
 #ifdef DO_STAT
-       copy_costs = co_get_copy_costs(co);
-       copystat_add_heur_costs(copy_costs);
-       DBG((dbg, LEVEL_1, "Heur costs: %3d <= %3d\n", lb, copy_costs));
+       costs = co_get_copy_costs(co);
+       costs_heur = costs;
+       copystat_add_heur_costs(costs_heur);
+       DBG((dbg, LEVEL_1, "Heur costs: %3d\n", costs_heur));
 #endif
 #endif
 
 #ifdef DO_ILP
-       copy_costs = co_get_copy_costs(co);
-       assert(copy_costs>=lb && "At least one computation of these two is boooogy");
-       if (copy_costs > lb) {
-               co_ilp_opt(co);
-       }
-
+       co_ilp_opt(co);
 #ifdef DO_STAT
-       copy_costs = co_get_copy_costs(co);
-       assert(copy_costs>=lb && "At least one computation of these two is boooogy");
-       copystat_add_opt_costs(copy_costs);
-       DBG((dbg, LEVEL_1, "Opt  costs: %3d <= %3d\n", lb, copy_costs));
+       costs = co_get_copy_costs(co);
+       costs_ilp = costs;
+       copystat_add_opt_costs(costs_ilp);
+       DBG((dbg, LEVEL_1, "Opt  costs: %3d\n", costs_ilp));
 #endif
 #endif