doc: document -ftree-scev-cprop

Message ID alpine.LNX.2.20.13.1808281712180.10521@monopod.intra.ispras.ru
State New
Headers show
Series
  • doc: document -ftree-scev-cprop
Related show

Commit Message

Alexander Monakov Aug. 28, 2018, 2:22 p.m.
Hi,

PR 86726 is pointing out that -ftree-scev-cprop is not documented.

Here's documentation for the final-value-replacement aspect of the
option. It technically can also replace in-loop references by 
constants, but that doesn't seem very useful.

I'm not aware of any required order for option paragraphs; placing
new text between -floop-* and -fivopts.

	PR other/86726
	* invoke.texi (Optimization Options): List -ftree-scev-cprop.
	(-O): Ditto.
	(-ftree-scev-cprop): Document.

Comments

Richard Sandiford Aug. 28, 2018, 9:17 p.m. | #1
Alexander Monakov <amonakov@ispras.ru> writes:
> @@ -9120,6 +9121,15 @@ determining number of iterations requires complicated analysis.  Later

>  optimizations then may determine the number easily.  Useful especially

>  in connection with unrolling.

>  

> +@item -ftree-scev-cprop

> +@opindex ftree-scev-cprop

> +Perform final value replacement.  If a variable is modified in a loop

> +in a way that its value when exiting the loop can be determined using


"in such a way"

> +only its initial value and number of loop iterations, replace uses of


"and the number"

> +the final value by such computation, provided it is sufficiently cheap.


"by such a computation".

OK otherwise, thanks.

Richard

> +This reduces data dependencies and may allow further simplifications.

> +Enabled by default at @option{-O} and higher.
Richard Biener Aug. 29, 2018, 7:10 a.m. | #2
On Tue, Aug 28, 2018 at 4:22 PM Alexander Monakov <amonakov@ispras.ru> wrote:
>

> Hi,

>

> PR 86726 is pointing out that -ftree-scev-cprop is not documented.

>

> Here's documentation for the final-value-replacement aspect of the

> option. It technically can also replace in-loop references by

> constants, but that doesn't seem very useful.


Yeah, it's on my list of things to investigate whether we can remove
that...  (aka, look for testsuite fallout)

>

> I'm not aware of any required order for option paragraphs; placing

> new text between -floop-* and -fivopts.

>

>         PR other/86726

>         * invoke.texi (Optimization Options): List -ftree-scev-cprop.

>         (-O): Ditto.

>         (-ftree-scev-cprop): Document.

>

> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi

> index e37233d6ed4..de11ae27c95 100644

> --- a/gcc/doc/invoke.texi

> +++ b/gcc/doc/invoke.texi

> @@ -464,7 +464,7 @@ Objective-C and Objective-C++ Dialects}.

>  -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol

>  -ftree-loop-vectorize @gol

>  -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol

> --ftree-reassoc  -ftree-sink  -ftree-slsr  -ftree-sra @gol

> +-ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol

>  -ftree-switch-conversion  -ftree-tail-merge @gol

>  -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol

>  -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol

> @@ -7813,6 +7813,7 @@ compilation time.

>  -ftree-forwprop @gol

>  -ftree-fre @gol

>  -ftree-phiprop @gol

> +-ftree-scev-cprop @gol

>  -ftree-sink @gol

>  -ftree-slsr @gol

>  -ftree-sra @gol

> @@ -9120,6 +9121,15 @@ determining number of iterations requires complicated analysis.  Later

>  optimizations then may determine the number easily.  Useful especially

>  in connection with unrolling.

>

> +@item -ftree-scev-cprop

> +@opindex ftree-scev-cprop

> +Perform final value replacement.  If a variable is modified in a loop

> +in a way that its value when exiting the loop can be determined using

> +only its initial value and number of loop iterations, replace uses of

> +the final value by such computation, provided it is sufficiently cheap.

> +This reduces data dependencies and may allow further simplifications.

> +Enabled by default at @option{-O} and higher.

> +

>  @item -fivopts

>  @opindex fivopts

>  Perform induction variable optimizations (strength reduction, induction

Patch

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e37233d6ed4..de11ae27c95 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -464,7 +464,7 @@  Objective-C and Objective-C++ Dialects}.
 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
 -ftree-loop-vectorize @gol
 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
--ftree-reassoc  -ftree-sink  -ftree-slsr  -ftree-sra @gol
+-ftree-reassoc  -ftree-scev-cprop  -ftree-sink  -ftree-slsr  -ftree-sra @gol
 -ftree-switch-conversion  -ftree-tail-merge @gol
 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
@@ -7813,6 +7813,7 @@  compilation time.
 -ftree-forwprop @gol
 -ftree-fre @gol
 -ftree-phiprop @gol
+-ftree-scev-cprop @gol
 -ftree-sink @gol
 -ftree-slsr @gol
 -ftree-sra @gol
@@ -9120,6 +9121,15 @@  determining number of iterations requires complicated analysis.  Later
 optimizations then may determine the number easily.  Useful especially
 in connection with unrolling.
 
+@item -ftree-scev-cprop
+@opindex ftree-scev-cprop
+Perform final value replacement.  If a variable is modified in a loop
+in a way that its value when exiting the loop can be determined using
+only its initial value and number of loop iterations, replace uses of
+the final value by such computation, provided it is sufficiently cheap.
+This reduces data dependencies and may allow further simplifications.
+Enabled by default at @option{-O} and higher.
+
 @item -fivopts
 @opindex fivopts
 Perform induction variable optimizations (strength reduction, induction