This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] doc: document -ftree-scev-cprop
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Aug 2018 17:22:07 +0300 (MSK)
- Subject: [PATCH] doc: document -ftree-scev-cprop
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.
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