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


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.

Zdenek


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