When computing a new ConservativeResult, intersect it with

the old one instead of replacing it, to be more precise.

llvm-svn: 107256
This commit is contained in:
Dan Gohman 2010-06-30 06:58:35 +00:00
parent 2112bbf184
commit 7446416058

View File

@ -2958,7 +2958,8 @@ ScalarEvolution::getUnsignedRange(const SCEV *S) {
if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart()))
if (!C->getValue()->isZero())
ConservativeResult =
ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0));
ConservativeResult.intersectWith(
ConstantRange(C->getValue()->getValue(), APInt(BitWidth, 0)));
// TODO: non-affine addrec
if (AddRec->isAffine()) {