summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2012-10-04 19:08:30 +0000
committerJakub Staszak <kubastaszak@gmail.com>2012-10-04 19:08:30 +0000
commite076cac097bf2ef86157dcda4282661a8900d382 (patch)
tree440e3c4ff5d13e7f7eacd4ee0d3228e62b392934 /llvm/lib
parent4a67f2e2a7f84f9535e32a42dcdd21cd0244b8d4 (diff)
downloadbcm5719-llvm-e076cac097bf2ef86157dcda4282661a8900d382.tar.gz
bcm5719-llvm-e076cac097bf2ef86157dcda4282661a8900d382.zip
Add a comment to the commit r165187.
llvm-svn: 165238
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 23d0bb51b3e..af0ee34d0d1 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud