diff options
| author | Dan Gohman <gohman@apple.com> | 2010-04-11 22:12:18 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-04-11 22:12:18 +0000 |
| commit | ae4a4148baf1551894404ec896586441d61919f9 (patch) | |
| tree | 82763b4ca01232172ba1f61ca26a3fe715336773 /llvm/lib/Analysis | |
| parent | 2352dd7ee0f033fda3d1e90e94f0b980a28ba7b0 (diff) | |
| download | bcm5719-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.cpp | 7 |
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()) { |

