summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-16 00:37:01 +0000
committerChris Lattner <sabre@nondot.org>2005-08-16 00:37:01 +0000
commite51541639622c808c1796e5a86fcf61e8208eae2 (patch)
tree959caa68cb0c7e92e16d361fc68b6cc7bed7102c /llvm/lib/Analysis/ScalarEvolution.cpp
parent3cf8ef170a0147b296ed4b3c74e35aa0d455e91b (diff)
downloadbcm5719-llvm-e51541639622c808c1796e5a86fcf61e8208eae2.tar.gz
bcm5719-llvm-e51541639622c808c1796e5a86fcf61e8208eae2.zip
Fix Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll
llvm-svn: 22797
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 2601277cd8c..41173c9ce13 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -347,8 +347,9 @@ replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
bool SCEVAddRecExpr::isLoopInvariant(const Loop *QueryLoop) const {
// This recurrence is invariant w.r.t to QueryLoop iff QueryLoop doesn't
- // contain L.
- return !QueryLoop->contains(L->getHeader());
+ // contain L and if the start is invariant.
+ return !QueryLoop->contains(L->getHeader()) &&
+ getOperand(0)->isLoopInvariant(QueryLoop);
}
OpenPOWER on IntegriCloud