BugFix: fixed list_for_each_safe() instance.
[libfirm] / ir / be / becopyopt.c
index ce7eed7..7b7affc 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "bemodule.h"
 #include "bearch.h"
-#include "benode_t.h"
+#include "benode.h"
 #include "beutil.h"
 #include "beifg_t.h"
 #include "beintlive_t.h"
@@ -1126,13 +1126,17 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix, const char
 
 void co_driver(be_chordal_env_t *cenv)
 {
-       ir_timer_t          *timer = ir_timer_register("firm.be.copyopt", "runtime");
+       ir_timer_t          *timer = ir_timer_new();
        co_complete_stats_t before, after;
        copy_opt_t          *co;
        int                 was_optimal = 0;
 
        assert(selected_copyopt);
 
+       /* skip copymin if algo is 'none' */
+       if(selected_copyopt->copyopt == void_algo)
+               return;
+
        be_liveness_assure_chk(be_get_birg_liveness(cenv->birg));
 
        co = new_copy_opt(cenv, cost_func);
@@ -1175,6 +1179,7 @@ void co_driver(be_chordal_env_t *cenv)
 
        be_stat_ev("co_time", ir_timer_elapsed_msec(timer));
        be_stat_ev_ull("co_optimal", was_optimal);
+       ir_timer_free(timer);
 
        if (dump_flags & DUMP_AFTER) {
                FILE *f = my_open(cenv, "", "-after.dot");