This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Empty loop removal
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Steven Bosscher <stevenb at novell dot com>
- Cc: gcc at gcc dot gnu dot org,Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Date: Mon, 7 Feb 2005 23:32:08 +0100
- Subject: Re: Empty loop removal
- References: <4207E8C6.408@tat.physik.uni-tuebingen.de> <200502072328.12804.stevenb@novell.com>
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