summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-11 22:12:18 +0000
committerDan Gohman <gohman@apple.com>2010-04-11 22:12:18 +0000
commitae4a4148baf1551894404ec896586441d61919f9 (patch)
tree82763b4ca01232172ba1f61ca26a3fe715336773 /llvm/lib/Analysis
parent2352dd7ee0f033fda3d1e90e94f0b980a28ba7b0 (diff)
downloadbcm5719-llvm-ae4a4148baf1551894404ec896586441d61919f9.tar.gz
bcm5719-llvm-ae4a4148baf1551894404ec896586441d61919f9.zip
When creating a ConstantRange for [n,UINT_MAX], special case n == 0, because
ConstantRange(0, 0) creates an empty range rather than a full one. llvm-svn: 100993
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index c67cb71b303..44aa5082b1c 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2920,9 +2920,10 @@ ScalarEvolution::getUnsignedRange(const SCEV *S) {
// initial value.
if (AddRec->hasNoUnsignedWrap())
if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart()))
- ConservativeResult =
- ConstantRange(C->getValue()->getValue(),
- APInt(getTypeSizeInBits(C->getType()), 0));
+ if (!C->isZero())
+ ConservativeResult =
+ ConstantRange(C->getValue()->getValue(),
+ APInt(getTypeSizeInBits(C->getType()), 0));
// TODO: non-affine addrec
if (AddRec->isAffine()) {
OpenPOWER on IntegriCloud