struct KnownBits
Declaration
struct KnownBits { /* full declaration omitted */ };
Declared at: llvm/include/llvm/Support/KnownBits.h:22
Member Variables
- public llvm::APInt Zero
- public llvm::APInt One
Method Overview
- public KnownBits(unsigned int BitWidth)
- public KnownBits()
- public static llvm::KnownBits computeForAddCarry(const llvm::KnownBits & LHS, const llvm::KnownBits & RHS, const llvm::KnownBits & Carry)
- public static llvm::KnownBits computeForAddSub(bool Add, bool NSW, const llvm::KnownBits & LHS, llvm::KnownBits RHS)
- public unsigned int countMaxLeadingOnes() const
- public unsigned int countMaxLeadingZeros() const
- public unsigned int countMaxPopulation() const
- public unsigned int countMaxTrailingOnes() const
- public unsigned int countMaxTrailingZeros() const
- public unsigned int countMinLeadingOnes() const
- public unsigned int countMinLeadingZeros() const
- public unsigned int countMinPopulation() const
- public unsigned int countMinSignBits() const
- public unsigned int countMinTrailingOnes() const
- public unsigned int countMinTrailingZeros() const
- public unsigned int getBitWidth() const
- public const llvm::APInt & getConstant() const
- public llvm::APInt getMaxValue() const
- public llvm::APInt getMinValue() const
- public bool hasConflict() const
- public bool isAllOnes() const
- public bool isConstant() const
- public bool isNegative() const
- public bool isNonNegative() const
- public bool isStrictlyPositive() const
- public bool isUnknown() const
- public bool isZero() const
- public void makeNegative()
- public void makeNonNegative()
- public void resetAll()
- public void setAllOnes()
- public void setAllZero()
- public llvm::KnownBits sext(unsigned int BitWidth) const
- public llvm::KnownBits trunc(unsigned int BitWidth) const
- public llvm::KnownBits zext(unsigned int BitWidth, bool ExtendedBitsAreKnownZero) const
- public llvm::KnownBits zextOrTrunc(unsigned int BitWidth, bool ExtendedBitsAreKnownZero) const
Methods
¶KnownBits(unsigned int BitWidth)
KnownBits(unsigned int BitWidth)
Description
Create a known bits object of BitWidth bits initialized to unknown.
Declared at: llvm/include/llvm/Support/KnownBits.h:36
Parameters
- unsigned int BitWidth
¶KnownBits()
KnownBits()
Declared at: llvm/include/llvm/Support/KnownBits.h:33
¶static llvm::KnownBits computeForAddCarry(
const llvm::KnownBits& LHS,
const llvm::KnownBits& RHS,
const llvm::KnownBits& Carry)
static llvm::KnownBits computeForAddCarry(
const llvm::KnownBits& LHS,
const llvm::KnownBits& RHS,
const llvm::KnownBits& Carry)
Description
Compute known bits resulting from adding LHS, RHS and a 1-bit Carry.
Declared at: llvm/include/llvm/Support/KnownBits.h:221
Parameters
- const llvm::KnownBits& LHS
- const llvm::KnownBits& RHS
- const llvm::KnownBits& Carry
¶static llvm::KnownBits computeForAddSub(
bool Add,
bool NSW,
const llvm::KnownBits& LHS,
llvm::KnownBits RHS)
static llvm::KnownBits computeForAddSub(
bool Add,
bool NSW,
const llvm::KnownBits& LHS,
llvm::KnownBits RHS)
Description
Compute known bits resulting from adding LHS and RHS.
Declared at: llvm/include/llvm/Support/KnownBits.h:225
Parameters
- bool Add
- bool NSW
- const llvm::KnownBits& LHS
- llvm::KnownBits RHS
¶unsigned int countMaxLeadingOnes() const
unsigned int countMaxLeadingOnes() const
Description
Returns the maximum number of leading one bits possible.
Declared at: llvm/include/llvm/Support/KnownBits.h:206
¶unsigned int countMaxLeadingZeros() const
unsigned int countMaxLeadingZeros() const
Description
Returns the maximum number of leading zero bits possible.
Declared at: llvm/include/llvm/Support/KnownBits.h:201
¶unsigned int countMaxPopulation() const
unsigned int countMaxPopulation() const
Description
Returns the maximum number of bits that could be one.
Declared at: llvm/include/llvm/Support/KnownBits.h:216
¶unsigned int countMaxTrailingOnes() const
unsigned int countMaxTrailingOnes() const
Description
Returns the maximum number of trailing one bits possible.
Declared at: llvm/include/llvm/Support/KnownBits.h:196
¶unsigned int countMaxTrailingZeros() const
unsigned int countMaxTrailingZeros() const
Description
Returns the maximum number of trailing zero bits possible.
Declared at: llvm/include/llvm/Support/KnownBits.h:191
¶unsigned int countMinLeadingOnes() const
unsigned int countMinLeadingOnes() const
Description
Returns the minimum number of leading one bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:176
¶unsigned int countMinLeadingZeros() const
unsigned int countMinLeadingZeros() const
Description
Returns the minimum number of leading zero bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:171
¶unsigned int countMinPopulation() const
unsigned int countMinPopulation() const
Description
Returns the number of bits known to be one.
Declared at: llvm/include/llvm/Support/KnownBits.h:211
¶unsigned int countMinSignBits() const
unsigned int countMinSignBits() const
Description
Returns the number of times the sign bit is replicated into the other bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:182
¶unsigned int countMinTrailingOnes() const
unsigned int countMinTrailingOnes() const
Description
Returns the minimum number of trailing one bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:166
¶unsigned int countMinTrailingZeros() const
unsigned int countMinTrailingZeros() const
Description
Returns the minimum number of trailing zero bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:161
¶unsigned int getBitWidth() const
unsigned int getBitWidth() const
Description
Get the bit width of this value.
Declared at: llvm/include/llvm/Support/KnownBits.h:39
¶const llvm::APInt& getConstant() const
const llvm::APInt& getConstant() const
Description
Returns the value when all bits have a known value. This just returns One with a protective assertion.
Declared at: llvm/include/llvm/Support/KnownBits.h:56
¶llvm::APInt getMaxValue() const
llvm::APInt getMaxValue() const
Description
Return the maximal value possible given these KnownBits.
Declared at: llvm/include/llvm/Support/KnownBits.h:120
¶llvm::APInt getMinValue() const
llvm::APInt getMinValue() const
Description
Return the minimal value possible given these KnownBits.
Declared at: llvm/include/llvm/Support/KnownBits.h:114
¶bool hasConflict() const
bool hasConflict() const
Description
Returns true if there is conflicting information.
Declared at: llvm/include/llvm/Support/KnownBits.h:46
¶bool isAllOnes() const
bool isAllOnes() const
Description
Returns true if value is all one bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:77
¶bool isConstant() const
bool isConstant() const
Description
Returns true if we know the value of all bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:49
¶bool isNegative() const
bool isNegative() const
Description
Returns true if this value is known to be negative.
Declared at: llvm/include/llvm/Support/KnownBits.h:95
¶bool isNonNegative() const
bool isNonNegative() const
Description
Returns true if this value is known to be non-negative.
Declared at: llvm/include/llvm/Support/KnownBits.h:98
¶bool isStrictlyPositive() const
bool isStrictlyPositive() const
Description
Returns true if this value is known to be positive.
Declared at: llvm/include/llvm/Support/KnownBits.h:101
¶bool isUnknown() const
bool isUnknown() const
Description
Returns true if we don't know any bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:62
¶bool isZero() const
bool isZero() const
Description
Returns true if value is all zero.
Declared at: llvm/include/llvm/Support/KnownBits.h:71
¶void makeNegative()
void makeNegative()
Description
Make this value negative.
Declared at: llvm/include/llvm/Support/KnownBits.h:104
¶void makeNonNegative()
void makeNonNegative()
Description
Make this value non-negative.
Declared at: llvm/include/llvm/Support/KnownBits.h:109
¶void resetAll()
void resetAll()
Description
Resets the known state of all bits.
Declared at: llvm/include/llvm/Support/KnownBits.h:65
¶void setAllOnes()
void setAllOnes()
Description
Make all bits known to be one and discard any previous information.
Declared at: llvm/include/llvm/Support/KnownBits.h:89
¶void setAllZero()
void setAllZero()
Description
Make all bits known to be zero and discard any previous information.
Declared at: llvm/include/llvm/Support/KnownBits.h:83
¶llvm::KnownBits sext(unsigned int BitWidth) const
llvm::KnownBits sext(unsigned int BitWidth) const
Description
Sign extends the underlying known Zero and One bits. This is equivalent to sign extending the value we're tracking.
Declared at: llvm/include/llvm/Support/KnownBits.h:145
Parameters
- unsigned int BitWidth
¶llvm::KnownBits trunc(unsigned int BitWidth) const
llvm::KnownBits trunc(unsigned int BitWidth) const
Description
Truncate the underlying known Zero and One bits. This is equivalent to truncating the value we're tracking.
Declared at: llvm/include/llvm/Support/KnownBits.h:127
Parameters
- unsigned int BitWidth
¶llvm::KnownBits zext(
unsigned int BitWidth,
bool ExtendedBitsAreKnownZero) const
llvm::KnownBits zext(
unsigned int BitWidth,
bool ExtendedBitsAreKnownZero) const
Description
Extends the underlying known Zero and One bits. By setting ExtendedBitsAreKnownZero=true this will be equivalent to zero extending the value we're tracking. With ExtendedBitsAreKnownZero=false the extended bits are set to unknown.
Declared at: llvm/include/llvm/Support/KnownBits.h:135
Parameters
- unsigned int BitWidth
- bool ExtendedBitsAreKnownZero
¶llvm::KnownBits zextOrTrunc(
unsigned int BitWidth,
bool ExtendedBitsAreKnownZero) const
llvm::KnownBits zextOrTrunc(
unsigned int BitWidth,
bool ExtendedBitsAreKnownZero) const
Description
Extends or truncates the underlying known Zero and One bits. When extending the extended bits can either be set as known zero (if ExtendedBitsAreKnownZero=true) or as unknown (if ExtendedBitsAreKnownZero=false).
Declared at: llvm/include/llvm/Support/KnownBits.h:153
Parameters
- unsigned int BitWidth
- bool ExtendedBitsAreKnownZero