Hello,
I'm planning to do some research on the optimization flags available
for GCC (currently, using 4.1.1). More in particular, we want to see
how we can come up with a set of combinations of flags which allow a
tradeoff between compilation time, execution time and code size (as
with -O1, -O2, -O3, -Os). Off course, we don't want to do an
exhaustive search of all possible combinations of flags, because that
would be totally unfeasible (using the 56 flags enabled in -O3 for
gcc 4.1.1 yields ~72*10^15 (= 2^56-1) possible candidates).
It seems there has already been some work done on this subject, or
atleast that's what richi on #gcc (OFTC) told me. He wasn't able to
refer me to work in that area though. I have found some references
myself (partially listed below), but I'm hoping people more familiar
with the GCC community can help expand this list.
[1] Almagor et al., Finding effective compilation sequences (LCES'04)
[2] Cooper et al., Optimizing for Reduced Code Space using Genetic
Algorithms (LCTES'99)
[3] Almagor et al., Compilation Order Matters: Exploring the
Structure of the Space of Compilation Sequences Using Randomized
Search Algorithms (Tech.Report)
[3] Acovea: Using Natural Selection to Investigate Software
Complexities (http://www.coyotegulch.com/products/acovea/)
Some other questions:
* I'm planning to do this work on an x86 platform (i.e. Pentium4),
but richi told me that's probably not a good idea, because of the low
number of registers available on x86. Comments?
* Since we have done quite some analysis on the SPEC2k benchmarks,
we'll also be using them for this work. Other suggestions are highly
appreciated.
* Since there has been some previous work on this, I wonder why none
of it has made it into GCC development. Were the methods proposed
unfeasible for some reason? What would be needed to make an approach
to automatically find suitable flags for -Ox interesting enough to
incorporate it into GCC? Any references to this previous work?
greetings,
Kenneth Hoste
Paris, ELIS, Ghent University (Belgium)
--
Statistics are like a bikini. What they reveal is suggestive, but
what they conceal is vital (Aaron Levenstein)
Kenneth Hoste
ELIS - Ghent University
[EMAIL PROTECTED]
http://www.elis.ugent.be/~kehoste