This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Loop optimiser upgrade (Was RFC: BB duplication code)


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]