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: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes)
- Subject: Re: Loop optimiser upgrade (Was RFC: BB duplication code)
- From: Joern Rennecke <amylaar at redhat dot com>
- Date: Thu, 20 Sep 2001 06:22:58 +0100 (BST)
- Cc: jh at suse dot cz (Jan Hubicka), gcc at gcc dot gnu dot org
> I agree that the loop notes should be weeded out. The one useful loop
> note is the VTOP note that indicates if the loop exit code has been
> duplicated. When this loop exists and we know that the loop body will
> be executed at least once if the loop header is entered. I'm not sure
> of an easy means to determine this from the CFG.
Actually, that is the easy part. You just have to look if the loop is
solely entered by fallthrough from the preceding block. In the non-vtop
while loop case, you have a jump from outside to the loop exit test.
However, the VTOP note means more than just that the loop is executed
at least once when entered. It also means that the loop exit condition
will be false at the start of the first iteration. This knowledge
allows you to do some extra strength reduction and unroll loop
preconditioning transforations without emitting extra runtime checks.