[AD] Optimization flags?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


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




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/