aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-25 03:57:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-25 03:57:32 +0000
commit1d18308a34941a06b1c42b4c9c4cf86b0fc179ca (patch)
treed8c8722071091546004ea267e7b00056a5163405 /lib/Analysis
parent05744bd8eb118afc01b9abf4fd40cd7fd68b1a74 (diff)
downloadexternal_llvm-1d18308a34941a06b1c42b4c9c4cf86b0fc179ca.zip
external_llvm-1d18308a34941a06b1c42b4c9c4cf86b0fc179ca.tar.gz
external_llvm-1d18308a34941a06b1c42b4c9c4cf86b0fc179ca.tar.bz2
Temporarily reverting 46959.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 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);
}