aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-20 22:34:18 +0000
committerDan Gohman <gohman@apple.com>2009-07-20 22:34:18 +0000
commit746f3b1a9ba22d9b9622240814899417941d2480 (patch)
tree89bbb0bb29465517e23892e6e6067f8297f93c57 /lib/Analysis/ScalarEvolution.cpp
parentb3e71893537165fb121e0ebc181689b041754b89 (diff)
The upper argument of ConstantRange is exclusive, not inclusive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index aadba9d9d3..c888a7a9ec 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -2644,7 +2644,9 @@ ScalarEvolution::getUnsignedRange(const SCEV *S) {
APInt Mask = APInt::getAllOnesValue(BitWidth);
APInt Zeros(BitWidth, 0), Ones(BitWidth, 0);
ComputeMaskedBits(U->getValue(), Mask, Zeros, Ones, TD);
- return ConstantRange(Ones, ~Zeros);
+ if (Ones == ~Zeros + 1)
+ return FullSet;
+ return ConstantRange(Ones, ~Zeros + 1);
}
return FullSet;