Skip to content

Commit ac17002

Browse files
committed
Refine the expression of valid range
1 parent 420236f commit ac17002

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
@@ -734,8 +734,8 @@ RecurrenceDescriptor::isFindLastIVPattern(Loop *Loop, PHINode *OrigPhi,
734734
// TODO: This range restriction can be lifted by adding an additional
735735
// virtual OR reduction.
736736
const APInt Sentinel = APInt::getSignedMinValue(NumBits);
737-
const ConstantRange ValidRange = ConstantRange::getNonEmpty(
738-
Sentinel + 1, APInt::getSignedMinValue(NumBits));
737+
const ConstantRange ValidRange =
738+
ConstantRange::getFull(NumBits).difference(ConstantRange(Sentinel));
739739
LLVM_DEBUG(dbgs() << "LV: FindLastIV valid range is " << ValidRange
740740
<< ", and the signed range of " << *AR << " is "
741741
<< IVRange << "\n");

0 commit comments

Comments
 (0)