On 05/27/2016 07:19 AM, Jan Hubicka wrote:
[snip] Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 236815) +++ doc/invoke.texi (working copy) @@ -8661,10 +8661,17 @@ the loop is entered. This usually makes @item -fpeel-loops @opindex fpeel-loops Peels loops for which there is enough information that they do not -roll much (from profile feedback). It also turns on complete loop peeling -(i.e.@: complete removal of loops with small constant number of iterations). +roll much (from profile feedback or static analysis). It also turns on +complete loop peeling (i.e.@: complete removal of loops with small constant +number of iterations). -Enabled with @option{-fprofile-use}. +Enabled with @option{-O3} and @option{-fprofile-use}.
Do you really mean "or" instead of "and" here? It looks to me like the code part of your patch enables -fpeel-loops unconditionally at -O3 and does not check if -fprofile-use is also set.
+ +@item -fpeel-all-loops +@opindex fpeel-all-loops +Peel all loops, even if their number of iterations is uncertain when +the loop is entered. For loops with large number of iterations this leads +to wasted code size. @item -fmove-loop-invariants @opindex fmove-loop-invariants
I think you also need to add the new option -fpeel-all-loops to the "Option Summary" section, and -fpeel-loops to the documentation of -O3.
-Sandra