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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100993 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-04-11 22:12:18 +00:00
parent e48172710b
commit bc7129f9db

View File

@ -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()) {