From 237a9795cb8eee2296d0e777bc2dffa4cdafefa6 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sun, 21 Sep 1997 19:49:19 -0600 Subject: loop.c (loop_unroll_factor): Move outside #ifdef HAIFA conditional. * loop.c (loop_unroll_factor): Move outside #ifdef HAIFA conditional. (loop_unroll_iter): Remove unused variable and all references. (loop_optimize): Always allocate and clear space for loop_unroll_factor. (insert_bct): Fix minor formatting problems. * loop.h (loop_unroll_factor): Move decl outside #ifdef HAIFA. (loop_unroll_iter): Removed unused decl. * unroll.c (unroll_loop): Remove code to set loop_unroll_iter. Always record the unrolling factor. More haifa cleanup From-SVN: r15621 --- gcc/unroll.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'gcc/unroll.c') diff --git a/gcc/unroll.c b/gcc/unroll.c index ce6623c..b9cbcfe 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -1094,16 +1094,13 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, /* Set unroll type to MODULO now. */ unroll_type = UNROLL_MODULO; loop_preconditioned = 1; + #ifdef HAIFA - if (loop_n_iterations > 0) - loop_unroll_iter[ loop_number(loop_start, loop_end) ] - = (loop_n_iterations - - loop_n_iterations % (abs_inc * unroll_number)); - else - /* inform loop.c about the new initial value */ - loop_start_value[loop_number(loop_start, loop_end)] = initial_value; + /* Fix the initial value for the loop as needed. */ + if (loop_n_iterations <= 0) + loop_start_value [loop_number (loop_start, loop_end)] + = initial_value; #endif - } } @@ -1118,13 +1115,11 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, /* At this point, we are guaranteed to unroll the loop. */ -#ifdef HAIFA - /* inform loop.c about the factor of unrolling */ + /* Keep track of the unroll factor for each loop. */ if (unroll_type == UNROLL_COMPLETELY) - loop_unroll_factor[ loop_number(loop_start, loop_end) ] = -1; + loop_unroll_factor [loop_number (loop_start, loop_end)] = -1; else - loop_unroll_factor[ loop_number(loop_start, loop_end) ] = unroll_number; -#endif /* HAIFA */ + loop_unroll_factor [loop_number (loop_start, loop_end)] = unroll_number; /* For each biv and giv, determine whether it can be safely split into -- cgit v1.1