24 #include "llvm/Config/llvm-config.h" 52 "ConstantRange with unequal bit widths");
54 "Lower == Upper, but they aren't min or max value!");
94 if (UMax.isMinValue())
100 if (SMax.isMinSignedValue())
110 if (UMin.isMaxValue())
116 if (SMin.isMaxSignedValue())
163 RHS = *OnlyMissingElt;
202 return ConstantRange::getFull(BitWidth);
227 unsigned NoWrapKind) {
232 assert((NoWrapKind == OBO::NoSignedWrap ||
233 NoWrapKind == OBO::NoUnsignedWrap) &&
234 "NoWrapKind invalid!");
236 bool Unsigned = NoWrapKind == OBO::NoUnsignedWrap;
251 SMin.
isNegative() ? SignedMinVal - SMin : SignedMinVal,
255 case Instruction::Sub: {
262 SMax.isStrictlyPositive() ? SignedMinVal + SMax : SignedMinVal,
263 SMin.
isNegative() ? SignedMinVal + SMin : SignedMinVal);
266 case Instruction::Mul:
273 case Instruction::Shl: {
281 return getFull(BitWidth);
298 unsigned NoWrapKind) {
317 return Lower.ugt(Upper);
325 return Lower.sgt(Upper);
335 return (Upper -
Lower).ult(Other.Upper - Other.Lower);
340 assert(MaxSize &&
"MaxSize can't be 0.");
346 return (Upper -
Lower).ugt(MaxSize);
393 return Lower.ule(V) && V.
ult(Upper);
394 return Lower.ule(V) || V.
ult(Upper);
450 "ConstantRange types don't agree!");
460 if (
Lower.ult(CR.Lower)) {
463 if (Upper.
ule(CR.Lower))
468 if (Upper.
ult(CR.Upper))
477 if (Upper.
ult(CR.Upper))
482 if (
Lower.ult(CR.Upper))
491 if (CR.Lower.
ult(Upper)) {
494 if (CR.Upper.
ult(Upper))
522 if (CR.Upper.
ult(Upper)) {
525 if (CR.Lower.
ult(Upper))
556 "ConstantRange types don't agree!");
575 APInt U = (CR.Upper - 1).ugt(Upper - 1) ? CR.Upper : Upper;
591 if (CR.Lower.
ule(Upper) &&
Lower.ule(CR.Upper))
605 if (Upper.
ult(CR.Lower) &&
Lower.ule(CR.Upper))
611 "ConstantRange::unionWith missed a case with one range wrapped");
617 if (CR.Lower.
ule(Upper) ||
Lower.ule(CR.Upper))
621 APInt U = CR.Upper.
ugt(Upper) ? CR.Upper : Upper;
631 case Instruction::Trunc:
633 case Instruction::SExt:
635 case Instruction::ZExt:
637 case Instruction::BitCast:
639 case Instruction::FPToUI:
640 case Instruction::FPToSI:
644 return getFull(ResultBitWidth);
645 case Instruction::UIToFP: {
652 case Instruction::SIToFP: {
659 case Instruction::FPTrunc:
660 case Instruction::FPExt:
661 case Instruction::IntToPtr:
662 case Instruction::PtrToInt:
663 case Instruction::AddrSpaceCast:
665 return getFull(ResultBitWidth);
673 assert(SrcTySize < DstTySize &&
"Not a value extension");
676 APInt LowerExt(DstTySize, 0);
678 LowerExt =
Lower.zext(DstTySize);
690 assert(SrcTySize < DstTySize &&
"Not a value extension");
707 return getEmpty(DstTySize);
709 return getFull(DstTySize);
722 return getFull(DstTySize);
729 if (LowerDiv == UpperDiv)
734 if (LowerDiv.getActiveBits() > DstTySize) {
742 if (UpperDivWidth <= DstTySize)
747 if (UpperDivWidth == DstTySize + 1) {
750 if (UpperDiv.
ult(LowerDiv))
755 return getFull(DstTySize);
760 if (SrcTySize > DstTySize)
762 if (SrcTySize < DstTySize)
769 if (SrcTySize > DstTySize)
771 if (SrcTySize < DstTySize)
783 case Instruction::Sub:
785 case Instruction::Mul:
787 case Instruction::UDiv:
789 case Instruction::SDiv:
791 case Instruction::URem:
793 case Instruction::SRem:
795 case Instruction::Shl:
797 case Instruction::LShr:
799 case Instruction::AShr:
801 case Instruction::And:
803 case Instruction::Or:
807 case Instruction::FAdd:
809 case Instruction::FSub:
811 case Instruction::FMul:
821 unsigned NoWrapKind)
const {
827 case Instruction::Sub:
845 if (NewLower == NewUpper)
874 if (NoWrapKind & OBO::NoSignedWrap)
877 if (NoWrapKind & OBO::NoUnsignedWrap)
892 if (NewLower == NewUpper)
921 if (NoWrapKind & OBO::NoSignedWrap)
924 if (NoWrapKind & OBO::NoUnsignedWrap) {
956 this_max * Other_max + 1);
978 auto L = {this_min * Other_min, this_min * Other_max,
979 this_max * Other_min, this_max * Other_max};
995 return getNonEmpty(std::move(NewL), std::move(NewU));
1006 return getNonEmpty(std::move(NewL), std::move(NewU));
1017 return getNonEmpty(std::move(NewL), std::move(NewU));
1028 return getNonEmpty(std::move(NewL), std::move(NewU));
1049 return getNonEmpty(std::move(Lower), std::move(Upper));
1069 (PosL.Upper - 1).
sdiv(PosR.Lower) + 1);
1086 AdjNegRUpper = RHS.Upper;
1089 AdjNegRUpper = NegR.Upper - 1;
1097 if (NegL.Upper != SignedMin + 1) {
1099 if (Upper == SignedMin + 1)
1101 AdjNegLLower =
Lower;
1104 AdjNegLLower = NegL.Lower + 1;
1108 AdjNegLLower.
sdiv(NegR.Upper - 1) + 1));
1119 NegRes =
ConstantRange((PosL.Upper - 1).sdiv(NegR.Upper - 1),
1120 PosL.Lower.
sdiv(NegR.Lower) + 1);
1126 (NegL.Upper - 1).
sdiv(PosR.Upper - 1) + 1));
1169 if (MaxLHS.ult(MinAbsRHS))
1178 if (MaxLHS.isNegative()) {
1179 if (MinLHS.
ugt(-MinAbsRHS))
1246 return getNonEmpty(std::move(min), std::move(max));
1297 return getNonEmpty(std::move(min), std::move(max));
1306 return getNonEmpty(std::move(NewL), std::move(NewU));
1315 return getNonEmpty(std::move(NewL), std::move(NewU));
1324 return getNonEmpty(std::move(NewL), std::move(NewU));
1333 return getNonEmpty(std::move(NewL), std::move(NewU));
1342 return getNonEmpty(std::move(NewL), std::move(NewU));
1360 auto L = {this_min * Other_min, this_min * Other_max, this_max * Other_min,
1361 this_max * Other_max};
1377 return getNonEmpty(std::move(NewL), std::move(NewU));
1387 APInt NewU = Max.sshl_sat(Max.isNegative() ? ShAmtMin : ShAmtMax) + 1;
1388 return getNonEmpty(std::move(NewL), std::move(NewU));
1422 if (SMax.isNegative())
1439 if (Min.
ugt(~OtherMin))
1441 if (Max.ugt(~OtherMax))
1460 Min.
sgt(SignedMax - OtherMin))
1462 if (Max.isNegative() && OtherMax.isNegative() &&
1463 Max.slt(SignedMin - OtherMax))
1466 if (Max.isNonNegative() && OtherMax.isNonNegative() &&
1467 Max.sgt(SignedMax - OtherMax))
1470 Min.
slt(SignedMin - OtherMin))
1485 if (Max.ult(OtherMin))
1487 if (Min.
ult(OtherMax))
1506 Min.
sgt(SignedMax + OtherMax))
1509 Max.slt(SignedMin + OtherMin))
1512 if (Max.isNonNegative() && OtherMin.
isNegative() &&
1513 Max.sgt(SignedMax + OtherMin))
1515 if (Min.
isNegative() && OtherMax.isNonNegative() &&
1516 Min.
slt(SignedMin + OtherMax))
1531 (void) Min.
umul_ov(OtherMin, Overflow);
1535 (void) Max.umul_ov(OtherMax, Overflow);
1548 OS <<
"[" <<
Lower <<
"," << Upper <<
")";
1551 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 1559 assert(NumRanges >= 1 &&
"Must have at least one range!");
1562 auto *FirstLow = mdconst::extract<ConstantInt>(Ranges.
getOperand(0));
1563 auto *FirstHigh = mdconst::extract<ConstantInt>(Ranges.
getOperand(1));
1565 ConstantRange CR(FirstLow->getValue(), FirstHigh->getValue());
1567 for (
unsigned i = 1; i < NumRanges; ++i) {
1568 auto *Low = mdconst::extract<ConstantInt>(Ranges.
getOperand(2 * i + 0));
1569 auto *
High = mdconst::extract<ConstantInt>(Ranges.
getOperand(2 * i + 1));
1573 CR = CR.unionWith(
ConstantRange(Low->getValue(), High->getValue()));
ConstantRange(uint32_t BitWidth, bool isFullSet)
Initialize a full or empty set for the specified bit width.
void setSignBit()
Set the sign bit to 1.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
APInt getSignedMax() const
Return the largest signed value contained in the ConstantRange.
APInt sext(unsigned width) const
Sign extend to a new width.
APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM)
Return A unsign-divided by B, rounded by the given rounding mode.
bool isUpperSignWrapped() const
Return true if the (exclusive) upper bound wraps around the signed domain.
This class represents lattice values for constants.
const APInt & getUpper() const
Return the upper value for this range.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
Always overflows in the direction of signed/unsigned min value.
APInt sdiv(const APInt &RHS) const
Signed division function for APInt.
ConstantRange subWithNoWrap(const ConstantRange &Other, unsigned NoWrapKind, PreferredRangeType RangeType=Smallest) const
Return a new range representing the possible values resulting from an subtraction with wrap type NoWr...
const APInt * getSingleElement() const
If this set contains a single element, return it, otherwise return null.
bool hasConflict() const
Returns true if there is conflicting information.
APInt zext(unsigned width) const
Zero extend to a new width.
APInt uadd_sat(const APInt &RHS) const
bool slt(const APInt &RHS) const
Signed less than comparison.
APInt udiv(const APInt &RHS) const
Unsigned division operation.
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
bool isSizeLargerThan(uint64_t MaxSize) const
Compare set size of this range with Value.
ConstantRange lshr(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a logical right shift of a value i...
bool isUpperWrapped() const
Return true if the exclusive upper bound wraps around the unsigned domain.
OverflowResult unsignedAddMayOverflow(const ConstantRange &Other) const
Return whether unsigned add of the two ranges always/never overflows.
ConstantRange truncate(uint32_t BitWidth) const
Return a new range in the specified integer type, which must be strictly smaller than the current typ...
bool sgt(const APInt &RHS) const
Signed greater than comparison.
ConstantRange sub(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a subtraction of a value in this r...
APInt trunc(unsigned width) const
Truncate to new width.
void setAllBits()
Set every bit to 1.
ConstantRange ashr(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a arithmetic right shift of a valu...
ConstantRange udiv(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an unsigned division of a value in...
const MDOperand & getOperand(unsigned I) const
OverflowResult signedAddMayOverflow(const ConstantRange &Other) const
Return whether signed add of the two ranges always/never overflows.
ConstantRange ushl_sat(const ConstantRange &Other) const
Perform an unsigned saturating left shift of this constant range by a value in Other.
static ConstantRange makeExactMulNSWRegion(const APInt &V)
Exact mul nsw region for single element RHS.
static ConstantRange fromKnownBits(const KnownBits &Known, bool IsSigned)
Initialize a range based on a known bits constraint.
static ConstantRange makeAllowedICmpRegion(CmpInst::Predicate Pred, const ConstantRange &Other)
Produce the smallest range such that all values that may satisfy the given predicate with any value c...
APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM)
Return A sign-divided by B, rounded by the given rounding mode.
void print(raw_ostream &OS) const
Print out the bounds to a stream.
unsigned getBitWidth() const
Get the bit width of this value.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
unsigned getBitWidth() const
Return the number of bits in the APInt.
bool isWrappedSet() const
Return true if this set wraps around the unsigned domain.
ConstantRange umax(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an unsigned maximum of a value in ...
uint32_t getBitWidth() const
Get the bit width of this ConstantRange.
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
bool isNonNegative() const
Determine if this APInt Value is non-negative (>= 0)
APInt zextOrSelf(unsigned width) const
Zero extend or truncate to width.
ConstantRange difference(const ConstantRange &CR) const
Subtract the specified range from this range (aka relative complement of the sets).
ConstantRange zextOrTrunc(uint32_t BitWidth) const
Make this range have the bit width given by BitWidth.
bool contains(const APInt &Val) const
Return true if the specified value is in the set.
This file implements a class to represent arbitrary precision integral constant values and operations...
const APInt & smax(const APInt &A, const APInt &B)
Determine the larger of two APInts considered to be signed.
unsigned getActiveBits() const
Compute the number of active bits in the value.
const APInt & smin(const APInt &A, const APInt &B)
Determine the smaller of two APInts considered to be signed.
static ConstantRange getNonEmpty(APInt Lower, APInt Upper)
Create non-empty constant range with the given bounds.
int getMaxValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return the maximum value of an extendable operand.
OverflowResult unsignedMulMayOverflow(const ConstantRange &Other) const
Return whether unsigned mul of the two ranges always/never overflows.
ConstantRange intersectWith(const ConstantRange &CR, PreferredRangeType Type=Smallest) const
Return the range that results from the intersection of this range with another range.
void clearBit(unsigned BitPosition)
Set a given bit to 0.
static APInt getBitsSetFrom(unsigned numBits, unsigned loBit)
Get a value with upper bits starting at loBit set.
OverflowResult
Represents whether an operation on the given constant range is known to always or never overflow...
bool isAllNegative() const
Return true if all values in this range are negative.
void dump() const
Allow printing from a debugger easily.
APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
ConstantRange castOp(Instruction::CastOps CastOp, uint32_t BitWidth) const
Return a new range representing the possible values resulting from an application of the specified ca...
The operation itself must be expressed in terms of simpler actions on this target.
bool getEquivalentICmp(CmpInst::Predicate &Pred, APInt &RHS) const
Set up Pred and RHS such that ConstantRange::makeExactICmpRegion(Pred, RHS) == *this.
static ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred, const ConstantRange &Other)
Produce the largest range such that all values in the returned range satisfy the given predicate with...
bool isNegative() const
Returns true if this value is known to be negative.
bool isSizeStrictlySmallerThan(const ConstantRange &CR) const
Compare set size of this range with the range CR.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
ConstantRange usub_sat(const ConstantRange &Other) const
Perform an unsigned saturating subtraction of two constant ranges.
bool isNegative() const
Determine sign of this APInt.
bool isAllNonNegative() const
Return true if all values in this range are non-negative.
bool isAllOnesValue() const
Determine if all bits are set.
int getMinValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return the minimum value of an extendable operand.
APInt ushl_sat(const APInt &RHS) const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool isStrictlyPositive() const
Determine if this APInt Value is positive.
ConstantRange getConstantRangeFromMetadata(const MDNode &RangeMD)
Parse out a conservative ConstantRange from !range metadata.
The instances of the Type class are immutable: once they are created, they are never changed...
ConstantRange umin(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an unsigned minimum of a value in ...
bool ult(const APInt &RHS) const
Unsigned less than comparison.
ConstantRange sadd_sat(const ConstantRange &Other) const
Perform a signed saturating addition of two constant ranges.
bool isSignWrappedSet() const
Return true if this set wraps around the signed domain.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
APInt sshl_sat(const APInt &RHS) const
APInt getMinValue() const
Return the minimal value possible given these KnownBits.
bool isOneValue() const
Determine if this is a value of 1.
static APInt getOneBitSet(unsigned numBits, unsigned BitNo)
Return an APInt with exactly one bit set in the result.
APInt getUnsignedMax() const
Return the largest unsigned value contained in the ConstantRange.
ConstantRange addWithNoWrap(const ConstantRange &Other, unsigned NoWrapKind, PreferredRangeType RangeType=Smallest) const
Return a new range representing the possible values resulting from an addition with wrap type NoWrapK...
bool isMinSignedValue() const
Determine if this is the smallest signed value.
Always overflows in the direction of signed/unsigned max value.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Utility class for integer operators which may exhibit overflow - Add, Sub, Mul, and Shl...
ConstantRange add(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an addition of a value in this ran...
bool isFullSet() const
Return true if this set contains all of the elements possible for this data-type. ...
void clearSignBit()
Set the sign bit to 0.
ConstantRange sdiv(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a signed division of a value in th...
static ConstantRange makeExactMulNUWRegion(const APInt &V)
Exact mul nuw region for single element RHS.
OverflowResult signedSubMayOverflow(const ConstantRange &Other) const
Return whether signed sub of the two ranges always/never overflows.
ConstantRange overflowingBinaryOp(Instruction::BinaryOps BinOp, const ConstantRange &Other, unsigned NoWrapKind) const
Return a new range representing the possible values resulting from an application of the specified ov...
APInt getSignedMin() const
Return the smallest signed value contained in the ConstantRange.
APInt ssub_sat(const APInt &RHS) const
OverflowResult unsignedSubMayOverflow(const ConstantRange &Other) const
Return whether unsigned sub of the two ranges always/never overflows.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
ConstantRange subtract(const APInt &CI) const
Subtract the specified constant from the endpoints of this constant range.
const APInt & umin(const APInt &A, const APInt &B)
Determine the smaller of two APInts considered to be signed.
bool isEmptySet() const
Return true if this set contains no members.
APInt ashr(unsigned ShiftAmt) const
Arithmetic right-shift function.
static ConstantRange makeExactICmpRegion(CmpInst::Predicate Pred, const APInt &Other)
Produce the exact range such that all values in the returned range satisfy the given predicate with a...
Align max(MaybeAlign Lhs, Align Rhs)
ConstantRange smul_sat(const ConstantRange &Other) const
Perform a signed saturating multiplication of two constant ranges.
This class represents a range of values.
ConstantRange uadd_sat(const ConstantRange &Other) const
Perform an unsigned saturating addition of two constant ranges.
ConstantRange smin(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a signed minimum of a value in thi...
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
bool uge(const APInt &RHS) const
Unsigned greater or equal comparison.
ConstantRange binaryOr(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a binary-or of a value in this ran...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
unsigned countTrailingOnes() const
Count the number of trailing one bits.
Class for arbitrary precision integers.
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
APInt umul_sat(const APInt &RHS) const
const APInt & umax(const APInt &A, const APInt &B)
Determine the larger of two APInts considered to be unsigned.
static APInt getMaxValue(unsigned numBits)
Gets maximum unsigned value of APInt for specific bit width.
const APInt * getSingleMissingElement() const
If this set contains all but a single element, return it, otherwise return null.
ConstantRange smax(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a signed maximum of a value in thi...
bool isUnknown() const
Returns true if we don't know any bits.
ConstantRange zeroExtend(uint32_t BitWidth) const
Return a new range in the specified integer type, which must be strictly larger than the current type...
ConstantRange sshl_sat(const ConstantRange &Other) const
Perform a signed saturating left shift of this constant range by a value in Other.
bool ugt(const APInt &RHS) const
Unsigned greater than comparison.
ConstantRange umul_sat(const ConstantRange &Other) const
Perform an unsigned saturating multiplication of two constant ranges.
ConstantRange ssub_sat(const ConstantRange &Other) const
Perform a signed saturating subtraction of two constant ranges.
unsigned greater or equal
ConstantRange abs() const
Calculate absolute value range.
const APInt & getLower() const
Return the lower value for this range.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
ConstantRange unionWith(const ConstantRange &CR, PreferredRangeType Type=Smallest) const
Return the range that results from the union of this range with another range.
APInt umul_ov(const APInt &RHS, bool &Overflow) const
bool isSingleElement() const
Return true if this set contains exactly one member.
ConstantRange sextOrTrunc(uint32_t BitWidth) const
Make this range have the bit width given by BitWidth.
static ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, const ConstantRange &Other, unsigned NoWrapKind)
Produce the largest range containing all X such that "X BinOp Y" is guaranteed not to wrap (overflow)...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
static ConstantRange makeExactNoWrapRegion(Instruction::BinaryOps BinOp, const APInt &Other, unsigned NoWrapKind)
Produce the range that contains X if and only if "X BinOp Other" does not wrap.
ConstantRange srem(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a signed remainder operation of a ...
PreferredRangeType
If represented precisely, the result of some range operations may consist of multiple disjoint ranges...
ConstantRange multiply(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a multiplication of a value in thi...
ConstantRange signExtend(uint32_t BitWidth) const
Return a new range in the specified integer type, which must be strictly larger than the current type...
ConstantRange urem(const ConstantRange &Other) const
Return a new range representing the possible values resulting from an unsigned remainder operation of...
This class implements an extremely fast bulk output stream that can only output to a stream...
APInt usub_sat(const APInt &RHS) const
bool isNonNegative() const
Returns true if this value is known to be non-negative.
APInt getMaxValue() const
Return the maximal value possible given these KnownBits.
unsigned countLeadingZeros() const
The APInt version of the countLeadingZeros functions in MathExtras.h.
ConstantRange shl(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a left shift of a value in this ra...
static APInt getNullValue(unsigned numBits)
Get the '0' value.
APInt sadd_sat(const APInt &RHS) const
unsigned getNumOperands() const
Return number of MDNode operands.
ConstantRange inverse() const
Return a new range that is the logical not of the current set.
ConstantRange binaryOp(Instruction::BinaryOps BinOp, const ConstantRange &Other) const
Return a new range representing the possible values resulting from an application of the specified bi...
static ConstantRange getPreferredRange(const ConstantRange &CR1, const ConstantRange &CR2, ConstantRange::PreferredRangeType Type)
APInt sextOrSelf(unsigned width) const
Sign extend or truncate to width.
bool isNullValue() const
Determine if all bits are clear.
ConstantRange binaryAnd(const ConstantRange &Other) const
Return a new range representing the possible values resulting from a binary-and of a value in this ra...