This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimal Optimizations: A Very Preliminary Report


Scott Robert Ladd <coyote@coyotegulch.com> writes:

> After testing 10,000 possibilities (selected by breeding 100
> possibilities for 100 generations), gccga identified the following
> command line as the "best":
> 
>      -O1 -fstrength-reduce -fprefetch-loop-arrays \
>          -finline-functions -fgcse -freduce-all-givs

Considering the 18% improvement over -O3, this clearly suggests that
at -O42 gcc should automatically compile code with several different
options and compare the results by running them through a CPU pipeline
simulator.  At even higher optimization levels, gcc should actually
run and time the resulting code directly, downloading to a target
board if necessary.  And of course at -O1729, gcc should automatically
outsource the RTL code to a human assembly language programmer to get
another sample comparison.

Slightly more seriously, this makes it appear that gcc tends to commit
too soon to a particular approach.  At painfully high optimization
levels it would be interesting to maintain a collection of possible
compilations of a piece of code, and only pick one after the final
scheduling pass.

Perhaps compilation is not the data analysis problem I always thought
it was, but is rather more of a directed search problem.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]