[PATCH] D25682: [LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 03:26:43 PDT 2016

john.brawn added inline comments.

Comment at: lib/Analysis/ScalarEvolution.cpp:5741
         MustExitMaxBECount = EL.MaxNotTaken;
-      else {
+        MustExitMaxOrZero = EL.MaxOrZero;
+      } else {
sbaranga wrote:
> Does this work with more than one loop exit and with predicated loop exits?
> I'm not certain this would hold if we have at least one loop exit that doesn't dominate the latch, given the very strict definition (the backedge gets taken exactly 0 or MaxNotTaken times).
That's handled down on line 5759 - MaxOrZero is set to false on loops with more than one exit.



More information about the llvm-commits mailing list