added some statistics
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Thu, 15 Mar 2007 17:29:37 +0000 (17:29 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Thu, 15 Mar 2007 17:29:37 +0000 (17:29 +0000)
ir/be/beilpsched.c

index fab9262..39061c2 100644 (file)
@@ -44,6 +44,7 @@
 #include "besched_t.h"
 #include "beilpsched.h"
 #include "beutil.h"
+#include "bestat.h"
 
 typedef struct _ilpsched_options_t {
        unsigned regpress;
@@ -1915,10 +1916,30 @@ static void create_ilp(ir_node *block, void *walk_env) {
        }
 
        /* apply solution */
-       if (need_heur)
+#ifdef FIRM_STATISTICS
+       if (be_stat_ev_is_active()) {
+               be_stat_ev("nodes", ba->block_last_idx);
+       }
+#endif /* FIRM_STATISTICS */
+       if (need_heur) {
+#ifdef FIRM_STATISTICS
+               if (be_stat_ev_is_active()) {
+                       be_stat_ev("time", -1);
+               }
+#endif /* FIRM_STATISTICS */
                list_sched_single_block(env->birg, block, env->be_opts);
-       else
+       }
+       else {
+#ifdef FIRM_STATISTICS
+               if (be_stat_ev_is_active()) {
+                       if (lpp)
+                               be_stat_ev_dbl("time", lpp->sol_time);
+                       else
+                               be_stat_ev("time", 0);
+               }
+#endif /* FIRM_STATISTICS */
                apply_solution(env, lpp, block);
+       }
 
        if (lpp)
                free_lpp(lpp);
@@ -1938,6 +1959,13 @@ void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts) {
 
        FIRM_DBG_REGISTER(env.dbg, "firm.be.sched.ilp");
 
+#ifdef FIRM_STATISTICS
+       if (be_stat_ev_is_active()) {
+               be_stat_tags[STAT_TAG_CLS] = "ilpsched";
+               be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
+       }
+#endif /* FIRM_STATISTICS */
+
 //     firm_dbg_set_mask(env.dbg, 1);
 
        env.irg_env    = be_ilp_sched_init_irg_ilp_schedule(sel, birg->irg);
@@ -1992,6 +2020,12 @@ void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts) {
 
        /* notify backend */
        be_ilp_sched_finish_irg_ilp_schedule(sel, birg->irg, env.irg_env);
+
+#ifdef FIRM_STATISTICS
+       if (be_stat_ev_is_active()) {
+               be_stat_ev_pop();
+       }
+#endif /* FIRM_STATISTICS */
 }
 
 /**