Loop unrolling

Lee Iverson leei@ai.sri.com
Thu Sep 17 22:12:00 GMT 1998

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

More information about the Gcc mailing list