From 49f0621a09d375221d376adb201eafe4f5d61f3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20W=C3=BCrdig?= Date: Sat, 8 Apr 2006 21:04:31 +0000 Subject: [PATCH] added scheduling statistics for number of ready nodes --- ir/be/Makefile.in | 3 ++- ir/be/belistsched.c | 4 ++++ ir/be/bemain.c | 2 +- ir/be/bestat.c | 7 +++++++ ir/be/bestat.h | 8 ++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ir/be/Makefile.in b/ir/be/Makefile.in index 560f62b5f..678d25203 100644 --- a/ir/be/Makefile.in +++ b/ir/be/Makefile.in @@ -28,7 +28,8 @@ SOURCES += Makefile.in besched.h belistsched.h belistsched.c \ bechordal_draw.h beirgmod.c beirgmod.h benode.c benode_t.h \ bessadestr.c beifg_std.c bespill.c bespillbelady.c bespillilp.c beuses.c \ belower.c belower.h beraextern.c beabi.c beabi.h beabi_t.h \ - benodesets.c benodesets.h bemachnode.c bemachnode.h beinsn.c + benodesets.c benodesets.h bemachnode.c bemachnode.h beinsn.c \ + bestat.h bestat.c include $(topdir)/MakeRules diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c index 98e028c78..22ce8022e 100644 --- a/ir/be/belistsched.c +++ b/ir/be/belistsched.c @@ -33,6 +33,7 @@ #include "belive_t.h" #include "belistsched.h" #include "bearch.h" +#include "bestat.h" #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MIN(x,y) ((x) < (y) ? (x) : (y)) @@ -689,6 +690,9 @@ static void list_sched_block(ir_node *block, void *env_ptr) be.curr_time += phi_seen; while (nodeset_count(be.ready_set) > 0) { + /* collect statitics about amount of ready nodes */ + be_do_stat_sched_ready(block, be.ready_set); + /* select a node to be scheduled and check if it was ready */ irn = select_node(&be); diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 5c6ffe191..e94710e9d 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -316,7 +316,7 @@ static void be_main_loop(FILE *file_handle) * Note that this requires disabling the edges here. */ edges_deactivate(irg); - dead_node_elimination(irg); + //dead_node_elimination(irg); edges_activate(irg); /* Compute loop nesting information (for weighting copies) */ diff --git a/ir/be/bestat.c b/ir/be/bestat.c index 1a238f1de..030d8cf12 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -44,3 +44,10 @@ void be_do_stat_reg_pressure(be_irg_t *birg) { /* Collect register pressure information for each block */ irg_block_walk_graph(birg->irg, stat_reg_pressure_block, NULL, birg); } + +/** + * Notify statistic module about amount of ready nodes. + */ +void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set) { + hook_be_block_sched_ready(block, get_irn_irg(block), nodeset_count(ready_set)); +} diff --git a/ir/be/bestat.h b/ir/be/bestat.h index cb01787dc..f6041f05d 100644 --- a/ir/be/bestat.h +++ b/ir/be/bestat.h @@ -2,6 +2,7 @@ #define _BESTAT_H_ #include "be_t.h" +#include "benodesets.h" /** * Collects statistics information about register pressure. @@ -9,4 +10,11 @@ */ void be_do_stat_reg_pressure(be_irg_t *birg); +/** + * Collect statistics about amount of redy nodes per block + * @param block The block + * @param ready_set A set of ready nodes + */ +void be_do_stat_sched_ready(ir_node *block, nodeset *ready_set); + #endif /* _BESTAT_H_ */ -- 2.20.1