diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-16 00:37:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-16 00:37:01 +0000 |
commit | e51541639622c808c1796e5a86fcf61e8208eae2 (patch) | |
tree | 959caa68cb0c7e92e16d361fc68b6cc7bed7102c /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 3cf8ef170a0147b296ed4b3c74e35aa0d455e91b (diff) | |
download | bcm5719-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.cpp | 5 |
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); } |