Skip to content

Commit d2bfe2f

Browse files
committed
Refine the expression of valid range
1 parent e8d5b1d commit d2bfe2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,8 @@ RecurrenceDescriptor::isFindLastIVPattern(Loop *Loop, PHINode *OrigPhi,
732732
// TODO: This range restriction can be lifted by adding an additional
733733
// virtual OR reduction.
734734
const APInt Sentinel = APInt::getSignedMinValue(NumBits);
735-
const ConstantRange ValidRange = ConstantRange::getNonEmpty(
736-
Sentinel + 1, APInt::getSignedMinValue(NumBits));
735+
const ConstantRange ValidRange =
736+
ConstantRange::getFull(NumBits).difference(ConstantRange(Sentinel));
737737
LLVM_DEBUG(dbgs() << "LV: FindLastIV valid range is " << ValidRange
738738
<< ", and the signed range of " << *AR << " is "
739739
<< IVRange << "\n");

0 commit comments

Comments
 (0)