diff mbox series

[PATCH/doc] - mention all optimization options that enable inlining options

Message ID 6f87f645-1d42-e8ff-3533-d789a7ab512d@gmail.com
State New
Headers show
Series [PATCH/doc] - mention all optimization options that enable inlining options | expand

Commit Message

Martin Sebor April 8, 2018, 4:34 p.m. UTC
While updating the -Wrestrict option to mention that it works
best not just with -O2 but also at higher optimization levels
I looked around for other options that might benefit from
a similar clarification.  I found a few inlining options that
only mention -O2 but that (according to -Q --help=optimizers)
are enabled at other levels as well.  The attached patch
changes the manual to reflect that.

Given the large number of options I didn't take the time to
check all optimization options so there could others that could
stand to be similarly improved if we want to be 100% accurate.
If that is, in fact, what we want then we might want to script
this.

Martin

Comments

Richard Biener April 9, 2018, 7:36 a.m. UTC | #1
On Sun, 8 Apr 2018, Martin Sebor wrote:

> While updating the -Wrestrict option to mention that it works
> best not just with -O2 but also at higher optimization levels
> I looked around for other options that might benefit from
> a similar clarification.  I found a few inlining options that
> only mention -O2 but that (according to -Q --help=optimizers)
> are enabled at other levels as well.  The attached patch
> changes the manual to reflect that.

OK.

> Given the large number of options I didn't take the time to
> check all optimization options so there could others that could
> stand to be similarly improved if we want to be 100% accurate.
> If that is, in fact, what we want then we might want to script
> this.

Yeah, note we now have -Og and -Ofast as well...

Richard.
Martin Sebor April 10, 2018, 2:36 a.m. UTC | #2
On 04/09/2018 01:36 AM, Richard Biener wrote:
> On Sun, 8 Apr 2018, Martin Sebor wrote:
>
>> While updating the -Wrestrict option to mention that it works
>> best not just with -O2 but also at higher optimization levels
>> I looked around for other options that might benefit from
>> a similar clarification.  I found a few inlining options that
>> only mention -O2 but that (according to -Q --help=optimizers)
>> are enabled at other levels as well.  The attached patch
>> changes the manual to reflect that.
>
> OK.

I committed it earlier today in r259250.

>
>> Given the large number of options I didn't take the time to
>> check all optimization options so there could others that could
>> stand to be similarly improved if we want to be 100% accurate.
>> If that is, in fact, what we want then we might want to script
>> this.
>
> Yeah, note we now have -Og and -Ofast as well...

Right, those aren't mentioned.  With so many flavors of -O does
enumerating them all for each optimization option still make
sense?  I wonder if this could this be generated by some script
instead (it would probably have to be presented in the form of
a table but that might actually make things easier to find).

Martin
Richard Biener April 10, 2018, 6:37 a.m. UTC | #3
On Mon, 9 Apr 2018, Martin Sebor wrote:

> On 04/09/2018 01:36 AM, Richard Biener wrote:
> > On Sun, 8 Apr 2018, Martin Sebor wrote:
> > 
> > > While updating the -Wrestrict option to mention that it works
> > > best not just with -O2 but also at higher optimization levels
> > > I looked around for other options that might benefit from
> > > a similar clarification.  I found a few inlining options that
> > > only mention -O2 but that (according to -Q --help=optimizers)
> > > are enabled at other levels as well.  The attached patch
> > > changes the manual to reflect that.
> > 
> > OK.
> 
> I committed it earlier today in r259250.
> 
> > 
> > > Given the large number of options I didn't take the time to
> > > check all optimization options so there could others that could
> > > stand to be similarly improved if we want to be 100% accurate.
> > > If that is, in fact, what we want then we might want to script
> > > this.
> > 
> > Yeah, note we now have -Og and -Ofast as well...
> 
> Right, those aren't mentioned.  With so many flavors of -O does
> enumerating them all for each optimization option still make
> sense?  I wonder if this could this be generated by some script
> instead (it would probably have to be presented in the form of
> a table but that might actually make things easier to find).

I think it would be reasonable to say "level two or higher" and
in the -On docs specify what "level" means (two is -O2 or -Os).
Then say "lever two or higher but not for -Os", thus enumerate
exceptions instead.

Another phrase would be "enabled by default if optimizing" for
all the passes we enable at all -On but -O0.

Richard.
diff mbox series

Patch

2018-04-08  Martin Sebor  <msebor@redhat.com>

	* invoke.texi (-finline-small-functions): Mention other optimization
	options.
	(-findirect-inlining, -fpartial-inlining): Same.
	(-finline-functions-called-once): Same.
	(-freorder-blocks-and-partition): Same.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 259224)
+++ gcc/doc/invoke.texi	(working copy)
@@ -7780,7 +7780,7 @@  heuristically decides which functions are simple e
 in this way.  This inlining applies to all functions, even those not declared
 inline.
 
-Enabled at level @option{-O2}.
+Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -findirect-inlining
 @opindex findirect-inlining
@@ -7789,7 +7789,7 @@  time thanks to previous inlining.  This option has
 when inlining itself is turned on by the @option{-finline-functions}
 or @option{-finline-small-functions} options.
 
-Enabled at level @option{-O2}.
+Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -finline-functions
 @opindex finline-functions
@@ -7801,7 +7801,7 @@  If all calls to a given function are integrated, a
 declared @code{static}, then the function is normally not output as
 assembler code in its own right.
 
-Enabled at level @option{-O3}.
+Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -finline-functions-called-once
 @opindex finline-functions-called-once
@@ -9002,7 +9002,7 @@  Inline parts of functions.  This option has any ef
 when inlining itself is turned on by the @option{-finline-functions}
 or @option{-finline-small-functions} options.
 
-Enabled at level @option{-O2}.
+Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -fpredictive-commoning
 @opindex fpredictive-commoning
@@ -9109,7 +9109,7 @@  sections.  When @option{-fsplit-stack} is used thi
 enabled by default (to avoid linker errors), but may be enabled
 explicitly (if using a working linker).
 
-Enabled for x86 at levels @option{-O2}, @option{-O3}.
+Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -freorder-functions
 @opindex freorder-functions