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: Variable Expansion Optimization


On Monday 16 August 2004 03:23, Giovanni Bajo wrote:
> Mark Mitchell wrote:
> > I'd hope that soon we'd be able to get rid of the RTL-based loop
> > unroller, but I'm perfectly willing to believe that day to be a ways
> > away...

I'd think loop unrolling is one of those things you don't want to do
on trees because its profitability depends on many very target specific
parameters (unlike, say, unswitching, scheduling, etc.).  Also, there
are unfortunately a bunch of expanders that produce loops too, so we're
still going to need the ability to optimize loops on RTL.

We don't unroll tree loops on mainline yet.  On the LNO branch we can
unroll loops completely if they roll only a few times, and we can peel
and unroll on demand for the vectorizer and (TODO:) the prefetch pass.
Other unrolling decisions are probably too target specific to decide
about at the tree level, so they're left to the RTL unroller.


> Especially if you consider that we have *2* loop unrollers (that is, the
> old one is still around and kicking).

The old one (unroll.c) already doesn't buy us much, and it should go
away soon.  That will be some cleanup...


> BTW, Zdenek, what is the status on
> this? I thought we could remove the old loop unroller (and/or optimizer?)
> after the new one was merged?

[ Zdenek is still on holiday, so I tried... ;-)  ]

The old unroller used to produce better code in a few instances and it
had a few extra features that the new unroller did not (such as splitting
induction variables).  The new unroller can now do this and most missing
pieces have been implemented too.  The only missing bit is RTL strength
reduction.  There is a pass to do that on the LNO branch that could be
merged soon.
(If all else fails I guess there still is loop-ivopts.c on the rtlopt
branch...)

The other missing bit in the new loop optimizer is prefetching, but again
there is a pass for this on the LNO branch that, even in its current
limited form, is better than the RTL one in loop.c.

Gr.
Steven




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