toplev.c (flag_rerun_loop_opt): New variable.

* toplev.c (flag_rerun_loop_opt): New variable.
        (f_options): Handle -frerun-loop-opt.
        (rest_of_compilation): If -frerun-loop-opt, then run the loop
        optimizer twice.
        (main): Enable -frerun-loop-opt by default for -O2 or greater.

From-SVN: r16180
This commit is contained in:
Jeffrey A Law 1997-10-26 16:56:15 +00:00 committed by Jeff Law
parent da0af5a56f
commit 6d6d0fa07e
3 changed files with 57 additions and 1 deletions

View file

@ -1,5 +1,11 @@
Sun Oct 26 09:21:40 1997 Jeffrey A Law (law@cygnus.com)
* toplev.c (flag_rerun_loop_opt): New variable.
(f_options): Handle -frerun-loop-opt.
(rest_of_compilation): If -frerun-loop-opt, then run the loop
optimizer twice.
(main): Enable -frerun-loop-opt by default for -O2 or greater.
* loop.c (simplify_giv_expr): Adding two invariants results
in an invariant.

View file

@ -149,7 +149,7 @@ in the following sections.
-fkeep-inline-functions -fno-default-inline
-fno-defer-pop -fno-function-cse
-fno-inline -fno-peephole -fomit-frame-pointer -fregmove
-frerun-cse-after-loop -fschedule-insns
-frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
-fschedule-insns2 -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
-fmove-all-movables -freduce-all-givs
@ -245,6 +245,10 @@ in the following sections.
-msoft-float -mhard-float
-mbsd -mxopen -mno-symrename
@emph{MN10300 Options}
-mmult-bug
-mno-mult-bug
@emph{M32R/D Options}
-mcode-model=@var{model type} -msdata=@var{sdata type}
-G @var{num}
@ -2165,6 +2169,9 @@ body of the @code{if}.
Re-run common subexpression elimination after loop optimizations has been
performed.
@item -frerun-loop-opt
Run the loop optimizer twice.
@item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
@ -2798,6 +2805,7 @@ that macro, which enables you to change the defaults.
* Convex Options::
* AMD29K Options::
* ARM Options::
* MN10300 Options::
* M32R/D Options::
* M88K Options::
* RS/6000 and PowerPC Options::
@ -3437,6 +3445,21 @@ suppresses this pass. The post-processor is never run when the
compiler is built for cross-compilation.
@end table
@node MN10300 Options
@subsection MN10300 Options
@cindex MN10300 options
These @samp{-m} options are defined for Matsushita MN10300 architectures:
@table @code
@item -mmult-bug
Generate code to avoid bugs in the multiply instructions for the MN10300
processors. This is the default.
@item -mno-mult-bug
Do not generate code to avoid bugs in the multiply instructions for the
MN10300 processors.
@end table
@node M32R/D Options
@subsection M32R/D Options
@cindex M32R/D options

View file

@ -505,6 +505,10 @@ int flag_syntax_only = 0;
static int flag_rerun_cse_after_loop;
/* Nonzero means to run loop optimizations twice. */
static int flag_rerun_loop_opt;
/* Nonzero for -finline-functions: ok to inline functions that look like
good inline candidates. */
@ -707,6 +711,7 @@ struct { char *string; int *variable; int on_value;} f_options[] =
{"reg-struct-return", &flag_pcc_struct_return, 0},
{"delayed-branch", &flag_delayed_branch, 1},
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
{"rerun-loop-opt", &flag_rerun_loop_opt, 1},
{"pretend-float", &flag_pretend_float, 1},
{"schedule-insns", &flag_schedule_insns, 1},
{"schedule-insns2", &flag_schedule_insns_after_reload, 1},
@ -3262,6 +3267,27 @@ rest_of_compilation (decl)
{
TIMEVAR (loop_time,
{
int save_flag_unroll_loops;
int save_flag_unroll_all_loops;
if (flag_rerun_loop_opt)
{
/* We only want to perform unrolling once. */
save_flag_unroll_loops = flag_unroll_loops;
save_flag_unroll_all_loops = flag_unroll_all_loops;
flag_unroll_loops = 0;
flag_unroll_all_loops = 0;
loop_optimize (insns, loop_dump_file);
/* The regscan pass may not be necessary, but let's
be safe until we can prove otherwise. */
reg_scan (insns, max_reg_num (), 1);
/* Restore loop unrolling flags. */
flag_unroll_loops = save_flag_unroll_loops;
flag_unroll_all_loops = save_flag_unroll_all_loops;
}
loop_optimize (insns, loop_dump_file);
});
}
@ -3819,6 +3845,7 @@ main (argc, argv, envp)
flag_expensive_optimizations = 1;
flag_strength_reduce = 1;
flag_rerun_cse_after_loop = 1;
flag_rerun_loop_opt = 1;
flag_caller_saves = 1;
flag_force_mem = 1;
#ifdef INSN_SCHEDULING