re PR rtl-optimization/4311 (unrolling loops creates non-ending loop)

PR opt/4311
        * loop.h (LOOP_FIRST_PASS): New.
        * loop.c (strength_reduce): Mind it when deciding to unroll.
        * toplev.c (rest_of_compilation): Set it.

From-SVN: r51797
This commit is contained in:
Richard Henderson 2002-04-02 23:53:52 -08:00 committed by Richard Henderson
parent 427f38e312
commit 2f90c3f7e3
4 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2002-04-02 Richard Henderson <rth@redhat.com>
PR opt/4311
* loop.h (LOOP_FIRST_PASS): New.
* loop.c (strength_reduce): Mind it when deciding to unroll.
* toplev.c (rest_of_compilation): Set it.
2002-04-02 David S. Miller <davem@redhat.com>
* config/sparc/sparc.md (ldd peephole2s): Fix final arg to

View File

@ -5213,7 +5213,8 @@ strength_reduce (loop, flags)
collected. Always unroll loops that would be as small or smaller
unrolled than when rolled. */
if ((flags & LOOP_UNROLL)
|| (loop_info->n_iterations > 0
|| (!(flags & LOOP_FIRST_PASS)
&& loop_info->n_iterations > 0
&& unrolled_insn_copies <= insn_count))
unroll_loop (loop, insn_count, 1);

View File

@ -28,6 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define LOOP_UNROLL 1
#define LOOP_BCT 2
#define LOOP_PREFETCH 4
#define LOOP_FIRST_PASS 8
/* Get the loop info pointer of a loop. */
#define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux)

View File

@ -2877,8 +2877,7 @@ rest_of_compilation (decl)
cleanup_barriers ();
/* We only want to perform unrolling once. */
loop_optimize (insns, rtl_dump_file, 0);
loop_optimize (insns, rtl_dump_file, LOOP_FIRST_PASS);
/* The first call to loop_optimize makes some instructions
trivially dead. We delete those instructions now in the