summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bera.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-07-08 16:54:20 +0200
committerMatthias Braun <matze@braunis.de>2014-07-08 17:00:17 +0200
commit380a905992bfcdf617c1c63a576ead89436161e1 (patch)
tree1b606d4b482a3e7bbc108705c6e2b8f66861a398 /ir/be/bera.c
parent584e61eef1ee53e1ef081df3b8b8b89de1b52da6 (diff)
bera: improve statistics for add_missing_copies()
Diffstat (limited to 'ir/be/bera.c')
-rw-r--r--ir/be/bera.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/ir/be/bera.c b/ir/be/bera.c
index 2712bfc..1425c5b 100644
--- a/ir/be/bera.c
+++ b/ir/be/bera.c
@@ -30,8 +30,11 @@
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
-static be_irg_t *birg;
-static be_lv_t *lv;
+static be_irg_t *birg;
+static be_lv_t *lv;
+static unsigned long precol_copies;
+static unsigned long multi_precol_copies;
+static unsigned long constrained_livethrough_copies;
static void prepare_constr_insn(ir_node *const node)
{
@@ -64,7 +67,7 @@ static void prepare_constr_insn(ir_node *const node)
ir_node *copy = be_new_Copy(block, op);
sched_add_before(node, copy);
set_irn_n(node, i, copy);
- stat_ev_int("constr_copy", 1);
+ ++precol_copies;
DBG((dbg, LEVEL_3, "inserting ignore arg copy %+F for %+F pos %d\n",
copy, node, i));
}
@@ -105,7 +108,7 @@ static void prepare_constr_insn(ir_node *const node)
ir_node *copy = be_new_Copy(block, in);
sched_add_before(node, copy);
set_irn_n(node, i2, copy);
- stat_ev_int("constr_copy", 1);
+ ++multi_precol_copies;
DBG((dbg, LEVEL_3,
"inserting multiple constr copy %+F for %+F pos %d\n",
copy, node, i2));
@@ -177,6 +180,7 @@ static void prepare_constr_insn(ir_node *const node)
ir_node *copy = be_new_Copy(block, in);
sched_add_before(node, copy);
set_irn_n(node, i, copy);
+ ++constrained_livethrough_copies;
DBG((dbg, LEVEL_3, "inserting constr copy %+F for %+F pos %d\n",
copy, node, i));
be_liveness_update(lv, in);
@@ -195,9 +199,18 @@ void be_add_missing_copies(ir_graph *irg)
{
be_assure_live_sets(irg);
+ precol_copies = 0;
+ multi_precol_copies = 0;
+ constrained_livethrough_copies = 0;
+
birg = be_birg_from_irg(irg);
lv = be_get_irg_liveness(irg);
irg_block_walk_graph(irg, add_missing_copies_in_block, NULL, NULL);
+
+ stat_ev_ull("ra_precol_copies", precol_copies);
+ stat_ev_ull("ra_multi_precol_copies", multi_precol_copies);
+ stat_ev_ull("ra_constrained_livethrough_copies",
+ constrained_livethrough_copies);
}
/** The list of register allocators */