summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-16 18:52:57 +0000
committerDan Gohman <gohman@apple.com>2008-09-16 18:52:57 +0000
commitdc5f5cbe5939d47c5440280e63c1130f4459f750 (patch)
treecd1f7056d429e3361dfb0ae31aa15382235ac0c2 /llvm/lib
parentdafa9c6e859cfdeed7488ec7fa6a5baf694e2f66 (diff)
downloadbcm5719-llvm-dc5f5cbe5939d47c5440280e63c1130f4459f750.tar.gz
bcm5719-llvm-dc5f5cbe5939d47c5440280e63c1130f4459f750.zip
Finally re-apply r46959. This is made feasible by the combination
of r56230, r56232, and r56246. llvm-svn: 56247
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 4e85e90e9e0..51258044691 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1981,8 +1981,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 (isa<SCEVConstant>(LHS) && !isa<SCEVConstant>(RHS)) {
- // If there is a constant, force it into the RHS.
+ if (LHS->isLoopInvariant(L) && !RHS->isLoopInvariant(L)) {
+ // If there is a loop-invariant, force it into the RHS.
std::swap(LHS, RHS);
Cond = ICmpInst::getSwappedPredicate(Cond);
}
OpenPOWER on IntegriCloud