Commit 5e1afb11 by Richard Henderson Committed by Richard Henderson

loop.h (LOOP_AUTO_UNROLL): Rename from LOOP_FIRST_PASS.

        * loop.h (LOOP_AUTO_UNROLL): Rename from LOOP_FIRST_PASS.
        * loop.c (strength_reduce): Update.
        * toplev.c (rest_of_compilation): Do unrolling in the first
        loop pass, not the second.

From-SVN: r55634
parent c67a1cf6
2002-07-21 Richard Henderson <rth@redhat.com> 2002-07-21 Richard Henderson <rth@redhat.com>
* loop.h (LOOP_AUTO_UNROLL): Rename from LOOP_FIRST_PASS.
* loop.c (strength_reduce): Update.
* toplev.c (rest_of_compilation): Do unrolling in the first
loop pass, not the second.
2002-07-21 Richard Henderson <rth@redhat.com>
* emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL * emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL
when flag_argument_noalias == 2. when flag_argument_noalias == 2.
* alias.c (nonoverlapping_memrefs_p): Handle that. * alias.c (nonoverlapping_memrefs_p): Handle that.
......
...@@ -5320,7 +5320,7 @@ strength_reduce (loop, flags) ...@@ -5320,7 +5320,7 @@ strength_reduce (loop, flags)
collected. Always unroll loops that would be as small or smaller collected. Always unroll loops that would be as small or smaller
unrolled than when rolled. */ unrolled than when rolled. */
if ((flags & LOOP_UNROLL) if ((flags & LOOP_UNROLL)
|| (!(flags & LOOP_FIRST_PASS) || ((flags & LOOP_AUTO_UNROLL)
&& loop_info->n_iterations > 0 && loop_info->n_iterations > 0
&& unrolled_insn_copies <= insn_count)) && unrolled_insn_copies <= insn_count))
unroll_loop (loop, insn_count, 1); unroll_loop (loop, insn_count, 1);
......
...@@ -28,7 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -28,7 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define LOOP_UNROLL 1 #define LOOP_UNROLL 1
#define LOOP_BCT 2 #define LOOP_BCT 2
#define LOOP_PREFETCH 4 #define LOOP_PREFETCH 4
#define LOOP_FIRST_PASS 8 #define LOOP_AUTO_UNROLL 8
/* Get the loop info pointer of a loop. */ /* Get the loop info pointer of a loop. */
#define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux) #define LOOP_INFO(LOOP) ((struct loop_info *) (LOOP)->aux)
......
/* Top level of GNU C compiler /* Top level of GNU C compiler
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002 Free Software Foundation, Inc. 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
...@@ -2878,6 +2877,8 @@ rest_of_compilation (decl) ...@@ -2878,6 +2877,8 @@ rest_of_compilation (decl)
if (optimize > 0 && flag_loop_optimize) if (optimize > 0 && flag_loop_optimize)
{ {
int do_unroll, do_prefetch;
timevar_push (TV_LOOP); timevar_push (TV_LOOP);
delete_dead_jumptables (); delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP); cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
...@@ -2885,12 +2886,15 @@ rest_of_compilation (decl) ...@@ -2885,12 +2886,15 @@ rest_of_compilation (decl)
/* CFG is no longer maintained up-to-date. */ /* CFG is no longer maintained up-to-date. */
free_bb_for_insn (); free_bb_for_insn ();
do_unroll = flag_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
if (flag_rerun_loop_opt) if (flag_rerun_loop_opt)
{ {
cleanup_barriers (); cleanup_barriers ();
/* We only want to perform unrolling once. */ /* We only want to perform unrolling once. */
loop_optimize (insns, rtl_dump_file, LOOP_FIRST_PASS); loop_optimize (insns, rtl_dump_file, do_unroll);
do_unroll = 0;
/* The first call to loop_optimize makes some instructions /* The first call to loop_optimize makes some instructions
trivially dead. We delete those instructions now in the trivially dead. We delete those instructions now in the
...@@ -2903,9 +2907,7 @@ rest_of_compilation (decl) ...@@ -2903,9 +2907,7 @@ rest_of_compilation (decl)
reg_scan (insns, max_reg_num (), 1); reg_scan (insns, max_reg_num (), 1);
} }
cleanup_barriers (); cleanup_barriers ();
loop_optimize (insns, rtl_dump_file, loop_optimize (insns, rtl_dump_file, do_unroll | LOOP_BCT | do_prefetch);
(flag_unroll_loops ? LOOP_UNROLL : 0) | LOOP_BCT
| (flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0));
/* Loop can create trivially dead instructions. */ /* Loop can create trivially dead instructions. */
delete_trivially_dead_insns (insns, max_reg_num ()); delete_trivially_dead_insns (insns, max_reg_num ());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment