diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-20 22:34:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-20 22:34:18 +0000 |
commit | 1a7ab9473f794d4ae3f36af5d42023123bc7ddb2 (patch) | |
tree | 578a5cf561cb43f8b5818d72a0602f8407e5de44 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 2cd8f753c0269a30df283a3f4c42be9184968bc9 (diff) | |
download | bcm5719-llvm-1a7ab9473f794d4ae3f36af5d42023123bc7ddb2.tar.gz bcm5719-llvm-1a7ab9473f794d4ae3f36af5d42023123bc7ddb2.zip |
The upper argument of ConstantRange is exclusive, not inclusive.
llvm-svn: 76492
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index aadba9d9d3d..c888a7a9ec5 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/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; |