LLVM 22.0.0git
|
#include "llvm/Support/KnownBits.h"
Public Member Functions | |
KnownBits ()=default | |
KnownBits (unsigned BitWidth) | |
Create a known bits object of BitWidth bits initialized to unknown. | |
unsigned | getBitWidth () const |
Get the bit width of this value. | |
bool | hasConflict () const |
Returns true if there is conflicting information. | |
bool | isConstant () const |
Returns true if we know the value of all bits. | |
const APInt & | getConstant () const |
Returns the value when all bits have a known value. | |
bool | isUnknown () const |
Returns true if we don't know any bits. | |
bool | isSignUnknown () const |
Returns true if we don't know the sign bit. | |
void | resetAll () |
Resets the known state of all bits. | |
bool | isZero () const |
Returns true if value is all zero. | |
bool | isAllOnes () const |
Returns true if value is all one bits. | |
void | setAllZero () |
Make all bits known to be zero and discard any previous information. | |
void | setAllOnes () |
Make all bits known to be one and discard any previous information. | |
bool | isNegative () const |
Returns true if this value is known to be negative. | |
bool | isNonNegative () const |
Returns true if this value is known to be non-negative. | |
bool | isNonZero () const |
Returns true if this value is known to be non-zero. | |
bool | isStrictlyPositive () const |
Returns true if this value is known to be positive. | |
void | makeNegative () |
Make this value negative. | |
void | makeNonNegative () |
Make this value non-negative. | |
APInt | getMinValue () const |
Return the minimal unsigned value possible given these KnownBits. | |
APInt | getSignedMinValue () const |
Return the minimal signed value possible given these KnownBits. | |
APInt | getMaxValue () const |
Return the maximal unsigned value possible given these KnownBits. | |
APInt | getSignedMaxValue () const |
Return the maximal signed value possible given these KnownBits. | |
KnownBits | trunc (unsigned BitWidth) const |
Return known bits for a truncation of the value we're tracking. | |
KnownBits | anyext (unsigned BitWidth) const |
Return known bits for an "any" extension of the value we're tracking, where we don't know anything about the extended bits. | |
KnownBits | zext (unsigned BitWidth) const |
Return known bits for a zero extension of the value we're tracking. | |
KnownBits | sext (unsigned BitWidth) const |
Return known bits for a sign extension of the value we're tracking. | |
KnownBits | anyextOrTrunc (unsigned BitWidth) const |
Return known bits for an "any" extension or truncation of the value we're tracking. | |
KnownBits | zextOrTrunc (unsigned BitWidth) const |
Return known bits for a zero extension or truncation of the value we're tracking. | |
KnownBits | sextOrTrunc (unsigned BitWidth) const |
Return known bits for a sign extension or truncation of the value we're tracking. | |
LLVM_ABI KnownBits | sextInReg (unsigned SrcBitWidth) const |
Return known bits for a in-register sign extension of the value we're tracking. | |
void | insertBits (const KnownBits &SubBits, unsigned BitPosition) |
Insert the bits from a smaller known bits starting at bitPosition. | |
KnownBits | extractBits (unsigned NumBits, unsigned BitPosition) const |
Return a subset of the known bits from [bitPosition,bitPosition+numBits). | |
KnownBits | concat (const KnownBits &Lo) const |
Concatenate the bits from Lo onto the bottom of *this. | |
LLVM_ABI KnownBits | makeGE (const APInt &Val) const |
Return KnownBits based on this, but updated given that the underlying value is known to be greater than or equal to Val. | |
unsigned | countMinTrailingZeros () const |
Returns the minimum number of trailing zero bits. | |
unsigned | countMinTrailingOnes () const |
Returns the minimum number of trailing one bits. | |
unsigned | countMinLeadingZeros () const |
Returns the minimum number of leading zero bits. | |
unsigned | countMinLeadingOnes () const |
Returns the minimum number of leading one bits. | |
unsigned | countMinSignBits () const |
Returns the number of times the sign bit is replicated into the other bits. | |
unsigned | countMaxSignificantBits () const |
Returns the maximum number of bits needed to represent all possible signed values with these known bits. | |
unsigned | countMaxTrailingZeros () const |
Returns the maximum number of trailing zero bits possible. | |
unsigned | countMaxTrailingOnes () const |
Returns the maximum number of trailing one bits possible. | |
unsigned | countMaxLeadingZeros () const |
Returns the maximum number of leading zero bits possible. | |
unsigned | countMaxLeadingOnes () const |
Returns the maximum number of leading one bits possible. | |
unsigned | countMinPopulation () const |
Returns the number of bits known to be one. | |
unsigned | countMaxPopulation () const |
Returns the maximum number of bits that could be one. | |
unsigned | countMaxActiveBits () const |
Returns the maximum number of bits needed to represent all possible unsigned values with these known bits. | |
KnownBits | intersectWith (const KnownBits &RHS) const |
Returns KnownBits information that is known to be true for both this and RHS. | |
KnownBits | unionWith (const KnownBits &RHS) const |
Returns KnownBits information that is known to be true for either this or RHS or both. | |
LLVM_ABI KnownBits & | operator&= (const KnownBits &RHS) |
Update known bits based on ANDing with RHS. | |
LLVM_ABI KnownBits & | operator|= (const KnownBits &RHS) |
Update known bits based on ORing with RHS. | |
LLVM_ABI KnownBits & | operator^= (const KnownBits &RHS) |
Update known bits based on XORing with RHS. | |
KnownBits & | operator<<= (unsigned ShAmt) |
Shift known bits left by ShAmt. Shift in bits are unknown. | |
KnownBits & | operator>>= (unsigned ShAmt) |
Shift known bits right by ShAmt. Shifted in bits are unknown. | |
LLVM_ABI KnownBits | abs (bool IntMinIsPoison=false) const |
Compute known bits for the absolute value. | |
KnownBits | byteSwap () const |
KnownBits | reverseBits () const |
LLVM_ABI KnownBits | blsi () const |
Compute known bits for X & -X, which has only the lowest bit set of X set. | |
LLVM_ABI KnownBits | blsmsk () const |
Compute known bits for X ^ (X - 1), which has all bits up to and including the lowest set bit of X set. | |
bool | operator== (const KnownBits &Other) const |
bool | operator!= (const KnownBits &Other) const |
LLVM_ABI void | print (raw_ostream &OS) const |
LLVM_DUMP_METHOD void | dump () const |
Static Public Member Functions | |
static KnownBits | makeConstant (const APInt &C) |
Create known bits from a known constant. | |
static bool | haveNoCommonBitsSet (const KnownBits &LHS, const KnownBits &RHS) |
Return true if LHS and RHS have no common bits set. | |
static LLVM_ABI 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 LLVM_ABI KnownBits | computeForAddSub (bool Add, bool NSW, bool NUW, const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits resulting from adding LHS and RHS. | |
static LLVM_ABI KnownBits | computeForSubBorrow (const KnownBits &LHS, KnownBits RHS, const KnownBits &Borrow) |
Compute known bits results from subtracting RHS from LHS with 1-bit Borrow. | |
static KnownBits | add (const KnownBits &LHS, const KnownBits &RHS, bool NSW=false, bool NUW=false) |
Compute knownbits resulting from addition of LHS and RHS. | |
static KnownBits | sub (const KnownBits &LHS, const KnownBits &RHS, bool NSW=false, bool NUW=false) |
Compute knownbits resulting from subtraction of LHS and RHS. | |
static LLVM_ABI KnownBits | sadd_sat (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from llvm.sadd.sat(LHS, RHS) | |
static LLVM_ABI KnownBits | uadd_sat (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from llvm.uadd.sat(LHS, RHS) | |
static LLVM_ABI KnownBits | ssub_sat (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from llvm.ssub.sat(LHS, RHS) | |
static LLVM_ABI KnownBits | usub_sat (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from llvm.usub.sat(LHS, RHS) | |
static LLVM_ABI KnownBits | avgFloorS (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from APIntOps::avgFloorS. | |
static LLVM_ABI KnownBits | avgFloorU (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from APIntOps::avgFloorU. | |
static LLVM_ABI KnownBits | avgCeilS (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from APIntOps::avgCeilS. | |
static LLVM_ABI KnownBits | avgCeilU (const KnownBits &LHS, const KnownBits &RHS) |
Compute knownbits resulting from APIntOps::avgCeilU. | |
static LLVM_ABI KnownBits | mul (const KnownBits &LHS, const KnownBits &RHS, bool NoUndefSelfMultiply=false) |
Compute known bits resulting from multiplying LHS and RHS. | |
static LLVM_ABI KnownBits | mulhs (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits from sign-extended multiply-hi. | |
static LLVM_ABI KnownBits | mulhu (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits from zero-extended multiply-hi. | |
static LLVM_ABI KnownBits | sdiv (const KnownBits &LHS, const KnownBits &RHS, bool Exact=false) |
Compute known bits for sdiv(LHS, RHS). | |
static LLVM_ABI KnownBits | udiv (const KnownBits &LHS, const KnownBits &RHS, bool Exact=false) |
Compute known bits for udiv(LHS, RHS). | |
static LLVM_ABI KnownBits | urem (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for urem(LHS, RHS). | |
static LLVM_ABI KnownBits | srem (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for srem(LHS, RHS). | |
static LLVM_ABI KnownBits | umax (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for umax(LHS, RHS). | |
static LLVM_ABI KnownBits | umin (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for umin(LHS, RHS). | |
static LLVM_ABI KnownBits | smax (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for smax(LHS, RHS). | |
static LLVM_ABI KnownBits | smin (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for smin(LHS, RHS). | |
static LLVM_ABI KnownBits | abdu (const KnownBits &LHS, const KnownBits &RHS) |
Compute known bits for abdu(LHS, RHS). | |
static LLVM_ABI KnownBits | abds (KnownBits LHS, KnownBits RHS) |
Compute known bits for abds(LHS, RHS). | |
static LLVM_ABI 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 LLVM_ABI KnownBits | lshr (const KnownBits &LHS, const KnownBits &RHS, bool ShAmtNonZero=false, bool Exact=false) |
Compute known bits for lshr(LHS, RHS). | |
static LLVM_ABI KnownBits | ashr (const KnownBits &LHS, const KnownBits &RHS, bool ShAmtNonZero=false, bool Exact=false) |
Compute known bits for ashr(LHS, RHS). | |
static LLVM_ABI std::optional< bool > | eq (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_EQ result. | |
static LLVM_ABI std::optional< bool > | ne (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_NE result. | |
static LLVM_ABI std::optional< bool > | ugt (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_UGT result. | |
static LLVM_ABI std::optional< bool > | uge (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_UGE result. | |
static LLVM_ABI std::optional< bool > | ult (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_ULT result. | |
static LLVM_ABI std::optional< bool > | ule (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_ULE result. | |
static LLVM_ABI std::optional< bool > | sgt (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_SGT result. | |
static LLVM_ABI std::optional< bool > | sge (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_SGE result. | |
static LLVM_ABI std::optional< bool > | slt (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_SLT result. | |
static LLVM_ABI std::optional< bool > | sle (const KnownBits &LHS, const KnownBits &RHS) |
Determine if these known bits always give the same ICMP_SLE result. | |
Public Attributes | |
APInt | Zero |
APInt | One |
Definition at line 24 of file KnownBits.h.
|
default |
Referenced by anyext(), byteSwap(), concat(), extractBits(), intersectWith(), makeConstant(), makeGE(), reverseBits(), sext(), smin(), trunc(), umin(), unionWith(), and zext().
|
inline |
Create a known bits object of BitWidth bits initialized to unknown.
Definition at line 41 of file KnownBits.h.
Compute known bits for abds(LHS, RHS).
Definition at line 247 of file KnownBits.cpp.
References computeForAddSub(), intersectWith(), LHS, and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits().
Compute known bits for abdu(LHS, RHS).
Definition at line 228 of file KnownBits.cpp.
References computeForAddSub(), intersectWith(), LHS, and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits(), and computeKnownBitsForPSADBW().
Compute known bits for the absolute value.
Definition at line 549 of file KnownBits.cpp.
References llvm::APInt::clearSignBit(), computeForAddSub(), countMaxPopulation(), countMaxTrailingZeros(), countMinLeadingZeros(), countMinPopulation(), countMinTrailingZeros(), getBitWidth(), llvm::APInt::isMinSignedValue(), isNegative(), isNonNegative(), llvm::APInt::isZero(), makeConstant(), One, llvm::APInt::popcount(), llvm::APInt::setBit(), llvm::APInt::setBits(), llvm::APInt::setLowBits(), llvm::APInt::setSignBit(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), and isKnownNonZeroFromOperator().
|
inlinestatic |
Compute knownbits resulting from addition of LHS and RHS.
Definition at line 340 of file KnownBits.h.
References computeForAddSub(), LHS, and RHS.
Referenced by binaryOpKnownBitsMapHelper(), computeKnownBitsForPMADDWD(), computeKnownBitsForPSADBW(), llvm::SITargetLowering::computeKnownBitsForTargetInstr(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::SITargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), isNonZeroAdd(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedBits().
Return known bits for an "any" extension of the value we're tracking, where we don't know anything about the extended bits.
Definition at line 160 of file KnownBits.h.
References llvm::BitWidth, KnownBits(), One, Zero, and llvm::APInt::zext().
Referenced by anyextOrTrunc(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromCond(), computeKnownBitsFromICmpCond(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::FunctionLoweringInfo::GetLiveOutRegInfo(), and llvm::TargetLowering::SimplifyDemandedBits().
Return known bits for an "any" extension or truncation of the value we're tracking.
Definition at line 179 of file KnownBits.h.
References anyext(), llvm::BitWidth, getBitWidth(), and trunc().
Referenced by llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::TargetLowering::SimplifyDemandedBits(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
|
static |
Compute known bits for ashr(LHS, RHS).
NOTE: RHS (shift amount) bitwidth doesn't need to be the same as LHS.
Definition at line 427 of file KnownBits.cpp.
References llvm::APInt::ashrInPlace(), llvm::BitWidth, getMaxShiftAmount(), hasConflict(), intersectWith(), isUnknown(), LHS, One, RHS, llvm::APInt::setAllBits(), setAllZero(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPRMT(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
Compute knownbits resulting from APIntOps::avgCeilS.
Definition at line 795 of file KnownBits.cpp.
References avgCeilU(), LHS, and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits().
Compute knownbits resulting from APIntOps::avgCeilU.
Definition at line 799 of file KnownBits.cpp.
References avgComputeU(), LHS, and RHS.
Referenced by avgCeilS(), and llvm::SelectionDAG::computeKnownBits().
Compute knownbits resulting from APIntOps::avgFloorS.
Definition at line 787 of file KnownBits.cpp.
References avgFloorU(), LHS, and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits().
Compute knownbits resulting from APIntOps::avgFloorU.
Definition at line 791 of file KnownBits.cpp.
References avgComputeU(), LHS, and RHS.
Referenced by avgFloorS(), and llvm::SelectionDAG::computeKnownBits().
KnownBits KnownBits::blsi | ( | ) | const |
Compute known bits for X & -X, which has only the lowest bit set of X set.
The name comes from the X86 BMI instruction
Definition at line 1127 of file KnownBits.cpp.
References llvm::BitWidth, countMaxTrailingZeros(), countMinTrailingZeros(), getBitWidth(), One, llvm::APInt::setBit(), llvm::APInt::setBitsFrom(), and Zero.
Referenced by getKnownBitsFromAndXorOr().
KnownBits KnownBits::blsmsk | ( | ) | const |
Compute known bits for X ^ (X - 1), which has all bits up to and including the lowest set bit of X set.
The name comes from the X86 BMI instruction.
Definition at line 1138 of file KnownBits.cpp.
References llvm::BitWidth, countMaxTrailingZeros(), countMinTrailingZeros(), getBitWidth(), One, llvm::APInt::setBitsFrom(), llvm::APInt::setLowBits(), and Zero.
Referenced by getKnownBitsFromAndXorOr().
|
inline |
Definition at line 507 of file KnownBits.h.
References llvm::APInt::byteSwap(), KnownBits(), One, and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::TargetLowering::SimplifyDemandedBits().
|
static |
Compute known bits resulting from adding LHS, RHS and a 1-bit Carry.
Definition at line 53 of file KnownBits.cpp.
References assert(), getBitWidth(), llvm::APInt::getBoolValue(), LHS, One, RHS, and Zero.
Referenced by computeForAddSub(), and llvm::SelectionDAG::computeKnownBits().
|
static |
Compute known bits resulting from adding LHS and RHS.
Definition at line 60 of file KnownBits.cpp.
References llvm::Add, llvm::BitWidth, computeForAddCarry(), llvm::APInt::countl_one(), llvm::APInt::countl_zero(), hasConflict(), llvm::APInt::isNegative(), llvm::APInt::isNonNegative(), LHS, One, RHS, setAllZero(), llvm::APInt::setBits(), llvm::APInt::setHighBits(), llvm::APInt::setSignBit(), std::swap(), llvm::APInt::trunc(), and Zero.
Referenced by abds(), abdu(), abs(), add(), computeForSatAddSub(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), llvm::TargetLowering::SimplifyDemandedBits(), and sub().
|
static |
Compute known bits results from subtracting RHS from LHS with 1-bit Borrow.
Definition at line 146 of file KnownBits.cpp.
References assert(), getBitWidth(), llvm::APInt::getBoolValue(), LHS, One, RHS, std::swap(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits().
Concatenate the bits from Lo
onto the bottom of *this.
This is equivalent to: (this->zext(NewWidth) << Lo.getBitWidth()) | Lo.zext(NewWidth)
Definition at line 226 of file KnownBits.h.
References llvm::APInt::concat(), KnownBits(), llvm::Lo, One, and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPRMT(), and llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Returns the maximum number of bits needed to represent all possible unsigned values with these known bits.
This is the inverse of the minimum number of leading zeros.
Definition at line 289 of file KnownBits.h.
References countMinLeadingZeros(), and getBitWidth().
Referenced by combinePMULH(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), detectExtMul(), foldSwitchToSelect(), getPack(), narrowIndex(), llvm::AMDGPUTargetLowering::numBitsUnsigned(), performSIGN_EXTEND_INREGCombine(), simplifyAndInst(), and simplifyLShrInst().
|
inline |
Returns the maximum number of leading one bits possible.
Definition at line 276 of file KnownBits.h.
References llvm::APInt::countl_zero(), and Zero.
|
inline |
Returns the maximum number of leading zero bits possible.
Definition at line 273 of file KnownBits.h.
References llvm::APInt::countl_zero(), and One.
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and foldCttzCtlz().
|
inline |
Returns the maximum number of bits that could be one.
Definition at line 282 of file KnownBits.h.
References getBitWidth(), llvm::APInt::popcount(), and Zero.
Referenced by abs(), combineMOVMSK(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), foldCtpop(), llvm::InstCombinerImpl::foldICmpWithZero(), llvm::isKnownToBeAPowerOfTwo(), and llvm::TargetLowering::SimplifySetCC().
|
inline |
Returns the maximum number of bits needed to represent all possible signed values with these known bits.
This is the inverse of the minimum number of known sign bits. Examples for bitwidth 5: 110?? --> 4 0000? --> 2
Definition at line 262 of file KnownBits.h.
References countMinSignBits(), and getBitWidth().
Referenced by llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode().
|
inline |
Returns the maximum number of trailing one bits possible.
Definition at line 270 of file KnownBits.h.
References llvm::APInt::countr_zero(), and Zero.
|
inline |
Returns the maximum number of trailing zero bits possible.
Definition at line 267 of file KnownBits.h.
References llvm::APInt::countr_zero(), and One.
Referenced by abs(), blsi(), blsmsk(), llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpWithZero(), getKnownBitsFromAndXorOr(), isNonZeroMul(), and simplifyDiv().
|
inline |
Returns the minimum number of leading one bits.
Definition at line 244 of file KnownBits.h.
References llvm::APInt::countl_one(), and One.
Referenced by computeKnownBitsFromOperator(), countMinSignBits(), getMinUselessShift(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), and llvm::InstCombinerImpl::visitSwitchInst().
|
inline |
Returns the minimum number of leading zero bits.
Definition at line 241 of file KnownBits.h.
References llvm::APInt::countl_one(), and Zero.
Referenced by abs(), llvm::TargetLowering::BuildUDIV(), llvm::CombinerHelper::buildUDivOrURemUsingMul(), checkDot4MulSignedness(), combineMOVMSK(), combineSCALAR_TO_VECTOR(), combineShiftToAVG(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), countMaxActiveBits(), countMinSignBits(), llvm::TargetLowering::expandAVG(), llvm::TargetLowering::expandFixedPointDiv(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldShiftIntoShiftInAnotherHandOfAndInICmp(), llvm::RegsForValue::getCopyFromRegs(), getMinUselessShift(), isKnownExactCastIntToFP(), LowerAndToBT(), LowerCTPOP(), llvm::SITargetLowering::lowerSET_ROUNDING(), lowerShuffleWithVPMOV(), matchBinaryShuffle(), llvm::CombinerHelper::matchCombineZextTrunc(), matchTruncateWithPACK(), llvm::AMDGPUTargetLowering::performShlCombine(), llvm::X86TargetLowering::ReplaceNodeResults(), setShiftFlags(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyDivRem(), llvm::InstCombinerImpl::visitCallInst(), and llvm::InstCombinerImpl::visitSwitchInst().
|
inline |
Returns the number of bits known to be one.
Definition at line 279 of file KnownBits.h.
References One, and llvm::APInt::popcount().
Referenced by abs(), foldCtpop(), foldCtpopPow2Test(), llvm::InstCombinerImpl::foldICmpWithZero(), llvm::isKnownToBeAPowerOfTwo(), and llvm::TargetLowering::SimplifySetCC().
|
inline |
Returns the number of times the sign bit is replicated into the other bits.
Definition at line 248 of file KnownBits.h.
References countMinLeadingOnes(), countMinLeadingZeros(), isNegative(), and isNonNegative().
Referenced by llvm::SelectionDAG::ComputeNumSignBits(), ComputeNumSignBitsImpl(), countMaxSignificantBits(), setShiftFlags(), and llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Returns the minimum number of trailing one bits.
Definition at line 238 of file KnownBits.h.
References llvm::APInt::countr_one(), and One.
Referenced by getKnownBitsFromAndXorOr().
|
inline |
Returns the minimum number of trailing zero bits.
Definition at line 235 of file KnownBits.h.
References llvm::APInt::countr_one(), and Zero.
Referenced by abs(), blsi(), blsmsk(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::TargetLowering::expandFixedPointDiv(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::X86TTIImpl::getIntImmCostInst(), getMinUselessShift(), llvm::getOrEnforceKnownAlignment(), inferAlignment(), llvm::SelectionDAG::InferPtrAlign(), isKnownExactCastIntToFP(), isMultipleOfN(), isWordAligned(), LowerCTPOP(), llvm::X86TargetLowering::ReplaceNodeResults(), setShiftFlags(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), simplifyShift(), llvm::InstCombinerImpl::visitCallInst(), and llvm::InstCombinerImpl::visitSDiv().
LLVM_DUMP_METHOD void KnownBits::dump | ( | ) | const |
Definition at line 1164 of file KnownBits.cpp.
References llvm::dbgs(), and print().
Determine if these known bits always give the same ICMP_EQ result.
Definition at line 487 of file KnownBits.cpp.
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownFPClass(), and ne().
Return a subset of the known bits from [bitPosition,bitPosition+numBits).
Definition at line 218 of file KnownBits.h.
References llvm::APInt::extractBits(), KnownBits(), One, and Zero.
Referenced by checkExtractBits(), llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), knownBitsForSBFE(), mulhs(), mulhu(), and llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode().
|
inline |
Get the bit width of this value.
Definition at line 44 of file KnownBits.h.
References assert(), llvm::APInt::getBitWidth(), One, and Zero.
Referenced by abs(), llvm::adjustKnownBitsForSelectArm(), anyextOrTrunc(), blsi(), blsmsk(), checkExtractBits(), combineFMulcFCMulc(), computeForAddCarry(), computeForSubBorrow(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForLoadV(), computeKnownBitsForPRMT(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::LanaiTargetLowering::computeKnownBitsForTargetNode(), llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCmp(), computeKnownBitsFromCond(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromICmpCond(), computeKnownBitsFromOperator(), llvm::computeKnownBitsFromRangeMetadata(), computeKnownBitsFromShiftOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), computeKnownBitsMul(), countMaxActiveBits(), countMaxPopulation(), countMaxSignificantBits(), eliminateDeadSwitchCases(), foldShiftIntoShiftInAnotherHandOfAndInICmp(), llvm::ConstantRange::fromKnownBits(), getKnownBitsFromAndXorOr(), llvm::FunctionLoweringInfo::GetLiveOutRegInfo(), getMinUselessShift(), llvm::getOrEnforceKnownAlignment(), inferAlignment(), isConstant(), llvm::SelectionDAG::isKnownNeverZero(), isNonZeroShift(), LowerCTPOP(), makeGE(), print(), llvm::HashRecognize::recognizeCRC(), setShiftFlags(), sextInReg(), sextOrTrunc(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), simplifyDivRem(), simplifyShift(), smin(), tryBitfieldInsertOpFromOr(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitSwitchInst(), zext(), and zextOrTrunc().
Returns the value when all bits have a known value.
This just returns One with a protective assertion.
Definition at line 60 of file KnownBits.h.
References assert(), isConstant(), and One.
Referenced by combineFMulcFCMulc(), combineMul(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), LowerCTPOP(), LowerShift(), LowerVectorAllEqual(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::GCNTTIImpl::simplifyDemandedLaneMaskArg(), and tryFoldHelper().
|
inline |
Return the maximal unsigned value possible given these KnownBits.
Definition at line 138 of file KnownBits.h.
Referenced by llvm::SelectionDAG::canCreateUndefOrPoison(), canEvaluateTruncated(), combineArithReduction(), computeKnownBitsFromShiftOperator(), llvm::SelectionDAG::computeOverflowForUnsignedAdd(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), extractBits(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), foldSwitchToSelect(), llvm::ConstantRange::fromKnownBits(), llvm::GISelValueTracking::getValidShiftAmountRange(), llvm::SelectionDAG::getValidShiftAmountRange(), llvm::SelectionDAG::isKnownNeverZero(), isNonZeroShift(), llvm::CombinerHelper::matchCombineTruncOfShift(), llvm::AMDGPUTargetLowering::performTruncateCombine(), setShiftFlags(), simplifyAndInst(), simplifyX86immShift(), simplifyX86varShift(), and llvm::InstCombinerImpl::visitAnd().
|
inline |
Return the minimal unsigned value possible given these KnownBits.
Definition at line 122 of file KnownBits.h.
References One.
Referenced by extractBits(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::ConstantRange::fromKnownBits(), llvm::AMDGPUTargetLowering::performShlCombine(), llvm::AMDGPUTargetLowering::performSraCombine(), llvm::AMDGPUTargetLowering::performSrlCombine(), simplifyShift(), and simplifyX86immShift().
|
inline |
Return the maximal signed value possible given these KnownBits.
Definition at line 144 of file KnownBits.h.
References llvm::APInt::isSignBitClear(), and One.
Referenced by llvm::InstCombinerImpl::foldICmpUsingKnownBits().
|
inline |
Return the minimal signed value possible given these KnownBits.
Definition at line 128 of file KnownBits.h.
References llvm::APInt::isSignBitClear(), One, llvm::APInt::setSignBit(), and Zero.
Referenced by llvm::InstCombinerImpl::foldICmpUsingKnownBits(), and isSafeSignedCMN().
|
inline |
Returns true if there is conflicting information.
Definition at line 51 of file KnownBits.h.
References llvm::APInt::intersects(), One, and Zero.
Referenced by llvm::adjustKnownBitsForSelectArm(), ashr(), computeForAddSub(), computeKnownBits(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromOperator(), divComputeLowBit(), llvm::ConstantRange::fromKnownBits(), lshr(), shl(), and simplifyShift().
|
inlinestatic |
Return true if LHS and RHS have no common bits set.
Definition at line 319 of file KnownBits.h.
Referenced by llvm::haveNoCommonBitsSet(), and llvm::SelectionDAG::haveNoCommonBitsSet().
Insert the bits from a smaller known bits starting at bitPosition.
Definition at line 212 of file KnownBits.h.
References llvm::APInt::insertBits(), One, and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPRMT(), computeKnownBitsFromOperator(), and llvm::GISelValueTracking::computeKnownBitsImpl().
Returns KnownBits information that is known to be true for both this and RHS.
When an operation is known to return one of its operands, this can be used to combine information about the known bits of the operands to get the information that must be true about the result.
Definition at line 304 of file KnownBits.h.
References KnownBits(), One, RHS, and Zero.
Referenced by abds(), abdu(), ashr(), combineSetCC(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsBinOp(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::LanaiTargetLowering::computeKnownBitsForTargetNode(), llvm::SparcTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCond(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), lshr(), shl(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
|
inline |
Returns true if value is all one bits.
Definition at line 83 of file KnownBits.h.
References llvm::APInt::isAllOnes(), and One.
Referenced by isTruncateOf(), matchBinaryShuffle(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
Returns true if we know the value of all bits.
Definition at line 54 of file KnownBits.h.
References getBitWidth(), One, llvm::APInt::popcount(), and Zero.
Referenced by llvm::adjustKnownBitsForSelectArm(), combineFMulcFCMulc(), combineMul(), combineSCALAR_TO_VECTOR(), computeKnownBitsFromOperator(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), getConstant(), LowerCTPOP(), LowerShift(), LowerVectorAllEqual(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::GCNTTIImpl::simplifyDemandedLaneMaskArg(), and tryFoldHelper().
|
inline |
Returns true if this value is known to be negative.
Definition at line 98 of file KnownBits.h.
References llvm::APInt::isSignBitSet(), and One.
Referenced by abs(), computeForSatAddSub(), llvm::SelectionDAG::computeKnownBits(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::GISelValueTracking::computeNumSignBits(), computeOverflowForSignedAdd(), countMinSignBits(), llvm::TargetLowering::expandAddSubSat(), foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::ConstantRange::fromKnownBits(), getKnownSign(), getMinUselessShift(), getSign32(), llvm::SelectionDAG::isKnownNeverZero(), isKnownNonZeroFromOperator(), isNonZeroAdd(), llvm::AMDGPUTargetLowering::performSraCombine(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), simplifyICmpWithBinOpOnLHS(), simplifyICmpWithZero(), and llvm::X86TargetLowering::SimplifyMultipleUseDemandedBitsForTargetNode().
|
inline |
Returns true if this value is known to be non-negative.
Definition at line 101 of file KnownBits.h.
References llvm::APInt::isSignBitSet(), and Zero.
Referenced by abs(), canReplaceGEPIdxWithZero(), computeForSatAddSub(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::GISelValueTracking::computeNumSignBits(), llvm::SelectionDAG::ComputeNumSignBits(), ComputeNumSignBitsImpl(), computeOverflowForSignedAdd(), llvm::computeOverflowForSignedMul(), llvm::SelectionDAG::computeOverflowForSignedMul(), llvm::computeOverflowForUnsignedMul(), countMinSignBits(), llvm::TargetLowering::expandAddSubSat(), foldICmpAndXX(), llvm::ConstantRange::fromKnownBits(), getKnownSign(), getMinUselessShift(), getSign32(), isKnownNonZeroFromOperator(), llvm::isKnownPositive(), isNonZeroAdd(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), simplifyICmpWithBinOpOnLHS(), simplifyICmpWithZero(), llvm::X86TargetLowering::SimplifyMultipleUseDemandedBitsForTargetNode(), llvm::InstCombinerImpl::simplifyRangeCheck(), and llvm::InstCombinerImpl::visitSDiv().
|
inline |
Returns true if this value is known to be non-zero.
Definition at line 104 of file KnownBits.h.
References llvm::APInt::isZero(), and One.
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromShiftOperator(), computeKnownBitsMul(), llvm::SelectionDAG::isKnownNeverZero(), isKnownNonZeroFromOperator(), llvm::isKnownPositive(), isNonZeroAdd(), isNonZeroMul(), srem(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
Returns true if we don't know the sign bit.
Definition at line 69 of file KnownBits.h.
References llvm::APInt::isSignBitSet(), One, and Zero.
Referenced by llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Returns true if this value is known to be positive.
Definition at line 107 of file KnownBits.h.
References llvm::APInt::isSignBitSet(), llvm::APInt::isZero(), One, and Zero.
Referenced by llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::InstCombinerImpl::foldICmpBinOp(), and llvm::SelectionDAG::isKnownNeverZero().
|
inline |
Returns true if we don't know any bits.
Definition at line 66 of file KnownBits.h.
References llvm::APInt::isZero(), One, and Zero.
Referenced by llvm::FunctionLoweringInfo::AddLiveOutRegInfo(), llvm::adjustKnownBitsForSelectArm(), ashr(), checkExtractBits(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), llvm::SITargetLowering::computeKnownBitsForTargetInstr(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::ConstantRange::fromKnownBits(), isKnownNonEqual(), isKnownNonZeroFromOperator(), isNonZeroShift(), lshr(), llvm::CombinerHelper::matchRedundantAnd(), shl(), and llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Returns true if value is all zero.
Definition at line 80 of file KnownBits.h.
References llvm::APInt::isAllOnes(), and Zero.
Referenced by llvm::AMDGPULegalizerInfo::buildMultiply(), combineMOVMSK(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), isZero(), LowerVectorAllEqual(), llvm::SelectionDAG::MaskedVectorIsZero(), matchBinaryShuffle(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), simplifyDivRem(), llvm::TargetLowering::SimplifyMultipleUseDemandedBits(), and simplifyX86immShift().
|
static |
Compute known bits for lshr(LHS, RHS).
NOTE: RHS (shift amount) bitwidth doesn't need to be the same as LHS.
Definition at line 370 of file KnownBits.cpp.
References llvm::BitWidth, getMaxShiftAmount(), hasConflict(), intersectWith(), isUnknown(), LHS, One, RHS, llvm::APInt::setAllBits(), setAllZero(), llvm::APInt::setHighBits(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and extractBits().
Create known bits from a known constant.
Definition at line 294 of file KnownBits.h.
References llvm::CallingConv::C, and KnownBits().
Referenced by abs(), binaryOpKnownBitsMapHelper(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCmp(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), computeKnownBitsMul(), computeKnownFPClass(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), fromOptionalToKnownBits(), knownBitsMapHelper(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), targetOpKnownBitsMapHelper(), and llvm::ConstantRange::toKnownBits().
Return KnownBits based on this, but updated given that the underlying value is known to be greater than or equal to Val.
Definition at line 175 of file KnownBits.cpp.
References llvm::APInt::clearLowBits(), llvm::countl_one(), getBitWidth(), KnownBits(), N, One, and Zero.
|
inline |
Make this value negative.
Definition at line 112 of file KnownBits.h.
References One, and llvm::APInt::setSignBit().
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromCmp(), computeKnownBitsFromOperator(), computeKnownBitsMul(), shl(), and unaryOpKnownBitsMapHelper().
|
inline |
Make this value non-negative.
Definition at line 117 of file KnownBits.h.
References llvm::APInt::setSignBit(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), computeKnownBitsFromCmp(), computeKnownBitsFromOperator(), computeKnownBitsMul(), shl(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), and unaryOpKnownBitsMapHelper().
|
static |
Compute known bits resulting from multiplying LHS and RHS.
Definition at line 803 of file KnownBits.cpp.
References assert(), llvm::BitWidth, llvm::APInt::countl_zero(), llvm::countr_one(), llvm::APInt::getLoBits(), LHS, One, RHS, llvm::APInt::setBit(), llvm::APInt::setHighBits(), llvm::APInt::umul_ov(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPMADDUBSW(), computeKnownBitsForPMADDWD(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), computeKnownBitsMul(), mulhs(), mulhu(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute known bits from sign-extended multiply-hi.
Definition at line 908 of file KnownBits.cpp.
References assert(), llvm::BitWidth, extractBits(), LHS, mul(), and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits(), and computeKnownBitsFromOperator().
Compute known bits from zero-extended multiply-hi.
Definition at line 916 of file KnownBits.cpp.
References assert(), llvm::BitWidth, extractBits(), LHS, mul(), and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits(), and computeKnownBitsFromOperator().
Determine if these known bits always give the same ICMP_NE result.
Definition at line 495 of file KnownBits.cpp.
References eq(), LHS, and RHS.
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), and llvm::SelectionDAG::isKnownNeverZero().
Definition at line 527 of file KnownBits.h.
References llvm::Other.
Update known bits based on ANDing with RHS.
Definition at line 1102 of file KnownBits.cpp.
Shift known bits left by ShAmt. Shift in bits are unknown.
Definition at line 491 of file KnownBits.h.
Definition at line 523 of file KnownBits.h.
References One, llvm::Other, and Zero.
Shift known bits right by ShAmt. Shifted in bits are unknown.
Definition at line 498 of file KnownBits.h.
References llvm::APInt::lshrInPlace(), One, and Zero.
Update known bits based on XORing with RHS.
Definition at line 1118 of file KnownBits.cpp.
Update known bits based on ORing with RHS.
Definition at line 1110 of file KnownBits.cpp.
void KnownBits::print | ( | raw_ostream & | OS | ) | const |
Definition at line 1148 of file KnownBits.cpp.
References llvm::BitWidth, getBitWidth(), I, N, One, OS, and Zero.
Referenced by dump(), and llvm::operator<<().
|
inline |
Resets the known state of all bits.
Definition at line 74 of file KnownBits.h.
References llvm::APInt::clearAllBits(), One, and Zero.
Referenced by computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::TargetLowering::computeKnownBitsForTargetInstr(), llvm::SITargetLowering::computeKnownBitsForTargetInstr(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::SITargetLowering::computeKnownBitsForTargetNode(), llvm::NVPTXTargetLowering::computeKnownBitsForTargetNode(), llvm::PPCTargetLowering::computeKnownBitsForTargetNode(), llvm::SparcTargetLowering::computeKnownBitsForTargetNode(), llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromOperator(), llvm::InstCombinerImpl::SimplifyDemandedBits(), llvm::TargetLowering::SimplifyDemandedBits(), and llvm::NVPTXTargetLowering::SimplifyDemandedBitsForTargetNode().
|
inline |
Definition at line 511 of file KnownBits.h.
References KnownBits(), One, llvm::APInt::reverseBits(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute knownbits resulting from llvm.sadd.sat(LHS, RHS)
Definition at line 764 of file KnownBits.cpp.
References computeForSatAddSub(), LHS, and RHS.
Referenced by computeKnownBitsForPMADDUBSW(), and computeKnownBitsFromOperator().
|
static |
Compute known bits for sdiv(LHS, RHS).
Definition at line 960 of file KnownBits.cpp.
References llvm::BitWidth, llvm::APInt::countLeadingZeros(), divComputeLowBit(), llvm::APInt::getSignedMaxValue(), llvm::APInt::isAllOnes(), llvm::APInt::isMinSignedValue(), llvm::APInt::isZero(), LHS, One, RHS, llvm::APInt::sdiv(), setAllZero(), llvm::APInt::setHighBits(), udiv(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), and computeKnownBitsFromOperator().
|
inline |
Make all bits known to be one and discard any previous information.
Definition at line 92 of file KnownBits.h.
References llvm::APInt::clearAllBits(), One, llvm::APInt::setAllBits(), and Zero.
Referenced by llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCond(), and llvm::computeKnownBitsFromContext().
|
inline |
Make all bits known to be zero and discard any previous information.
Definition at line 86 of file KnownBits.h.
References llvm::APInt::clearAllBits(), One, llvm::APInt::setAllBits(), and Zero.
Referenced by ashr(), computeForAddSub(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCmp(), computeKnownBitsFromCond(), llvm::computeKnownBitsFromContext(), divComputeLowBit(), lshr(), sdiv(), shl(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), and udiv().
Return known bits for a sign extension of the value we're tracking.
Definition at line 173 of file KnownBits.h.
References llvm::BitWidth, KnownBits(), One, llvm::APInt::sext(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPMADDUBSW(), computeKnownBitsForPMADDWD(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), knownBitsForSBFE(), sextOrTrunc(), llvm::TargetLowering::SimplifyDemandedBits(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
Return known bits for a in-register sign extension of the value we're tracking.
Definition at line 158 of file KnownBits.cpp.
References assert(), llvm::BitWidth, getBitWidth(), One, and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), and llvm::GISelValueTracking::computeKnownBitsImpl().
Return known bits for a sign extension or truncation of the value we're tracking.
Definition at line 199 of file KnownBits.h.
References llvm::BitWidth, getBitWidth(), sext(), and trunc().
Determine if these known bits always give the same ICMP_SGE result.
Definition at line 535 of file KnownBits.cpp.
References LHS, RHS, and sgt().
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), llvm::TargetLowering::SimplifyDemandedBits(), and sle().
Determine if these known bits always give the same ICMP_SGT result.
Definition at line 525 of file KnownBits.cpp.
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsMul(), sge(), llvm::TargetLowering::SimplifyDemandedBits(), and slt().
|
static |
Compute known bits for shl(LHS, RHS).
NOTE: RHS (shift amount) bitwidth doesn't need to be the same as LHS.
Definition at line 285 of file KnownBits.cpp.
References llvm::BitWidth, getMaxShiftAmount(), hasConflict(), intersectWith(), llvm::isPowerOf2_32(), isUnknown(), LHS, makeNegative(), makeNonNegative(), One, RHS, llvm::APInt::setAllBits(), setAllZero(), llvm::APInt::setLowBits(), llvm::APInt::setSignBit(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), and simplifyShift().
Determine if these known bits always give the same ICMP_SLE result.
Definition at line 545 of file KnownBits.cpp.
References LHS, RHS, and sge().
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), and llvm::TargetLowering::SimplifyDemandedBits().
Determine if these known bits always give the same ICMP_SLT result.
Definition at line 541 of file KnownBits.cpp.
References LHS, RHS, and sgt().
Referenced by binaryOpKnownBitsMapHelper(), llvm::ICmpInst::compare(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute known bits for smax(LHS, RHS).
Definition at line 211 of file KnownBits.cpp.
References LHS, RHS, and umax().
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute known bits for smin(LHS, RHS).
Definition at line 215 of file KnownBits.cpp.
References getBitWidth(), KnownBits(), LHS, One, RHS, llvm::APInt::setBitVal(), umax(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute known bits for srem(LHS, RHS).
Definition at line 1073 of file KnownBits.cpp.
References llvm::APInt::intersects(), isNonZero(), llvm::APInt::isSubsetOf(), LHS, One, RHS, llvm::APInt::setHighBits(), and Zero.
Referenced by binaryOpKnownBitsMapHelper(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
Compute knownbits resulting from llvm.ssub.sat(LHS, RHS)
Definition at line 767 of file KnownBits.cpp.
References computeForSatAddSub(), LHS, and RHS.
Referenced by computeKnownBitsFromOperator().
|
inlinestatic |
Compute knownbits resulting from subtraction of LHS and RHS.
Definition at line 346 of file KnownBits.h.
References computeForAddSub(), LHS, and RHS.
Referenced by binaryOpKnownBitsMapHelper(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), and llvm::InstCombinerImpl::SimplifyMultipleUseDemandedBits().
Return known bits for a truncation of the value we're tracking.
Definition at line 154 of file KnownBits.h.
References llvm::BitWidth, KnownBits(), One, llvm::APInt::trunc(), and Zero.
Referenced by anyextOrTrunc(), llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), sextOrTrunc(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), and zextOrTrunc().
Compute knownbits resulting from llvm.uadd.sat(LHS, RHS)
Definition at line 770 of file KnownBits.cpp.
References computeForSatAddSub(), LHS, and RHS.
Referenced by computeKnownBitsFromOperator().
|
static |
Compute known bits for udiv(LHS, RHS).
Definition at line 1016 of file KnownBits.cpp.
References llvm::BitWidth, llvm::APInt::countLeadingZeros(), divComputeLowBit(), llvm::APInt::isZero(), LHS, RHS, setAllZero(), llvm::APInt::setHighBits(), llvm::APInt::udiv(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), sdiv(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
Determine if these known bits always give the same ICMP_UGE result.
Definition at line 511 of file KnownBits.cpp.
References LHS, RHS, and ugt().
Referenced by llvm::ICmpInst::compare(), isKnownNonZeroFromOperator(), llvm::TargetLowering::SimplifyDemandedBits(), and ule().
Determine if these known bits always give the same ICMP_UGT result.
Definition at line 501 of file KnownBits.cpp.
Referenced by llvm::ICmpInst::compare(), llvm::TargetLowering::SimplifyDemandedBits(), uge(), and ult().
Determine if these known bits always give the same ICMP_ULE result.
Definition at line 521 of file KnownBits.cpp.
References LHS, RHS, and uge().
Referenced by llvm::ICmpInst::compare(), and llvm::TargetLowering::SimplifyDemandedBits().
Determine if these known bits always give the same ICMP_ULT result.
Definition at line 517 of file KnownBits.cpp.
References LHS, RHS, and ugt().
Referenced by llvm::ICmpInst::compare(), and llvm::TargetLowering::SimplifyDemandedBits().
Compute known bits for umax(LHS, RHS).
Definition at line 187 of file KnownBits.cpp.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::TargetLowering::SimplifyDemandedBits(), smax(), smin(), targetOpKnownBitsMapHelper(), and umin().
Compute known bits for umin(LHS, RHS).
Definition at line 205 of file KnownBits.cpp.
References KnownBits(), LHS, One, RHS, umax(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), and llvm::TargetLowering::SimplifyDemandedBits().
Returns KnownBits information that is known to be true for either this or RHS or both.
This can be used to combine different sources of information about the known bits of a single value, e.g. information about the low bits and the high bits of the result of a multiplication.
Definition at line 314 of file KnownBits.h.
References KnownBits(), One, RHS, and Zero.
Referenced by llvm::adjustKnownBitsForSelectArm(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromCmp(), computeKnownBitsFromCond(), computeKnownBitsFromICmpCond(), computeKnownBitsFromOperator(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), and unionWithMinMaxIntrinsicClamp().
Compute known bits for urem(LHS, RHS).
Definition at line 1056 of file KnownBits.cpp.
References LHS, RHS, llvm::APInt::setHighBits(), and Zero.
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), and computeKnownBitsFromOperator().
Compute knownbits resulting from llvm.usub.sat(LHS, RHS)
Definition at line 773 of file KnownBits.cpp.
References computeForSatAddSub(), LHS, and RHS.
Referenced by llvm::SelectionDAG::computeKnownBits(), and computeKnownBitsFromOperator().
Return known bits for a zero extension of the value we're tracking.
Definition at line 165 of file KnownBits.h.
References llvm::BitWidth, getBitWidth(), KnownBits(), One, llvm::APInt::setBitsFrom(), Zero, and llvm::APInt::zext().
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsForPMADDUBSW(), computeKnownBitsForPSADBW(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCond(), computeKnownBitsFromICmpCond(), llvm::GISelValueTracking::computeKnownBitsImpl(), fromOptionalToKnownBits(), knownBitsForSBFE(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), and zextOrTrunc().
Return known bits for a zero extension or truncation of the value we're tracking.
Definition at line 189 of file KnownBits.h.
References llvm::BitWidth, getBitWidth(), trunc(), and zext().
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().
APInt llvm::KnownBits::One |
Definition at line 26 of file KnownBits.h.
Referenced by abs(), llvm::FunctionLoweringInfo::AddLiveOutRegInfo(), anyext(), ashr(), llvm::ConstantRange::binaryXor(), blsi(), blsmsk(), byteSwap(), llvm::SelectionDAGISel::CheckOrMask(), combineSetCC(), computeForAddCarry(), computeForAddCarry(), computeForAddSub(), computeForSatAddSub(), computeForSubBorrow(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::SITargetLowering::computeKnownBitsForTargetInstr(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCmp(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromOperator(), llvm::computeKnownBitsFromRangeMetadata(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::GISelValueTracking::computeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), concat(), countMaxLeadingZeros(), countMaxTrailingZeros(), countMinLeadingOnes(), countMinPopulation(), countMinTrailingOnes(), llvm::DemandedBits::determineLiveOperandBitsSub(), divComputeLowBit(), dumpResult(), eliminateDeadSwitchCases(), extractBits(), foldCtpopPow2Test(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldICmpWithZero(), getBitWidth(), getConstant(), getKnownBitsFromAndXorOr(), llvm::GISelValueTracking::getKnownOnes(), getMinValue(), getSignedMaxValue(), getSignedMinValue(), hasConflict(), insertBits(), intersectWith(), isAllOnes(), isConstant(), llvm::SelectionDAG::isKnownNeverZero(), isKnownNonEqual(), isKnownNonZeroFromOperator(), llvm::isKnownToBeAPowerOfTwo(), isNegative(), isNonZero(), isNonZeroAdd(), isNonZeroMul(), isNonZeroShift(), isSignUnknown(), isStrictlyPositive(), isUnknown(), lshr(), makeGE(), makeNegative(), matchBinaryShuffle(), llvm::CombinerHelper::matchRedundantAnd(), llvm::CombinerHelper::matchRedundantOr(), mul(), operator&=(), operator<<=(), operator==(), operator>>=(), operator^=(), operator|=(), print(), resetAll(), reverseBits(), sdiv(), setAllOnes(), setAllZero(), sext(), sextInReg(), shl(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::LoongArchTargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::RISCVTargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedBits(), llvm::TargetLowering::SimplifyMultipleUseDemandedBits(), simplifyRightShift(), simplifyShift(), llvm::InstCombinerImpl::simplifyShrShlDemandedBits(), smin(), srem(), llvm::ConstantRange::toKnownBits(), trunc(), umin(), unionWith(), llvm::InstCombinerImpl::visitOr(), and zext().
APInt llvm::KnownBits::Zero |
Definition at line 25 of file KnownBits.h.
Referenced by abs(), llvm::FunctionLoweringInfo::AddLiveOutRegInfo(), adjustForRedundantAnd(), anyext(), ashr(), llvm::ConstantRange::binaryXor(), blsi(), blsmsk(), byteSwap(), combineSetCC(), computeForAddCarry(), computeForAddCarry(), computeForAddSub(), computeForSatAddSub(), computeForSubBorrow(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::GISelValueTracking::computeKnownBitsForAlignment(), llvm::TargetLowering::computeKnownBitsForFrameIndex(), llvm::SITargetLowering::computeKnownBitsForFrameIndex(), computeKnownBitsForLoadV(), llvm::SITargetLowering::computeKnownBitsForTargetInstr(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::RISCVTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::SITargetLowering::computeKnownBitsForTargetNode(), llvm::LanaiTargetLowering::computeKnownBitsForTargetNode(), llvm::PPCTargetLowering::computeKnownBitsForTargetNode(), llvm::SystemZTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromCmp(), llvm::computeKnownBitsFromContext(), computeKnownBitsFromOperator(), llvm::computeKnownBitsFromRangeMetadata(), llvm::GISelValueTracking::computeKnownBitsImpl(), computeKnownFPClass(), llvm::GISelValueTracking::computeNumSignBits(), llvm::SelectionDAG::ComputeNumSignBits(), ComputeNumSignBitsImpl(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), concat(), countMaxLeadingOnes(), countMaxPopulation(), countMaxTrailingOnes(), countMinLeadingZeros(), countMinTrailingZeros(), llvm::DemandedBits::determineLiveOperandBitsSub(), divComputeLowBit(), dumpResult(), eliminateDeadSwitchCases(), extractBits(), llvm::InstCombinerImpl::foldAddWithConstant(), foldCtpop(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), getBitWidth(), getKnownBitsFromAndXorOr(), llvm::GISelValueTracking::getKnownZeroes(), getSignedMinValue(), hasConflict(), insertBits(), intersectWith(), isConstant(), isKnownNonEqual(), llvm::isKnownToBeAPowerOfTwo(), isNonNegative(), isNonZeroShift(), isSignUnknown(), isStrictlyPositive(), isTruncateOf(), isUnknown(), isZero(), knownBitsForWorkitemID(), LowerMUL(), lshr(), makeGE(), makeNonNegative(), llvm::MaskedValueIsZero(), matchBinaryShuffle(), llvm::CombinerHelper::matchRedundantAnd(), llvm::CombinerHelper::matchRedundantOr(), mul(), operator&=(), operator<<=(), operator==(), operator>>=(), operator^=(), operator|=(), performANDCombine(), llvm::ARMTargetLowering::PerformCMOVCombine(), llvm::ARMTargetLowering::PerformCMOVToBFICombine(), performORCombine(), print(), provablyDisjointOr(), resetAll(), reverseBits(), sdiv(), llvm::PPCTargetLowering::SelectAddressRegImm(), llvm::PPCTargetLowering::SelectAddressRegImm34(), llvm::PPCTargetLowering::SelectAddressRegReg(), llvm::LoongArchDAGToDAGISel::selectShiftMask(), llvm::RISCVDAGToDAGISel::selectShiftMask(), setAllOnes(), setAllZero(), sext(), sextInReg(), shl(), llvm::simplifyBinaryIntrinsic(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::LoongArchTargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::RISCVTargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::X86TargetLowering::SimplifyDemandedBitsForTargetNode(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::X86TTIImpl::simplifyDemandedUseBitsIntrinsic(), llvm::TargetLowering::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::SimplifyMultipleUseDemandedBits(), llvm::TargetLowering::SimplifyMultipleUseDemandedBits(), llvm::X86TargetLowering::SimplifyMultipleUseDemandedBitsForTargetNode(), simplifyShift(), llvm::InstCombinerImpl::simplifyShrShlDemandedBits(), simplifySubInst(), smin(), srem(), llvm::ConstantRange::toKnownBits(), trunc(), tryBitfieldInsertOpFromOr(), tryBitfieldInsertOpFromOrAndImm(), llvm::RISCVDAGToDAGISel::tryBitfieldInsertOpFromOrAndImm(), udiv(), umin(), unionWith(), urem(), llvm::InstCombinerImpl::visitSub(), and zext().