[tree-ssa] Temporary Expression Replacement in SSA->normal.

Jan Hubicka hubicka@ucw.cz
Fri Nov 28 22:09:00 GMT 2003


> On Fri, 2003-11-28 at 16:09, Jan Hubicka wrote:
> > > On Fri, 2003-11-28 at 15:15, Zack Weinberg wrote:
> > > > Andrew MacLeod <amacleod@redhat.com> writes:
> 
> > > 
> > > I beleive that is the longer term plan, but this was pretty simple to do
> > > and gets us a bunch of runtime performance back until we have the time
> > > to get to it and take care of it properly. -fno-tree-ter turns it off so
> > > we can compare results when we do that work.
> > > 
> > > It'll be removed when its no longer needed.
> > 
> > Do you also have some data on how it compares to the idea of running
> > webizer early?  It seem to me that there are two unrelated problems -
> > one is that expanders are sometimes smart about nested expressions, but
> > this should be more or less dealt with by ccp.  The other problem is
> > that we are re-using RTL temporary registers and this is fixable by
> > other ways (like by not re-using temporaries during gimplification or
> > not re-use variables with nonoverlaping live ranges during de-ssa) and
> > your change then would just mask majority of problematic cases, but not
> > all of them.
> 
> No data to give you now, but I did give it a try, and running webizer
> early didn't help.. the interactions between the vast number of gimple
> temoraries, the expanders and our register allocators is significant
> enough that it will require some work. We get some very bad spill
> behaviour on register constrained machines like x86 (new-ra didn't
> really help either).A really good rematerialization pass would benefit
> us immensely. 
> 
> I would expect to see less benefit on machines with lots of registers,
> but I haven't measured it. The original thought was to turn it off for
> machines like that, but I dont think anyone has measured it.

Actually the register allocator interaction should be completely solved
by webizer.  I just tested that TER saves about 400 instructions on
combine, when webizer is used and about 1000 instruction when webizer is
not used.

So it seems in addition to problem with temporaries expanders are still
more smart when dealing with complex expressions.  Except for getting
more folding I think it can be some cases where memory operand is
involved.  Perhaps like we do for constants in CCP we may consider using
nested loads/stores in late GIMPLE forms.
Or perhaps make the SSA infromation visible to the expanders so they may
ask questions about operands (their ranges, wehther they are memory
operands load just once, or so on)

I will try to add this into my mid term TODO...
Honza
> 
> Anyone who feels so inclined can poke at it now can compare by disabling
> TER :-)
> 
> Andrew
> 
> 



More information about the Gcc-patches mailing list