This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unrolling
- To: law at cygnus dot com
- Subject: Re: Loop unrolling
- From: Lee Iverson <leei at ai dot sri dot com>
- Date: Thu, 17 Sep 1998 11:22:46 -0700
- cc: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>, egcs at cygnus dot com, Scott A Crosby <crosby at qwes dot math dot cmu dot edu>
In message <12183.906015270@hurl.cygnus.com> you write:
>
> In message <Pine.GSO.4.03.9809161956460.15088-100000@markab.dbai.tuwien.ac.
> at>you write:
> > The current state of this is that basically the discussion has stopped
> > without any clear decision for or against removal of empty loops and
> > that currently the documentation does not (always) match actual behaviour
> .
> I thought I had said something about this.
>
> Basically I have no objection to the optimizers removing empty loops.
> The old arguments against removing them were lame to start with and
> they're even more lame now.
>
> If someone wants to submit code to allow loop.c to remove such loops,
> it will not be rejected because "gcc isn't supposed to remove empty
> loops".
The technical problems are:
1) Semi-reliably determine that a loop terminates (the constraint is
all one-sided in that we can never delete a loop unless we can
prove that it terminates).
2) Determining whether a loop is empty or not needs some kind of
register lifetime information. Last I looked, this was not
reliable at the time of loop unrolling. If this is no longer true,
then I can resurrect some code to do this.
-------------------------------------------------------------------------------
Lee Iverson SRI International
leei@ai.sri.com 333 Ravenswood Ave., Menlo Park CA 94025
http://www.ai.sri.com/~leei/ (650) 859-3307