This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Loop optimiser upgrade (Was RFC: BB duplication code)
- To: Joern Rennecke <amylaar at onetel dot net dot uk>
- Subject: Re: Loop optimiser upgrade (Was RFC: BB duplication code)
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Sun, 23 Sep 2001 23:29:49 +1200 (NZST)
- Cc: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes), amylaar at redhat dot com (Joern Rennecke), jh at suse dot cz (Jan Hubicka), gcc at gcc dot gnu dot org
- References: <15275.62281.665389.608340@ongaonga.elec.canterbury.ac.nz> <200109220403.FAA29136@meolyon.local>
Joern Rennecke writes:
> > My question is how do we tell this from a do-while loop with a goto
> > around it?
>
> You don't - and it's immaterial for the purpose of spotting loops that are
> executed at least once if entered. That's a property all do-wile loops
> have, by definition.
Sure! I guess I didn't explain myself well or you missed my point.
The advantage of knowing that the loop exit test has been duplicated
is that when one of these transformed loops is entered we know that
the exit test will be true on the first iteration. This allows us to
compute the number (or maximum number) of iterations of well behaved
loops without having do perform value range propagation.
The point I was trying to make is that I do not know of a simple,
general, way of looking at the CFG to see if the loop exit has been
duplicated. I cannot see how your suggestion that there may be a
fall-through edge into the loop header will tell us this since
I can construct an equivalent CFG using a goto.
Michael.