summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorElias Aebi <elias.aebi@student.kit.edu>2018-05-01 14:50:20 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-01-24 17:42:00 +0100
commit6a552d5df5a103b46b27113af1bb7863b311837f (patch)
treed380aa671ce9c8848495be440733120aca532cba
parent9d47a8a8c6d7c2176836f8fe5b88f09d8b17b812 (diff)
use unsigned integers for the unroll factor
-rw-r--r--ir/opt/loop2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ir/opt/loop2.c b/ir/opt/loop2.c
index d674488..b3fad94 100644
--- a/ir/opt/loop2.c
+++ b/ir/opt/loop2.c
@@ -223,7 +223,7 @@ static void rewire_block(ir_node *const block, ir_node *const header)
}
}
-static void unroll_loop(ir_loop *const loop, int factor)
+static void unroll_loop(ir_loop *const loop, unsigned factor)
{
ir_node *const header = get_loop_header(loop);
if (header == NULL)
@@ -233,7 +233,7 @@ static void unroll_loop(ir_loop *const loop, int factor)
irg_walk_graph(get_irn_irg(header), firm_clear_link, NULL, NULL);
size_t const n_elements = get_loop_n_elements(loop);
- for (int j = 0; j < factor; ++j) {
+ for (unsigned j = 0; j < factor; ++j) {
// step 1: duplicate blocks
for (size_t i = 0; i < n_elements; ++i) {
@@ -256,7 +256,7 @@ static void unroll_loop(ir_loop *const loop, int factor)
}
}
-static int determine_unroll_factor(ir_loop *const loop)
+static unsigned determine_unroll_factor(ir_loop *const loop)
{
(void)loop;
return 2;
@@ -274,7 +274,7 @@ static void duplicate_innermost_loops(ir_loop *const loop, bool const outermost)
}
}
if (innermost && !outermost) {
- int factor = determine_unroll_factor(loop);
+ unsigned const factor = determine_unroll_factor(loop);
if (factor)
unroll_loop(loop, factor);
}