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: Empty loop removal


On Monday 07 February 2005 23:32, Zdenek Dvorak wrote:
> Hello,
>
> > > As for empty loop removal, would it be possible to get empty loops
> > > with known iteration count removed in 4.0?  If I read Zdeneks
> > > patch at
> > > http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01679.html
> > > correctly, it would do just that if we removed all the parts of
> > > builtin_maybe_infinite_loop, no?
> > >
> > > Zdenek, is there a more "easy" way to get these class of loops
> > > removed?  I played a bit with the complete unrolling code, but
> > > that get's me into degenerate cases with 1000s of iterations
> > > and the load of IV increments duplicated :)
> >
> > Can't there just be a loop pass that kills loop that are finite
> > and have no effects outside the loop?  How hard can that be, just
> > see if everything that is set in the loop is not used outside
> > the loop.
>
> quite simple; still modifying cddce is a bit simpler and more efficient.

Of course CDDCE can already do it, but it requires the
builtin_maybe_infinite_loop thing, which is IMHO quite ugly.

For 4.0 we can maybe have the small pass.  For 4.1 we should
just preserve loops etc. etc. which makes everything a whole
lot easier everywhere...

Gr.
Steven


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