This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -funswitch-loops not effective?


On Tue, Jan 18, 2005 at 11:36:36PM +0100, Richard Guenther wrote:
> -- we may do better than RTX_UNCHANGING_P by tying the optimization
> to the frontend somehow, after all, it's all about language semantics.

No, it's not.  The front end has to be able to express this in the 
intermediate language.  If the front end does all the hoisting of
values itself, then what you'll wind up with is excessive register
pressure, and spilling these values to new stack slots.  A solution
that can easily be worse than the problem you were trying to solve.

> Also we have something like this already, otherwise optimizing a
> const global would not work.

False.  This case is fantastically easier, since the value is
initialized in the executable image, rather than at runtime,
so the value Really Is Never Modified.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]