From eb51e95e61bd93cb764e14cdd5f0271e237e4673 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Thu, 4 Oct 2012 19:08:30 +0000 Subject: Add a comment to the commit r165187. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165238 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp') diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 23d0bb51b3..af0ee34d0d 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -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); } -- cgit v1.2.3