[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] Optimization flags?
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Mon, 25 Oct 2004 06:19:19 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=p98CwyfCCzzbEQDEntZHwrFtVLuGzsaLGJJqolyFepB3s0HMnikmNX6lUJWvxqAr7Y0Q7inGOP5cbeFBIbKYCE/FzW1Ngsf8fPnOkDch+24vaUnDvPdQ7JQNUsx2cdPo8OmCTZVnuOsajFwfFcoEf1ejCMFHX6wAxmhdEt5EtbA=
I was browsing around the GCC manual's page with optimization flags,
and I stumbled across a couple that seem useful although they're not
turned on with the default optimizations:
-frename-registers
Attempt to avoid false dependencies in scheduled code by making
use of registers left over after register allocation. This
optimization will most benefit processors with lots of registers. It
can, however, make debugging impossible, since variables will no
longer stay in a "home register".
-finline-functions
Integrate all simple functions into their callers. The compiler
heuristically decides which functions are simple enough to be worth
integrating in this way.
These two seem to be turned on with -O3, but IIRC, Allegro only uses
-O2. Is there any reason Allegor shouldn't use -O3 nowadays? AFAIK,
it's much more stable than when the optimization flags were originally
chosen.
Also, GCC 3.4 (which we could detect with a configure check?) has these options:
-funswitch-loops
Move branches with loop invariant conditions out of the loop, with
duplicates of the loop on both branches (modified according to result
of the condition).
[Useful if you have a loop with a check that makes only a small change.]
-fbranch-target-load-optimize
Perform branch target register load optimization before prologue /
epilogue threading. The use of target registers can typically be
exposed only during reload, thus hoisting loads out of loops and doing
inter-block scheduling needs a separate optimization pass.
-fbranch-target-load-optimize2
Perform branch target register load optimization after prologue /
epilogue threading.
I'm not sure what the second one is good for exactly, but the first
looks intriguing. -O3 also turns on this for GCC 3.4:
-fweb
Constructs webs as commonly used for register allocation purposes
and assign each web individual pseudo register. This allows the
register allocation pass to operate on pseudos directly, but also
strengthens several other optimization passes, such as CSE, loop
optimizer and trivial dead code remover. It can, however, make
debugging impossible, since variables will no longer stay in a "home
register".
Thoughts? Comments?
- Kitty Cat