summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorElias Aebi <elias.aebi@student.kit.edu>2018-05-23 15:31:11 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-01-24 17:42:00 +0100
commite4f43dffd46f09998250beb2a1d6a798f3cfd3fa (patch)
tree6e642517c897e1fd3f27ce782058f2c9cc76829b
parent208b4a611a5a733b7ffc28e7296b4a362b82c854 (diff)
debug print the number of loops unrolled
-rw-r--r--ir/opt/loop2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ir/opt/loop2.c b/ir/opt/loop2.c
index ee48197..0e0ac82 100644
--- a/ir/opt/loop2.c
+++ b/ir/opt/loop2.c
@@ -273,9 +273,11 @@ static size_t count_nodes(ir_loop *const loop)
static unsigned determine_unroll_factor(ir_loop *const loop)
{
- return count_nodes(loop) < 32 ? 1 : 0;
+ return count_nodes(loop) < 32 ? 3 : 0;
}
+static unsigned n_loops_unrolled = 0;
+
static void duplicate_innermost_loops(ir_loop *const loop, bool const outermost)
{
bool innermost = true;
@@ -289,8 +291,10 @@ static void duplicate_innermost_loops(ir_loop *const loop, bool const outermost)
}
if (innermost && !outermost) {
unsigned const factor = determine_unroll_factor(loop);
- if (factor)
+ if (factor) {
unroll_loop(loop, factor);
+ ++n_loops_unrolled;
+ }
}
}
@@ -302,4 +306,5 @@ void do_loop_unrolling2(ir_graph *const irg)
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
duplicate_innermost_loops(get_irg_loop(irg), true);
ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
+ DB((dbg, LEVEL_2, "%d loops unrolled\n", n_loops_unrolled));
}