New size optimization
Jeffrey A Law
law@cygnus.com
Sun Apr 12 20:43:00 GMT 1998
In message < 199803302250.XAA27657@phal.cygnus.co.uk >you write:
> Invariant code motion in general adds extra moves and register pressure.
> AFAIK there are no common scenarios where it can be a precursor for
> another optimization that leads to a code size saving. Thus, I think it
> should be turned off when optimizing for space.
Sure it can -- moving an invariant out of a loop may expose it to
local optimizations in the block before the loop (cse, combine, etc).
I'm not saying disabling loop invariant code motion is the wrong
thing to do when optimizing for size -- it's just not as cut and
dried as you made it seem to be.
jeff
More information about the Gcc
mailing list