Add a comment to the commit r165187.
authorJakub Staszak <kubastaszak@gmail.com>
Thu, 4 Oct 2012 19:08:30 +0000 (19:08 +0000)
committerJakub Staszak <kubastaszak@gmail.com>
Thu, 4 Oct 2012 19:08:30 +0000 (19:08 +0000)
llvm-svn: 165238

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

index 23d0bb5..af0ee34 100644 (file)
@@ -1261,10 +1261,12 @@ static bool needsLFTR(Loop *L, DominatorTree *DT) {
   if (!Phi)
     return true;
 
-  // Do LFTR if the exit condition's IV is *not* a simple counter.
+  // Do LFTR if PHI node is defined in the loop, but is *not* a counter.
   int Idx = Phi->getBasicBlockIndex(L->getLoopLatch());
   if (Idx < 0)
     return true;
+
+  // Do LFTR if the exit condition's IV is *not* a simple counter.
   Value *IncV = Phi->getIncomingValue(Idx);
   return Phi != getLoopPhiForCounter(IncV, L, DT);
 }