This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New size optimization
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: New size optimization
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 12 Apr 1998 21:40:29 -0600
- cc: wilson at cygnus dot com, egcs at cygnus dot com
- Reply-To: law at cygnus dot com
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