Skip to content

Commit b65ab0b

Browse files
committed
[ValueTracking] Add comment clarifying missing usub.sat in isKnownNonZero; NFC
Closes #87700
1 parent 5c056b3 commit b65ab0b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2816,6 +2816,8 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
28162816
case Intrinsic::bswap:
28172817
case Intrinsic::ctpop:
28182818
return isKnownNonZero(II->getArgOperand(0), DemandedElts, Depth, Q);
2819+
// NB: We don't do usub_sat here as in any case we can prove its
2820+
// non-zero, we will fold it to `sub nuw` in InstCombine.
28192821
case Intrinsic::ssub_sat:
28202822
return isNonZeroSub(DemandedElts, Depth, Q, BitWidth,
28212823
II->getArgOperand(0), II->getArgOperand(1));

0 commit comments

Comments
 (0)