fix arm scheduler
[libfirm] / ir / be / bemain.c
index cd0ba3f..2382e5e 100644 (file)
@@ -345,6 +345,7 @@ lc_timer_t *t_other;
 lc_timer_t *t_verify;
 lc_timer_t *t_heights;
 lc_timer_t *t_live;
+lc_timer_t *t_execfreq;
 lc_timer_t *t_ssa_constr;
 lc_timer_t *t_ra_constr;
 lc_timer_t *t_ra_prolog;
@@ -389,6 +390,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                t_other      = lc_timer_register("time_other",       "other");
                t_heights    = lc_timer_register("time_heights",     "heights");
                t_live       = lc_timer_register("time_liveness",    "be liveness");
+               t_execfreq   = lc_timer_register("time_execfreq",    "execfreq");
                t_ssa_constr = lc_timer_register("time_ssa_constr",  "ssa reconstruction");
                t_ra_prolog  = lc_timer_register("time_ra_prolog",   "regalloc prolog");
                t_ra_epilog  = lc_timer_register("time_ra_epilog",   "regalloc epilog");
@@ -465,16 +467,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                stat_ev_ctx_push_fobj("bemain_irg", irg);
 
                /* stop and reset timers */
-               BE_TIMER_ONLY(
-                       LC_STOP_AND_RESET_TIMER(t_abi);
-                       LC_STOP_AND_RESET_TIMER(t_codegen);
-                       LC_STOP_AND_RESET_TIMER(t_sched);
-                       LC_STOP_AND_RESET_TIMER(t_constr);
-                       LC_STOP_AND_RESET_TIMER(t_finish);
-                       LC_STOP_AND_RESET_TIMER(t_emit);
-                       LC_STOP_AND_RESET_TIMER(t_verify);
-                       LC_STOP_AND_RESET_TIMER(t_other);
-               );
                BE_TIMER_PUSH(t_other);   /* t_other */
 
                /* Verify the initial graph */
@@ -535,6 +527,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                        assert(be_check_dominance(irg) && "Dominance verification failed");
                }
 
+               BE_TIMER_PUSH(t_execfreq);
                /**
                 * Create execution frequencies from profile data or estimate some
                 */
@@ -542,6 +535,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                        birg->exec_freq = ir_create_execfreqs_from_profile(irg);
                else
                        birg->exec_freq = compute_execfreq(irg, 10);
+               BE_TIMER_POP(t_execfreq);
 
 
                /* disabled for now, fails for EmptyFor.c and XXEndless.c */
@@ -690,11 +684,15 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                stat_ev_if {    \
                        stat_ev_dbl(lc_timer_get_name(timer), lc_timer_elapsed_msec(timer));  \
                } else { \
-                       printf("%-20s: %.3lf msec\n", lc_timer_get_description(timer), (double)lc_timer_elapsed_usec(timer) / 1000.0); \
-               }
+                       printf("%-20s: %8.3lf msec\n", lc_timer_get_description(timer), (double)lc_timer_elapsed_usec(timer) / 1000.0); \
+               } \
+               LC_STOP_AND_RESET_TIMER(timer);
 
                BE_TIMER_ONLY(
-                       printf("==>> IRG %s <<==\n", get_entity_name(get_irg_entity(irg)));
+                       stat_ev_if {
+                       } else {
+                               printf("==>> IRG %s <<==\n", get_entity_name(get_irg_entity(irg)));
+                       }
                        LC_EMIT(t_abi);
                        LC_EMIT(t_codegen);
                        LC_EMIT(t_sched);
@@ -702,6 +700,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                        LC_EMIT(t_heights);
                        LC_EMIT(t_ssa_constr);
                        LC_EMIT(t_constr);
+                       LC_EMIT(t_execfreq);
                        LC_EMIT(t_ra_prolog);
                        LC_EMIT(t_ra_spill);
                        LC_EMIT(t_ra_spill_apply);