This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Variable Expansion Optimization
- From: Ayal Zaks <ZAKS at il dot ibm dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org, Giovanni Bajo <giovannibajo at libero dot it>, Mark Mitchell <mark at codesourcery dot com>, Mostafa Hagog <MUSTAFA at il dot ibm dot com>
- Date: Tue, 24 Aug 2004 00:54:04 +0300
- Subject: Re: Variable Expansion Optimization
- Reply-to:
- Sensitivity:
Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote on 23/08/2004
18:26:01:
> Hello,
>
> > > > >1) The loop unrolling as a separate optimization should be done on
> > > > > rtl level, to avoid unnecessary compile-time overheads
(optimizing
> > > > > the unrolled loop bodies separately is rarely useful and
usually
> > > > > just a waste of time). For reasons mentioned by Sebastian
> > (possible
> > > > > loss of information during unrolling, mostly), I believe the
right
> > > > > place for the unrolling optimization would be after the
loop-aware
> > > > > scheduling passes (SMS), and before rest of scheduling passes
and
> > > > > register allocation.
> > > >
> > > > Well, SMS could overlap more insns if the loop is unrolled before
SMS.
> > >
> > > as I understood, unrolling is a part of SMS; why this should be the
> > > case?
> >
> > SMS does not unroll the loop. It "peels" certain insns into a prolog
(and
> > complementary into an epilog), so that the loop itself iterates a few
> > iterations less.
>
> sorry, I missunderstood that. How hard would it be to incorporate
> unrolling into SMS? It seems to me that this optimizations is
> one of the very few places that have information sufficient to estimate
> how profitable the unrolling by different factors would be with respect
> to scheduling.
>
> Zdenek
Unrolling is mainly profitable scheduling-wise if successive iterations can
be overlapped, and this is determined by cross-iteration dependences and
the "recurrence-based minimal-initiation-interval (recMII)" compared to the
length of the standard intra-loop critical path. SMS calculates this and
can estimate this potential overlap for simple loops, to help drive the
unroller.
Ayal.