31 bool CarryZero,
bool CarryOne) {
33 APInt PossibleSumZero =
LHS.getMaxValue() +
RHS.getMaxValue() + !CarryZero;
34 APInt PossibleSumOne =
LHS.getMinValue() +
RHS.getMinValue() + CarryOne;
37 APInt CarryKnownZero = ~(PossibleSumZero ^
LHS.Zero ^
RHS.Zero);
38 APInt CarryKnownOne = PossibleSumOne ^
LHS.One ^
RHS.One;
43 APInt CarryKnownUnion = std::move(CarryKnownZero) | CarryKnownOne;
44 APInt Known = std::move(LHSKnownUnion) & RHSKnownUnion & CarryKnownUnion;
49 KnownOut.
One = std::move(PossibleSumOne) & Known;
56 return ::computeForAddCarry(
67 if (
LHS.isUnknown() &&
RHS.isUnknown())
70 if (!
LHS.isUnknown() && !
RHS.isUnknown()) {
88 APInt MinVal =
LHS.getMinValue().uadd_sat(
RHS.getMinValue());
100 APInt MaxVal =
LHS.getMaxValue().usub_sat(
RHS.getMinValue());
118 MinVal =
LHS.getSignedMinValue().sadd_sat(
RHS.getSignedMinValue());
119 MaxVal =
LHS.getSignedMaxValue().sadd_sat(
RHS.getSignedMaxValue());
122 MinVal =
LHS.getSignedMinValue().ssub_sat(
RHS.getSignedMaxValue());
123 MaxVal =
LHS.getSignedMaxValue().ssub_sat(
RHS.getSignedMinValue());
153 return ::computeForAddCarry(
LHS,
RHS,
161 "Illegal sext-in-register");
166 unsigned ExtBits =
BitWidth - SrcBitWidth;
168 Result.One =
One << ExtBits;
169 Result.Zero =
Zero << ExtBits;
170 Result.One.ashrInPlace(ExtBits);
171 Result.Zero.ashrInPlace(ExtBits);
182 APInt MaskedVal(Val);
192 if (
LHS.getMinValue().uge(
RHS.getMaxValue()))
194 if (
RHS.getMinValue().uge(
LHS.getMaxValue()))
202 return L.intersectWith(R);
212 return flipSignBit(
umax(flipSignBit(
LHS), flipSignBit(
RHS)));
231 if (
LHS.getMinValue().uge(
RHS.getMaxValue()))
234 if (
RHS.getMinValue().uge(
LHS.getMaxValue()))
250 if (
LHS.getSignedMinValue().sge(
RHS.getSignedMaxValue()))
253 if (
RHS.getSignedMinValue().sge(
LHS.getSignedMaxValue()))
263 unsigned SignBitPosition =
LHS.getBitWidth() - 1;
264 for (
auto Arg : {&
LHS, &
RHS}) {
265 bool Tmp = Arg->Zero[SignBitPosition];
266 Arg->Zero.setBitVal(SignBitPosition, Arg->One[SignBitPosition]);
267 Arg->One.setBitVal(SignBitPosition, Tmp);
286 bool NSW,
bool ShAmtNonZero) {
288 auto ShiftByConst = [&](
const KnownBits &
LHS,
unsigned ShiftAmt) {
290 bool ShiftedOutZero, ShiftedOutOne;
291 Known.
Zero =
LHS.Zero.ushl_ov(ShiftAmt, ShiftedOutZero);
293 Known.
One =
LHS.One.ushl_ov(ShiftAmt, ShiftedOutOne);
297 if (NUW && ShiftAmt != 0)
299 ShiftedOutZero =
true;
303 else if (ShiftedOutOne)
311 unsigned MinShiftAmount =
RHS.getMinValue().getLimitedValue(
BitWidth);
312 if (MinShiftAmount == 0 && ShAmtNonZero)
314 if (
LHS.isUnknown()) {
316 if (NUW && NSW && MinShiftAmount != 0)
325 MaxShiftAmount = std::min(MaxShiftAmount,
LHS.countMaxLeadingZeros() - 1);
327 MaxShiftAmount = std::min(MaxShiftAmount,
LHS.countMaxLeadingZeros());
329 MaxShiftAmount = std::min(
331 std::max(
LHS.countMaxLeadingZeros(),
LHS.countMaxLeadingOnes()) - 1);
334 if (MinShiftAmount == 0 && MaxShiftAmount ==
BitWidth - 1 &&
340 if (
LHS.isNonNegative())
342 if (
LHS.isNegative())
349 unsigned ShiftAmtZeroMask =
RHS.Zero.zextOrTrunc(32).getZExtValue();
350 unsigned ShiftAmtOneMask =
RHS.One.zextOrTrunc(32).getZExtValue();
353 for (
unsigned ShiftAmt = MinShiftAmount; ShiftAmt <= MaxShiftAmount;
356 if ((ShiftAmtZeroMask & ShiftAmt) != 0 ||
357 (ShiftAmtOneMask | ShiftAmt) != ShiftAmt)
371 bool ShAmtNonZero,
bool Exact) {
373 auto ShiftByConst = [&](
const KnownBits &
LHS,
unsigned ShiftAmt) {
384 unsigned MinShiftAmount =
RHS.getMinValue().getLimitedValue(
BitWidth);
385 if (MinShiftAmount == 0 && ShAmtNonZero)
387 if (
LHS.isUnknown()) {
398 unsigned FirstOne =
LHS.countMaxTrailingZeros();
399 if (FirstOne < MinShiftAmount) {
404 MaxShiftAmount = std::min(MaxShiftAmount, FirstOne);
407 unsigned ShiftAmtZeroMask =
RHS.Zero.zextOrTrunc(32).getZExtValue();
408 unsigned ShiftAmtOneMask =
RHS.One.zextOrTrunc(32).getZExtValue();
411 for (
unsigned ShiftAmt = MinShiftAmount; ShiftAmt <= MaxShiftAmount;
414 if ((ShiftAmtZeroMask & ShiftAmt) != 0 ||
415 (ShiftAmtOneMask | ShiftAmt) != ShiftAmt)
429 bool ShAmtNonZero,
bool Exact) {
431 auto ShiftByConst = [&](
const KnownBits &
LHS,
unsigned ShiftAmt) {
440 unsigned MinShiftAmount =
RHS.getMinValue().getLimitedValue(
BitWidth);
441 if (MinShiftAmount == 0 && ShAmtNonZero)
443 if (
LHS.isUnknown()) {
458 unsigned FirstOne =
LHS.countMaxTrailingZeros();
459 if (FirstOne < MinShiftAmount) {
464 MaxShiftAmount = std::min(MaxShiftAmount, FirstOne);
467 unsigned ShiftAmtZeroMask =
RHS.Zero.zextOrTrunc(32).getZExtValue();
468 unsigned ShiftAmtOneMask =
RHS.One.zextOrTrunc(32).getZExtValue();
471 for (
unsigned ShiftAmt = MinShiftAmount; ShiftAmt <= MaxShiftAmount;
474 if ((ShiftAmtZeroMask & ShiftAmt) != 0 ||
475 (ShiftAmtOneMask | ShiftAmt) != ShiftAmt)
489 if (
LHS.isConstant() &&
RHS.isConstant())
490 return std::optional<bool>(
LHS.getConstant() ==
RHS.getConstant());
491 if (
LHS.One.intersects(
RHS.Zero) ||
RHS.One.intersects(
LHS.Zero))
492 return std::optional<bool>(
false);
497 if (std::optional<bool> KnownEQ =
eq(
LHS,
RHS))
498 return std::optional<bool>(!*KnownEQ);
504 if (
LHS.getMaxValue().ule(
RHS.getMinValue()))
505 return std::optional<bool>(
false);
507 if (
LHS.getMinValue().ugt(
RHS.getMaxValue()))
508 return std::optional<bool>(
true);
513 if (std::optional<bool> IsUGT =
ugt(
RHS,
LHS))
514 return std::optional<bool>(!*IsUGT);
528 if (
LHS.getSignedMaxValue().sle(
RHS.getSignedMinValue()))
529 return std::optional<bool>(
false);
531 if (
LHS.getSignedMinValue().sgt(
RHS.getSignedMaxValue()))
532 return std::optional<bool>(
true);
537 if (std::optional<bool> KnownSGT =
sgt(
RHS,
LHS))
538 return std::optional<bool>(!*KnownSGT);
569 false, IntMinIsPoison,
false,
615 std::optional<bool> Overflow;
620 bool MayNegClamp =
true;
621 bool MayPosClamp =
true;
624 if (
Add && ((
LHS.isNegative() &&
RHS.isNonNegative()) ||
625 (
LHS.isNonNegative() &&
RHS.isNegative())))
627 else if (!
Add && (((
LHS.isNegative() &&
RHS.isNegative()) ||
628 (
LHS.isNonNegative() &&
RHS.isNonNegative()))))
645 false, UnsignedLHS, UnsignedRHS);
651 if (
LHS.isNonNegative() &&
RHS.isNonNegative())
657 if (
LHS.isNegative() &&
RHS.isNegative())
661 if (
LHS.isNegative() ||
RHS.isNegative())
663 if (
LHS.isNonNegative() ||
RHS.isNonNegative())
670 if (
LHS.isNegative() &&
RHS.isNonNegative())
676 if (
LHS.isNonNegative() &&
RHS.isNegative())
680 if (
LHS.isNegative() ||
RHS.isNonNegative())
682 if (
LHS.isNonNegative() ||
RHS.isNegative())
687 if (!MayNegClamp && !MayPosClamp)
692 (void)
LHS.getMaxValue().uadd_ov(
RHS.getMaxValue(), Of);
696 (void)
LHS.getMinValue().uadd_ov(
RHS.getMinValue(), Of);
703 (void)
LHS.getMinValue().usub_ov(
RHS.getMaxValue(), Of);
707 (void)
LHS.getMaxValue().usub_ov(
RHS.getMinValue(), Of);
728 "We somehow know overflow without knowing input sign");
805 bool NoUndefSelfMultiply) {
809 "Self multiplication knownbits mismatch");
822 APInt UMaxResult = UMaxLHS.
umul_ov(UMaxRHS, HasOverflow);
823 unsigned LeadZ = HasOverflow ? 0 : UMaxResult.
countl_zero();
874 unsigned TrailZero0 =
LHS.countMinTrailingZeros();
875 unsigned TrailZero1 =
RHS.countMinTrailingZeros();
876 unsigned TrailZ = TrailZero0 + TrailZero1;
879 unsigned SmallestOperand =
880 std::min(TrailBitsKnown0 - TrailZero0, TrailBitsKnown1 - TrailZero1);
881 unsigned ResultBitsKnown = std::min(SmallestOperand + TrailZ,
BitWidth);
888 Res.
Zero |= (~BottomKnown).getLoBits(ResultBitsKnown);
892 if (NoUndefSelfMultiply &&
BitWidth > 1) {
894 "Self-multiplication failed Quadratic Reciprocity!");
930 (int)
LHS.countMinTrailingZeros() - (int)
RHS.countMaxTrailingZeros();
932 (int)
LHS.countMaxTrailingZeros() - (int)
RHS.countMinTrailingZeros();
936 if (MinTZ == MaxTZ) {
940 }
else if (MaxTZ < 0) {
956 if (
LHS.isNonNegative() &&
RHS.isNonNegative())
962 if (
LHS.isZero() ||
RHS.isZero()) {
969 std::optional<APInt> Res;
970 if (
LHS.isNegative() &&
RHS.isNegative()) {
972 APInt Denom =
RHS.getSignedMaxValue();
973 APInt Num =
LHS.getSignedMinValue();
979 }
else if (
LHS.isNegative() &&
RHS.isNonNegative()) {
981 if (Exact || (-
LHS.getSignedMaxValue()).uge(
RHS.getSignedMaxValue())) {
982 APInt Denom =
RHS.getSignedMinValue();
983 APInt Num =
LHS.getSignedMinValue();
986 }
else if (
LHS.isStrictlyPositive() &&
RHS.isNegative()) {
988 if (Exact ||
LHS.getSignedMinValue().uge(-
RHS.getSignedMinValue())) {
989 APInt Denom =
RHS.getSignedMaxValue();
990 APInt Num =
LHS.getSignedMaxValue();
991 Res = Num.
sdiv(Denom);
996 if (Res->isNonNegative()) {
1000 unsigned LeadO = Res->countLeadingOnes();
1014 if (
LHS.isZero() ||
RHS.isZero()) {
1024 APInt MinDenom =
RHS.getMinValue();
1038 if (!
RHS.isZero() &&
RHS.Zero[0]) {
1040 unsigned RHSZeros =
RHS.countMinTrailingZeros();
1051 if (
RHS.isConstant() &&
RHS.getConstant().isPowerOf2()) {
1053 APInt HighBits = ~(
RHS.getConstant() - 1);
1054 Known.
Zero |= HighBits;
1061 std::max(
LHS.countMinLeadingZeros(),
RHS.countMinLeadingZeros());
1068 if (
RHS.isConstant() &&
RHS.getConstant().isPowerOf2()) {
1070 APInt LowBits =
RHS.getConstant() - 1;
1074 Known.
Zero |= ~LowBits;
1079 Known.
One |= ~LowBits;
1088 std::max(
LHS.countMinLeadingOnes(),
RHS.countMinSignBits()));
1089 else if (
LHS.isNonNegative())
1091 std::max(
LHS.countMinLeadingZeros(),
RHS.countMinSignBits()));
1116 Zero = std::move(Z);
static KnownBits avgComputeU(KnownBits LHS, KnownBits RHS, bool IsCeil)
static KnownBits computeForSatAddSub(bool Add, bool Signed, const KnownBits &LHS, const KnownBits &RHS)
static KnownBits divComputeLowBit(KnownBits Known, const KnownBits &LHS, const KnownBits &RHS, bool Exact)
static KnownBits computeForAddCarry(const KnownBits &LHS, const KnownBits &RHS, bool CarryZero, bool CarryOne)
static unsigned getMaxShiftAmount(const APInt &MaxValue, unsigned BitWidth)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Class for arbitrary precision integers.
APInt umul_ov(const APInt &RHS, bool &Overflow) const
APInt udiv(const APInt &RHS) const
Unsigned division operation.
APInt getLoBits(unsigned numBits) const
Compute an APInt containing numBits lowbits from this APInt.
bool isMinSignedValue() const
Determine if this is the smallest signed value.
void setHighBits(unsigned hiBits)
Set the top hiBits bits.
unsigned popcount() const
Count the number of bits set.
void setBitsFrom(unsigned loBit)
Set the top bits starting from loBit.
uint64_t extractBitsAsZExtValue(unsigned numBits, unsigned bitPosition) const
APInt trunc(unsigned width) const
Truncate to new width.
static APInt getMaxValue(unsigned numBits)
Gets maximum unsigned value of APInt for specific bit width.
void setBit(unsigned BitPosition)
Set the given bit to 1 whose position is given as "bitPosition".
bool isAllOnes() const
Determine if all bits are set. This is true for zero-width values.
bool isZero() const
Determine if this value is zero, i.e. all bits are clear.
void setSignBit()
Set the sign bit to 1.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
bool isNegative() const
Determine sign of this APInt.
bool intersects(const APInt &RHS) const
This operation tests if there are any pairs of corresponding bits between this APInt and RHS that are...
APInt sdiv(const APInt &RHS) const
Signed division function for APInt.
void clearAllBits()
Set every bit to 0.
void ashrInPlace(unsigned ShiftAmt)
Arithmetic right-shift this APInt by ShiftAmt in place.
unsigned countl_zero() const
The APInt version of std::countl_zero.
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
unsigned countLeadingZeros() const
unsigned countl_one() const
Count the number of leading one bits.
void clearLowBits(unsigned loBits)
Set bottom loBits bits to 0.
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX) const
If this value is smaller than the specified limit, return it, otherwise return the limit value.
void setAllBits()
Set every bit to 1.
bool getBoolValue() const
Convert APInt to a boolean value.
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
void setBits(unsigned loBit, unsigned hiBit)
Set the bits from loBit (inclusive) to hiBit (exclusive) to 1.
bool isSubsetOf(const APInt &RHS) const
This operation checks that all bits set in this APInt are also set in RHS.
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Constructs an APInt value that has the bottom loBitsSet bits set.
void setLowBits(unsigned loBits)
Set the bottom loBits bits.
void lshrInPlace(unsigned ShiftAmt)
Logical right-shift this APInt by ShiftAmt in place.
void setBitVal(unsigned BitPosition, bool BitValue)
Set a given bit to a given value.
void clearSignBit()
Set the sign bit to 0.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
int countr_one(T Value)
Count the number of ones from the least significant bit to the first zero bit.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
int countl_one(T Value)
Count the number of ones from the most significant bit to the first zero bit.
constexpr unsigned BitWidth
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static KnownBits makeConstant(const APInt &C)
Create known bits from a known constant.
static KnownBits sadd_sat(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from llvm.sadd.sat(LHS, RHS)
static std::optional< bool > eq(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_EQ result.
KnownBits sextInReg(unsigned SrcBitWidth) const
Return known bits for a in-register sign extension of the value we're tracking.
static KnownBits mulhu(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits from zero-extended multiply-hi.
static KnownBits smax(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for smax(LHS, RHS).
bool isNonNegative() const
Returns true if this value is known to be non-negative.
KnownBits blsi() const
Compute known bits for X & -X, which has only the lowest bit set of X set.
void makeNonNegative()
Make this value non-negative.
static KnownBits usub_sat(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from llvm.usub.sat(LHS, RHS)
unsigned countMinTrailingZeros() const
Returns the minimum number of trailing zero bits.
static KnownBits ashr(const KnownBits &LHS, const KnownBits &RHS, bool ShAmtNonZero=false, bool Exact=false)
Compute known bits for ashr(LHS, RHS).
static KnownBits ssub_sat(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from llvm.ssub.sat(LHS, RHS)
static KnownBits urem(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for urem(LHS, RHS).
bool isUnknown() const
Returns true if we don't know any bits.
unsigned countMaxTrailingZeros() const
Returns the maximum number of trailing zero bits possible.
static std::optional< bool > ne(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_NE result.
KnownBits makeGE(const APInt &Val) const
Return KnownBits based on this, but updated given that the underlying value is known to be greater th...
KnownBits blsmsk() const
Compute known bits for X ^ (X - 1), which has all bits up to and including the lowest set bit of X se...
void makeNegative()
Make this value negative.
bool hasConflict() const
Returns true if there is conflicting information.
static std::optional< bool > sge(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_SGE result.
unsigned countMaxPopulation() const
Returns the maximum number of bits that could be one.
void setAllZero()
Make all bits known to be zero and discard any previous information.
KnownBits & operator|=(const KnownBits &RHS)
Update known bits based on ORing with RHS.
void print(raw_ostream &OS) const
unsigned getBitWidth() const
Get the bit width of this value.
static KnownBits umax(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for umax(LHS, RHS).
static KnownBits lshr(const KnownBits &LHS, const KnownBits &RHS, bool ShAmtNonZero=false, bool Exact=false)
Compute known bits for lshr(LHS, RHS).
bool isNonZero() const
Returns true if this value is known to be non-zero.
static KnownBits abdu(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for abdu(LHS, RHS).
KnownBits extractBits(unsigned NumBits, unsigned BitPosition) const
Return a subset of the known bits from [bitPosition,bitPosition+numBits).
static KnownBits avgFloorU(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from APIntOps::avgFloorU.
KnownBits intersectWith(const KnownBits &RHS) const
Returns KnownBits information that is known to be true for both this and RHS.
static KnownBits computeForSubBorrow(const KnownBits &LHS, KnownBits RHS, const KnownBits &Borrow)
Compute known bits results from subtracting RHS from LHS with 1-bit Borrow.
unsigned countMinLeadingZeros() const
Returns the minimum number of leading zero bits.
static KnownBits abds(KnownBits LHS, KnownBits RHS)
Compute known bits for abds(LHS, RHS).
static KnownBits smin(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for smin(LHS, RHS).
KnownBits & operator&=(const KnownBits &RHS)
Update known bits based on ANDing with RHS.
static KnownBits mulhs(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits from sign-extended multiply-hi.
static KnownBits srem(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for srem(LHS, RHS).
static std::optional< bool > ugt(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_UGT result.
static KnownBits udiv(const KnownBits &LHS, const KnownBits &RHS, bool Exact=false)
Compute known bits for udiv(LHS, RHS).
static std::optional< bool > slt(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_SLT result.
static KnownBits computeForAddSub(bool Add, bool NSW, bool NUW, const KnownBits &LHS, const KnownBits &RHS)
Compute known bits resulting from adding LHS and RHS.
static KnownBits sdiv(const KnownBits &LHS, const KnownBits &RHS, bool Exact=false)
Compute known bits for sdiv(LHS, RHS).
static std::optional< bool > ult(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_ULT result.
static KnownBits avgFloorS(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from APIntOps::avgFloorS.
static std::optional< bool > ule(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_ULE result.
bool isNegative() const
Returns true if this value is known to be negative.
static KnownBits computeForAddCarry(const KnownBits &LHS, const KnownBits &RHS, const KnownBits &Carry)
Compute known bits resulting from adding LHS, RHS and a 1-bit Carry.
static KnownBits avgCeilU(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from APIntOps::avgCeilU.
static KnownBits uadd_sat(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from llvm.uadd.sat(LHS, RHS)
static KnownBits mul(const KnownBits &LHS, const KnownBits &RHS, bool NoUndefSelfMultiply=false)
Compute known bits resulting from multiplying LHS and RHS.
KnownBits abs(bool IntMinIsPoison=false) const
Compute known bits for the absolute value.
static std::optional< bool > sle(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_SLE result.
static std::optional< bool > sgt(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_SGT result.
unsigned countMinPopulation() const
Returns the number of bits known to be one.
static std::optional< bool > uge(const KnownBits &LHS, const KnownBits &RHS)
Determine if these known bits always give the same ICMP_UGE result.
KnownBits & operator^=(const KnownBits &RHS)
Update known bits based on XORing with RHS.
static KnownBits shl(const KnownBits &LHS, const KnownBits &RHS, bool NUW=false, bool NSW=false, bool ShAmtNonZero=false)
Compute known bits for shl(LHS, RHS).
static KnownBits umin(const KnownBits &LHS, const KnownBits &RHS)
Compute known bits for umin(LHS, RHS).
static KnownBits avgCeilS(const KnownBits &LHS, const KnownBits &RHS)
Compute knownbits resulting from APIntOps::avgCeilS.