From: Christian Würdig Date: Thu, 15 Mar 2007 17:29:37 +0000 (+0000) Subject: added some statistics X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=ca0a04fba5e2575d2cbcda89be032043fe960cb3;p=libfirm added some statistics --- diff --git a/ir/be/beilpsched.c b/ir/be/beilpsched.c index fab9262bc..39061c268 100644 --- a/ir/be/beilpsched.c +++ b/ir/be/beilpsched.c @@ -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 */ } /**