On Fri, 2007-04-20 at 19:28 -0400, Robert Dewar wrote: > Steve Ellcey wrote: > > > This seems unfortunate. I was hoping I might be able to turn on loop > > unrolling for IA64 at -O2 to improve performance. I have only started > > looking into this idea but it seems to help performance quite a bit, > > though it is also increasing size quite a bit too so it may need some > > modification of the unrolling parameters to make it practical. > > To me it is obvious that optimizations are target dependent. For > instance loop unrolling is really a totally different optimization > on the ia64 as a result of the rotating registers.
My feeling is that it would be much more useful to have a more detailed documentation on optimization flags in the GCC manual that at least mention the type of source code and architectures where each optimization option is interesting rather than to mess with new flags or changing -On longstanding policies. Look from what we're starting: << @item -funroll-loops @opindex funroll-loops Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop. @option{-funroll-loops} implies @option{-frerun-cse-after-loop}. This option makes code larger, and may or may not make it run faster. @item -funroll-all-loops @opindex funroll-all-loops Unroll all loops, even if their number of iterations is uncertain when the loop is entered. This usually makes programs run more slowly. @option{-funroll-all-loops} implies the same options as @option{-funroll-loops}, >> It could gain a few more paragraphs written by knowledgeable people. And expanding documentation doesn't introduce regressions :). Laurent