Skip to content

Commit 43c48c5

Browse files
committed
Refine the expression of valid range
1 parent 560efe1 commit 43c48c5

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

0 commit comments

Comments
 (0)