Commit 7869fe47 by Zdenek Dvorak Committed by Zdenek Dvorak

re PR rtl-optimization/20376 (The missed-optimization of general induction…

re PR rtl-optimization/20376 (The missed-optimization of general induction variables in the new rtl-level loop optimizer cause performance degradation.)

	PR rtl-optimization/20376
	* toplev.c (process_options): Enable -fweb and -frename-registers when
	unrolling.
	* doc/invoke.texi: Update the information about when -fweb and
	-frename-registers are enabled.

From-SVN: r101961
parent fe83f543
2005-07-12 Zdenek Dvorak <dvorakz@suse.cz>
PR rtl-optimization/20376
* toplev.c (process_options): Enable -fweb and -frename-registers when
unrolling.
* doc/invoke.texi: Update the information about when -fweb and
-frename-registers are enabled.
2005-07-12 Andrew Pinski <pinskia@physics.uc.edu> 2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
PR tree-opt/21840 PR tree-opt/21840
......
...@@ -5017,8 +5017,7 @@ the loop is entered. This usually makes programs run more slowly. ...@@ -5017,8 +5017,7 @@ the loop is entered. This usually makes programs run more slowly.
@opindex -fsplit-ivs-in-unroller @opindex -fsplit-ivs-in-unroller
Enables expressing of values of induction variables in later iterations Enables expressing of values of induction variables in later iterations
of the unrolled loop using the value in the first iteration. This breaks of the unrolled loop using the value in the first iteration. This breaks
long dependency chains, thus improving efficiency of the scheduling passes long dependency chains, thus improving efficiency of the scheduling passes.
(for best results, @option{-fweb} should be used as well).
Combination of @option{-fweb} and CSE is often sufficient to obtain the Combination of @option{-fweb} and CSE is often sufficient to obtain the
same effect. However in cases the loop body is more complicated than same effect. However in cases the loop body is more complicated than
...@@ -5260,9 +5259,7 @@ passes, such as CSE, loop optimizer and trivial dead code remover. It can, ...@@ -5260,9 +5259,7 @@ passes, such as CSE, loop optimizer and trivial dead code remover. It can,
however, make debugging impossible, since variables will no longer stay in a however, make debugging impossible, since variables will no longer stay in a
``home register''. ``home register''.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, Enabled by default with @option{-funroll-loops}.
on targets where the default format for debugging information supports
variable tracking.
@item -fwhole-program @item -fwhole-program
@opindex fwhole-program @opindex fwhole-program
...@@ -5524,7 +5521,7 @@ debug information format adopted by the target, however, it can ...@@ -5524,7 +5521,7 @@ debug information format adopted by the target, however, it can
make debugging impossible, since variables will no longer stay in make debugging impossible, since variables will no longer stay in
a ``home register''. a ``home register''.
Not enabled by default at any level because it has known bugs. Enabled by default with @option{-funroll-loops}.
@item -ftracer @item -ftracer
@opindex ftracer @opindex ftracer
...@@ -5538,9 +5535,10 @@ Enabled with @option{-fprofile-use}. ...@@ -5538,9 +5535,10 @@ Enabled with @option{-fprofile-use}.
@opindex funroll-loops @opindex funroll-loops
Unroll loops whose number of iterations can be determined at compile time or Unroll loops whose number of iterations can be determined at compile time or
upon entry to the loop. @option{-funroll-loops} implies upon entry to the loop. @option{-funroll-loops} implies
@option{-frerun-cse-after-loop}. It also turns on complete loop peeling @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
(i.e.@: complete removal of loops with small constant number of iterations). It also turns on complete loop peeling (i.e.@: complete removal of loops with
This option makes code larger, and may or may not make it run faster. small constant number of iterations). This option makes code larger, and may
or may not make it run faster.
Enabled with @option{-fprofile-use}. Enabled with @option{-fprofile-use}.
......
...@@ -1530,9 +1530,15 @@ process_options (void) ...@@ -1530,9 +1530,15 @@ process_options (void)
if (flag_unroll_all_loops) if (flag_unroll_all_loops)
flag_unroll_loops = 1; flag_unroll_loops = 1;
/* The loop unrolling code assumes that cse will be run after loop. */ /* The loop unrolling code assumes that cse will be run after loop.
Also enable -fweb and -frename-registers that help scheduling
the unrolled loop. */
if (flag_unroll_loops || flag_peel_loops) if (flag_unroll_loops || flag_peel_loops)
flag_rerun_cse_after_loop = 1; {
flag_rerun_cse_after_loop = 1;
flag_web = 1;
flag_rename_registers = 1;
}
/* If explicitly asked to run new loop optimizer, switch off the old /* If explicitly asked to run new loop optimizer, switch off the old
one. */ one. */
......
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