15 #ifndef LLVM_SUPPORT_KNOWNBITS_H
16 #define LLVM_SUPPORT_KNOWNBITS_H
30 : Zero(std::move(Zero)), One(std::move(One)) {}
42 "Zero and One should have the same width!");
void clearAllBits()
Set every bit to 0.
unsigned countMinTrailingZeros() const
Returns the minimum number of trailing zero bits.
void setSignBit()
Set the sign bit to 1.
bool isSignBitSet() const
Determine if sign bit of this APInt is set.
unsigned countMaxLeadingZeros() const
Returns the maximum number of leading zero bits possible.
void setAllBits()
Set every bit to 1.
bool isUnknown() const
Returns true if we don't know any bits.
APInt zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
void setAllZero()
Make all bits known to be zero and discard any previous information.
const APInt & getConstant() const
Returns the value when all bits have a known value.
bool isNonNegative() const
Returns true if this value is known to be non-negative.
unsigned countMaxTrailingOnes() const
Returns the maximum number of trailing one bits possible.
KnownBits zext(unsigned BitWidth)
Zero extends the underlying known Zero and One bits.
This file implements a class to represent arbitrary precision integral constant values and operations...
KnownBits zextOrTrunc(unsigned BitWidth)
Zero extends or truncates the underlying known Zero and One bits.
unsigned getBitWidth() const
Get the bit width of this value.
bool isAllOnes() const
Returns true if value is all one bits.
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 trunc(unsigned width) const
Truncate to new width.
bool isNegative() const
Returns true if this value is known to be negative.
unsigned countMinLeadingZeros() const
Returns the minimum number of leading zero bits.
void resetAll()
Resets the known state of all bits.
unsigned countLeadingOnes() const
Count the number of leading one bits.
APInt sext(unsigned width) const
Sign extend to a new width.
bool isConstant() const
Returns true if we know the value of all bits.
bool hasConflict() const
Returns true if there is conflicting information.
KnownBits trunc(unsigned BitWidth)
Truncate the underlying known Zero and One bits.
unsigned getBitWidth() const
Return the number of bits in the APInt.
unsigned countPopulation() const
Count the number of bits set.
unsigned countTrailingZeros() const
Count the number of trailing zero bits.
void makeNonNegative()
Make this value negative.
unsigned countMinLeadingOnes() const
Returns the minimum number of leading one bits.
KnownBits(unsigned BitWidth)
Create a known bits object of BitWidth bits initialized to unknown.
unsigned countMaxLeadingOnes() const
Returns the maximum number of leading one bits possible.
unsigned countMaxPopulation() const
Returns the maximum number of bits that could be one.
Class for arbitrary precision integers.
unsigned countMinPopulation() const
Returns the number of bits known to be one.
bool isAllOnesValue() const
Determine if all bits are set.
unsigned countMinSignBits() const
Returns the number of times the sign bit is replicated into the other bits.
unsigned countTrailingOnes() const
Count the number of trailing one bits.
bool isZero() const
Returns true if value is all zero.
unsigned countMaxTrailingZeros() const
Returns the maximum number of trailing zero bits possible.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void setAllOnes()
Make all bits known to be one and discard any previous information.
unsigned countMinTrailingOnes() const
Returns the minimum number of trailing one bits.
KnownBits sext(unsigned BitWidth)
Sign extends the underlying known Zero and One bits.
unsigned countLeadingZeros() const
The APInt version of the countLeadingZeros functions in MathExtras.h.
APInt zext(unsigned width) const
Zero extend to a new width.
bool isNullValue() const
Determine if all bits are clear.
void makeNegative()
Make this value negative.