-funswitch-loops not effective?
Richard Guenther
richard.guenther@gmail.com
Wed Jan 19 15:03:00 GMT 2005
On Tue, 18 Jan 2005 15:56:02 -0800, Richard Henderson <rth@redhat.com> wrote:
> 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.
Oh, I see. Maybe we can still come up with something clever and not
fragile. Meanwhile, the Intel compiler is not able to do this either, nor
does it do the jump threading we do at RTL level. Does any compiler
out in the wild do this transformation?
Richard.
More information about the Gcc
mailing list