diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-25 03:57:32 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-25 03:57:32 +0000 |
commit | b9a905781ee8ee49660c6733530d42dece94d12a (patch) | |
tree | d8c8722071091546004ea267e7b00056a5163405 | |
parent | 0f7ea1ab106ffb3c8e23a87c0687f85132d93ca1 (diff) | |
download | external_llvm-b9a905781ee8ee49660c6733530d42dece94d12a.zip external_llvm-b9a905781ee8ee49660c6733530d42dece94d12a.tar.gz external_llvm-b9a905781ee8ee49660c6733530d42dece94d12a.tar.bz2 |
Temporarily reverting 46959.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47542 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 4 | ||||
-rw-r--r-- | test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 876ebd4..0db02d9 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1919,8 +1919,8 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) { // At this point, we would like to compute how many iterations of the // loop the predicate will return true for these inputs. - if (LHS->isLoopInvariant(L) && !RHS->isLoopInvariant(L)) { - // If there is a loop-invariant, force it into the RHS. + if (isa<SCEVConstant>(LHS) && !isa<SCEVConstant>(RHS)) { + // If there is a constant, force it into the RHS. std::swap(LHS, RHS); Cond = ICmpInst::getSwappedPredicate(Cond); } diff --git a/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll b/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll index e191b35..3f88b01 100644 --- a/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll +++ b/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop header: ( 0 smax %n) iterations!} +; XFAIL: * define void @foo(i32 %n) { entry: |