class ConstantRange
Declaration
class ConstantRange { /* full declaration omitted */ };
Description
This class represents a range of values.
Declared at: llvm/include/llvm/IR/ConstantRange.h:47
Method Overview
- public ConstantRange(llvm::APInt Value)
- public ConstantRange(llvm::APInt Lower, llvm::APInt Upper)
- public ConstantRange(uint32_t BitWidth, bool isFullSet)
- public llvm::ConstantRange abs() const
- public llvm::ConstantRange add(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange addWithNoWrap(const llvm::ConstantRange & Other, unsigned int NoWrapKind, llvm::ConstantRange::PreferredRangeType RangeType = Smallest) const
- public llvm::ConstantRange ashr(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryAnd(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryOp(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other) const
- public llvm::ConstantRange binaryOr(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange castOp(Instruction::CastOps CastOp, uint32_t BitWidth) const
- public bool contains(const llvm::ConstantRange & CR) const
- public bool contains(const llvm::APInt & Val) const
- public llvm::ConstantRange difference(const llvm::ConstantRange & CR) const
- public void dump() const
- public static llvm::ConstantRange fromKnownBits(const llvm::KnownBits & Known, bool IsSigned)
- public uint32_t getBitWidth() const
- public static llvm::ConstantRange getEmpty(uint32_t BitWidth)
- public bool getEquivalentICmp(CmpInst::Predicate & Pred, llvm::APInt & RHS) const
- public static llvm::ConstantRange getFull(uint32_t BitWidth)
- public const llvm::APInt & getLower() const
- public static llvm::ConstantRange getNonEmpty(llvm::APInt Lower, llvm::APInt Upper)
- public llvm::APInt getSignedMax() const
- public llvm::APInt getSignedMin() const
- public const llvm::APInt * getSingleElement() const
- public const llvm::APInt * getSingleMissingElement() const
- public llvm::APInt getUnsignedMax() const
- public llvm::APInt getUnsignedMin() const
- public const llvm::APInt & getUpper() const
- public llvm::ConstantRange intersectWith(const llvm::ConstantRange & CR, llvm::ConstantRange::PreferredRangeType Type = Smallest) const
- public llvm::ConstantRange inverse() const
- public bool isAllNegative() const
- public bool isAllNonNegative() const
- public bool isEmptySet() const
- public bool isFullSet() const
- public bool isSignWrappedSet() const
- public bool isSingleElement() const
- public bool isSizeLargerThan(uint64_t MaxSize) const
- public bool isSizeStrictlySmallerThan(const llvm::ConstantRange & CR) const
- public bool isUpperSignWrapped() const
- public bool isUpperWrapped() const
- public bool isWrappedSet() const
- public llvm::ConstantRange lshr(const llvm::ConstantRange & Other) const
- public static llvm::ConstantRange makeAllowedICmpRegion(CmpInst::Predicate Pred, const llvm::ConstantRange & Other)
- public static llvm::ConstantRange makeExactICmpRegion(CmpInst::Predicate Pred, const llvm::APInt & Other)
- public static llvm::ConstantRange makeExactNoWrapRegion(Instruction::BinaryOps BinOp, const llvm::APInt & Other, unsigned int NoWrapKind)
- public static llvm::ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other, unsigned int NoWrapKind)
- public static llvm::ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred, const llvm::ConstantRange & Other)
- public llvm::ConstantRange multiply(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange overflowingBinaryOp(Instruction::BinaryOps BinOp, const llvm::ConstantRange & Other, unsigned int NoWrapKind) const
- public void print(llvm::raw_ostream & OS) const
- public llvm::ConstantRange sadd_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sdiv(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sextOrTrunc(uint32_t BitWidth) const
- public llvm::ConstantRange shl(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange signExtend(uint32_t BitWidth) const
- public llvm::ConstantRange::OverflowResult signedAddMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult signedSubMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smax(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smin(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange smul_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange srem(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sshl_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange ssub_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange sub(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange subWithNoWrap(const llvm::ConstantRange & Other, unsigned int NoWrapKind, llvm::ConstantRange::PreferredRangeType RangeType = Smallest) const
- public llvm::ConstantRange subtract(const llvm::APInt & CI) const
- public llvm::ConstantRange truncate(uint32_t BitWidth) const
- public llvm::ConstantRange uadd_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange udiv(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umax(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umin(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange umul_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange unionWith(const llvm::ConstantRange & CR, llvm::ConstantRange::PreferredRangeType Type = Smallest) const
- public llvm::ConstantRange::OverflowResult unsignedAddMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult unsignedMulMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange::OverflowResult unsignedSubMayOverflow(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange urem(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange ushl_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange usub_sat(const llvm::ConstantRange & Other) const
- public llvm::ConstantRange zeroExtend(uint32_t BitWidth) const
- public llvm::ConstantRange zextOrTrunc(uint32_t BitWidth) const
Methods
¶ConstantRange(llvm::APInt Value)
ConstantRange(llvm::APInt Value)
Description
Initialize a range to hold the single specified value.
Declared at: llvm/include/llvm/IR/ConstantRange.h:65
Parameters
- llvm::APInt Value
¶ConstantRange(llvm::APInt Lower,
llvm::APInt Upper)
ConstantRange(llvm::APInt Lower,
llvm::APInt Upper)
Description
Initialize a range of values explicitly. This will assert out if Lower==Upper and Lower != Min or Max value for its type. It will also assert out if the two APInt's are not the same bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:70
Parameters
- llvm::APInt Lower
- llvm::APInt Upper
¶ConstantRange(uint32_t BitWidth, bool isFullSet)
ConstantRange(uint32_t BitWidth, bool isFullSet)
Description
Initialize a full or empty set for the specified bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:62
Parameters
- uint32_t BitWidth
- bool isFullSet
¶llvm::ConstantRange abs() const
llvm::ConstantRange abs() const
Description
Calculate absolute value range. If the original range contains signed min, then the resulting range will also contain signed min.
Declared at: llvm/include/llvm/IR/ConstantRange.h:456
¶llvm::ConstantRange add(
const llvm::ConstantRange& Other) const
llvm::ConstantRange add(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an addition of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:339
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange addWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
llvm::ConstantRange addWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
Description
Return a new range representing the possible values resulting from an addition with wrap type \p NoWrapKind of a value in this range and a value in \p Other. If the result range is disjoint, the preferred range is determined by the\p PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:346
Parameters
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
- llvm::ConstantRange::PreferredRangeType RangeType = Smallest
¶llvm::ConstantRange ashr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ashr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a arithmetic right shift of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:423
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryAnd(
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryAnd(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a binary-and of a value in this range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:406
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an application of the specified binary operator to an left hand side of this range and a right hand side of \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:326
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
¶llvm::ConstantRange binaryOr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange binaryOr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a binary-or of a value in this range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:410
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange castOp(
Instruction::CastOps CastOp,
uint32_t BitWidth) const
llvm::ConstantRange castOp(
Instruction::CastOps CastOp,
uint32_t BitWidth) const
Description
Return a new range representing the possible values resulting from an application of the specified cast operator to this range. \p BitWidth is the target bitwidth of the cast. For casts which don't change bitwidth, it must be the same as the source bitwidth. For casts which do change bitwidth, the bitwidth must be consistent with the requested cast and source bitwidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:294
Parameters
- Instruction::CastOps CastOp
- uint32_t BitWidth
¶bool contains(const llvm::ConstantRange& CR) const
bool contains(const llvm::ConstantRange& CR) const
Description
Return true if the other range is a subset of this one.
Declared at: llvm/include/llvm/IR/ConstantRange.h:204
Parameters
- const llvm::ConstantRange& CR
¶bool contains(const llvm::APInt& Val) const
bool contains(const llvm::APInt& Val) const
Description
Return true if the specified value is in the set.
Declared at: llvm/include/llvm/IR/ConstantRange.h:201
Parameters
- const llvm::APInt& Val
¶llvm::ConstantRange difference(
const llvm::ConstantRange& CR) const
llvm::ConstantRange difference(
const llvm::ConstantRange& CR) const
Description
Subtract the specified range from this range (aka relative complement of the sets).
Declared at: llvm/include/llvm/IR/ConstantRange.h:261
Parameters
- const llvm::ConstantRange& CR
¶void dump() const
void dump() const
Description
Allow printing from a debugger easily.
Declared at: llvm/include/llvm/IR/ConstantRange.h:490
¶static llvm::ConstantRange fromKnownBits(
const llvm::KnownBits& Known,
bool IsSigned)
static llvm::ConstantRange fromKnownBits(
const llvm::KnownBits& Known,
bool IsSigned)
Description
Initialize a range based on a known bits constraint. The IsSigned flag indicates whether the constant range should not wrap in the signed or unsigned domain.
Declared at: llvm/include/llvm/IR/ConstantRange.h:93
Parameters
- const llvm::KnownBits& Known
- bool IsSigned
¶uint32_t getBitWidth() const
uint32_t getBitWidth() const
Description
Get the bit width of this ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:165
¶static llvm::ConstantRange getEmpty(
uint32_t BitWidth)
static llvm::ConstantRange getEmpty(
uint32_t BitWidth)
Description
Create empty constant range with the given bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:73
Parameters
- uint32_t BitWidth
¶bool getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS) const
bool getEquivalentICmp(CmpInst::Predicate& Pred,
llvm::APInt& RHS) const
Description
Set up \p Pred and \p RHS such that ConstantRange::makeExactICmpRegion(Pred, RHS) == *this. Return true if successful.
Declared at: llvm/include/llvm/IR/ConstantRange.h:156
Parameters
- CmpInst::Predicate& Pred
- llvm::APInt& RHS
¶static llvm::ConstantRange getFull(
uint32_t BitWidth)
static llvm::ConstantRange getFull(
uint32_t BitWidth)
Description
Create full constant range with the given bit width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:78
Parameters
- uint32_t BitWidth
¶const llvm::APInt& getLower() const
const llvm::APInt& getLower() const
Description
Return the lower value for this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:159
¶static llvm::ConstantRange getNonEmpty(
llvm::APInt Lower,
llvm::APInt Upper)
static llvm::ConstantRange getNonEmpty(
llvm::APInt Lower,
llvm::APInt Upper)
Description
Create non-empty constant range with the given bounds. If Lower and Upper are the same, a full range is returned.
Declared at: llvm/include/llvm/IR/ConstantRange.h:84
Parameters
- llvm::APInt Lower
- llvm::APInt Upper
¶llvm::APInt getSignedMax() const
llvm::APInt getSignedMax() const
Description
Return the largest signed value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:243
¶llvm::APInt getSignedMin() const
llvm::APInt getSignedMin() const
Description
Return the smallest signed value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:246
¶const llvm::APInt* getSingleElement() const
const llvm::APInt* getSingleElement() const
Description
If this set contains a single element, return it, otherwise return null.
Declared at: llvm/include/llvm/IR/ConstantRange.h:207
¶const llvm::APInt* getSingleMissingElement() const
const llvm::APInt* getSingleMissingElement() const
Description
If this set contains all but a single element, return it, otherwise return null.
Declared at: llvm/include/llvm/IR/ConstantRange.h:215
¶llvm::APInt getUnsignedMax() const
llvm::APInt getUnsignedMax() const
Description
Return the largest unsigned value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:237
¶llvm::APInt getUnsignedMin() const
llvm::APInt getUnsignedMin() const
Description
Return the smallest unsigned value contained in the ConstantRange.
Declared at: llvm/include/llvm/IR/ConstantRange.h:240
¶const llvm::APInt& getUpper() const
const llvm::APInt& getUpper() const
Description
Return the upper value for this range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:162
¶llvm::ConstantRange intersectWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
llvm::ConstantRange intersectWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
Description
Return the range that results from the intersection of this range with another range. If the intersection is disjoint, such that two results are possible, the preferred range is determined by the PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:277
Parameters
- const llvm::ConstantRange& CR
- llvm::ConstantRange::PreferredRangeType Type = Smallest
¶llvm::ConstantRange inverse() const
llvm::ConstantRange inverse() const
Description
Return a new range that is the logical not of the current set.
Declared at: llvm/include/llvm/IR/ConstantRange.h:452
¶bool isAllNegative() const
bool isAllNegative() const
Description
Return true if all values in this range are negative.
Declared at: llvm/include/llvm/IR/ConstantRange.h:231
¶bool isAllNonNegative() const
bool isAllNonNegative() const
Description
Return true if all values in this range are non-negative.
Declared at: llvm/include/llvm/IR/ConstantRange.h:234
¶bool isEmptySet() const
bool isEmptySet() const
Description
Return true if this set contains no members.
Declared at: llvm/include/llvm/IR/ConstantRange.h:172
¶bool isFullSet() const
bool isFullSet() const
Description
Return true if this set contains all of the elements possible for this data-type.
Declared at: llvm/include/llvm/IR/ConstantRange.h:169
¶bool isSignWrappedSet() const
bool isSignWrappedSet() const
Description
Return true if this set wraps around the signed domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, SignedMin) == [X, SignedMax]: Not wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:191
¶bool isSingleElement() const
bool isSingleElement() const
Description
Return true if this set contains exactly one member.
Declared at: llvm/include/llvm/IR/ConstantRange.h:222
¶bool isSizeLargerThan(uint64_t MaxSize) const
bool isSizeLargerThan(uint64_t MaxSize) const
Description
Compare set size of this range with Value.
Declared at: llvm/include/llvm/IR/ConstantRange.h:228
Parameters
- uint64_t MaxSize
¶bool isSizeStrictlySmallerThan(
const llvm::ConstantRange& CR) const
bool isSizeStrictlySmallerThan(
const llvm::ConstantRange& CR) const
Description
Compare set size of this range with the range CR.
Declared at: llvm/include/llvm/IR/ConstantRange.h:225
Parameters
- const llvm::ConstantRange& CR
¶bool isUpperSignWrapped() const
bool isUpperSignWrapped() const
Description
Return true if the (exclusive) upper bound wraps around the signed domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, SignedMin): Wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:198
¶bool isUpperWrapped() const
bool isUpperWrapped() const
Description
Return true if the exclusive upper bound wraps around the unsigned domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, 0): Wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:185
¶bool isWrappedSet() const
bool isWrappedSet() const
Description
Return true if this set wraps around the unsigned domain. Special cases: * Empty set: Not wrapped. * Full set: Not wrapped. * [X, 0) == [X, Max]: Not wrapped.
Declared at: llvm/include/llvm/IR/ConstantRange.h:178
¶llvm::ConstantRange lshr(
const llvm::ConstantRange& Other) const
llvm::ConstantRange lshr(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a logical right shift of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:419
Parameters
- const llvm::ConstantRange& Other
¶static llvm::ConstantRange makeAllowedICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
static llvm::ConstantRange makeAllowedICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
Description
Produce the smallest range such that all values that may satisfy the given predicate with any value contained within Other is contained in the returned range. Formally, this returns a superset of 'union over all y in Other . { x : icmp op x y is true }'. If the exact answer is not representable as a ConstantRange, the return value will be a proper superset of the above. Example: Pred = ult and Other = i8 [2, 5) returns Result = [0, 4)
Declared at: llvm/include/llvm/IR/ConstantRange.h:103
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& Other
¶static llvm::ConstantRange makeExactICmpRegion(
CmpInst::Predicate Pred,
const llvm::APInt& Other)
static llvm::ConstantRange makeExactICmpRegion(
CmpInst::Predicate Pred,
const llvm::APInt& Other)
Description
Produce the exact range such that all values in the returned range satisfy the given predicate with any value contained within Other. Formally, this returns the exact answer when the superset of 'union over all y in Other is exactly same as the subset of intersection over all y in Other. { x : icmp op x y is true}'. Example: Pred = ult and Other = i8 3 returns [0, 3)
Declared at: llvm/include/llvm/IR/ConstantRange.h:124
Parameters
- CmpInst::Predicate Pred
- const llvm::APInt& Other
¶static llvm::ConstantRange makeExactNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::APInt& Other,
unsigned int NoWrapKind)
static llvm::ConstantRange makeExactNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::APInt& Other,
unsigned int NoWrapKind)
Description
Produce the range that contains X if and only if "X BinOp Other" does not wrap.
Declared at: llvm/include/llvm/IR/ConstantRange.h:149
Parameters
- Instruction::BinaryOps BinOp
- const llvm::APInt& Other
- unsigned int NoWrapKind
¶static llvm::ConstantRange
makeGuaranteedNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind)
static llvm::ConstantRange
makeGuaranteedNoWrapRegion(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind)
Description
Produce the largest range containing all X such that "X BinOp Y" is guaranteed not to wrap (overflow) for *all* Y in Other. However, there may be *some* Y in Other for which additional X not contained in the result also do not overflow. NoWrapKind must be one of OBO::NoUnsignedWrap or OBO::NoSignedWrap. Examples: typedef OverflowingBinaryOperator OBO; #define MGNR makeGuaranteedNoWrapRegion MGNR(Add, [i8 1, 2), OBO::NoSignedWrap) == [-128, 127) MGNR(Add, [i8 1, 2), OBO::NoUnsignedWrap) == [0, -1) MGNR(Add, [i8 0, 1), OBO::NoUnsignedWrap) == Full Set MGNR(Add, [i8 -1, 6), OBO::NoSignedWrap) == [INT_MIN+1, INT_MAX-4) MGNR(Sub, [i8 1, 2), OBO::NoSignedWrap) == [-127, 128) MGNR(Sub, [i8 1, 2), OBO::NoUnsignedWrap) == [1, 0)
Declared at: llvm/include/llvm/IR/ConstantRange.h:143
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
¶static llvm::ConstantRange
makeSatisfyingICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
static llvm::ConstantRange
makeSatisfyingICmpRegion(
CmpInst::Predicate Pred,
const llvm::ConstantRange& Other)
Description
Produce the largest range such that all values in the returned range satisfy the given predicate with all values contained within Other. Formally, this returns a subset of 'intersection over all y in Other . { x : icmp op x y is true }'. If the exact answer is not representable as a ConstantRange, the return value will be a proper subset of the above. Example: Pred = ult and Other = i8 [2, 5) returns [0, 2)
Declared at: llvm/include/llvm/IR/ConstantRange.h:114
Parameters
- CmpInst::Predicate Pred
- const llvm::ConstantRange& Other
¶llvm::ConstantRange multiply(
const llvm::ConstantRange& Other) const
llvm::ConstantRange multiply(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a multiplication of a value in this range and a value in \p Other, treating both this and \p Other as unsigned ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:364
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange overflowingBinaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind) const
llvm::ConstantRange overflowingBinaryOp(
Instruction::BinaryOps BinOp,
const llvm::ConstantRange& Other,
unsigned int NoWrapKind) const
Description
Return a new range representing the possible values resulting from an application of the specified overflowing binary operator to a left hand side of this range and a right hand side of \p Other given the provided knowledge about lack of wrapping \p NoWrapKind.
Declared at: llvm/include/llvm/IR/ConstantRange.h:333
Parameters
- Instruction::BinaryOps BinOp
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
¶void print(llvm::raw_ostream& OS) const
void print(llvm::raw_ostream& OS) const
Description
Print out the bounds to a stream.
Declared at: llvm/include/llvm/IR/ConstantRange.h:487
Parameters
¶llvm::ConstantRange sadd_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sadd_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating addition of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:429
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sdiv(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sdiv(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed division of a value in this range and a value in\p Other. Division by zero and division of SignedMin by -1 are considered undefined behavior, in line with IR, and do not contribute towards the result.
Declared at: llvm/include/llvm/IR/ConstantRange.h:392
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sextOrTrunc(
uint32_t BitWidth) const
llvm::ConstantRange sextOrTrunc(
uint32_t BitWidth) const
Description
Make this range have the bit width given by \p BitWidth. The value is sign extended, truncated, or left alone to make it that width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:321
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange shl(
const llvm::ConstantRange& Other) const
llvm::ConstantRange shl(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a left shift of a value in this range by a value in \p Other. TODO: This isn't fully implemented yet.
Declared at: llvm/include/llvm/IR/ConstantRange.h:415
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange signExtend(
uint32_t BitWidth) const
llvm::ConstantRange signExtend(
uint32_t BitWidth) const
Description
Return a new range in the specified integer type, which must be strictly larger than the current type. The returned range will correspond to the possible range of values if the source range had been sign extended to BitWidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:307
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange::OverflowResult
signedAddMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
signedAddMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether signed add of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:475
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
signedSubMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
signedSubMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether signed sub of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:481
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smax(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smax(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed maximum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:368
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smin(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smin(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed minimum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:376
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange smul_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange smul_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating multiplication of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:441
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange srem(
const llvm::ConstantRange& Other) const
llvm::ConstantRange srem(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a signed remainder operation of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:402
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sshl_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sshl_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating left shift of this constant range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:449
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange ssub_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ssub_sat(
const llvm::ConstantRange& Other) const
Description
Perform a signed saturating subtraction of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:435
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange sub(
const llvm::ConstantRange& Other) const
llvm::ConstantRange sub(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from a subtraction of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:351
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange subWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
llvm::ConstantRange subWithNoWrap(
const llvm::ConstantRange& Other,
unsigned int NoWrapKind,
llvm::ConstantRange::PreferredRangeType
RangeType = Smallest) const
Description
Return a new range representing the possible values resulting from an subtraction with wrap type \p NoWrapKind of a value in this range and a value in \p Other. If the result range is disjoint, the preferred range is determined by the\p PreferredRangeType.
Declared at: llvm/include/llvm/IR/ConstantRange.h:358
Parameters
- const llvm::ConstantRange& Other
- unsigned int NoWrapKind
- llvm::ConstantRange::PreferredRangeType RangeType = Smallest
¶llvm::ConstantRange subtract(
const llvm::APInt& CI) const
llvm::ConstantRange subtract(
const llvm::APInt& CI) const
Description
Subtract the specified constant from the endpoints of this constant range.
Declared at: llvm/include/llvm/IR/ConstantRange.h:257
Parameters
- const llvm::APInt& CI
¶llvm::ConstantRange truncate(
uint32_t BitWidth) const
llvm::ConstantRange truncate(
uint32_t BitWidth) const
Description
Return a new range in the specified integer type, which must be strictly smaller than the current type. The returned range will correspond to the possible range of values if the source range had been truncated to the specified type.
Declared at: llvm/include/llvm/IR/ConstantRange.h:313
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange uadd_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange uadd_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating addition of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:426
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange udiv(
const llvm::ConstantRange& Other) const
llvm::ConstantRange udiv(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned division of a value in this range and a value in\p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:385
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umax(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umax(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned maximum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:372
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umin(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umin(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned minimum of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:380
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange umul_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange umul_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating multiplication of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:438
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange unionWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
llvm::ConstantRange unionWith(
const llvm::ConstantRange& CR,
llvm::ConstantRange::PreferredRangeType Type =
Smallest) const
Description
Return the range that results from the union of this range with another range. The resultant range is guaranteed to include the elements of both sets, but may contain more. For example, [3, 9) union [12,15) is [3, 15), which includes 9, 10, and 11, which were not included in either set before.
Declared at: llvm/include/llvm/IR/ConstantRange.h:285
Parameters
- const llvm::ConstantRange& CR
- llvm::ConstantRange::PreferredRangeType Type = Smallest
¶llvm::ConstantRange::OverflowResult
unsignedAddMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedAddMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned add of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:472
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
unsignedMulMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedMulMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned mul of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:484
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange::OverflowResult
unsignedSubMayOverflow(
const llvm::ConstantRange& Other) const
llvm::ConstantRange::OverflowResult
unsignedSubMayOverflow(
const llvm::ConstantRange& Other) const
Description
Return whether unsigned sub of the two ranges always/never overflows.
Declared at: llvm/include/llvm/IR/ConstantRange.h:478
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange urem(
const llvm::ConstantRange& Other) const
llvm::ConstantRange urem(
const llvm::ConstantRange& Other) const
Description
Return a new range representing the possible values resulting from an unsigned remainder operation of a value in this range and a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:397
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange ushl_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange ushl_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating left shift of this constant range by a value in \p Other.
Declared at: llvm/include/llvm/IR/ConstantRange.h:445
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange usub_sat(
const llvm::ConstantRange& Other) const
llvm::ConstantRange usub_sat(
const llvm::ConstantRange& Other) const
Description
Perform an unsigned saturating subtraction of two constant ranges.
Declared at: llvm/include/llvm/IR/ConstantRange.h:432
Parameters
- const llvm::ConstantRange& Other
¶llvm::ConstantRange zeroExtend(
uint32_t BitWidth) const
llvm::ConstantRange zeroExtend(
uint32_t BitWidth) const
Description
Return a new range in the specified integer type, which must be strictly larger than the current type. The returned range will correspond to the possible range of values if the source range had been zero extended to BitWidth.
Declared at: llvm/include/llvm/IR/ConstantRange.h:301
Parameters
- uint32_t BitWidth
¶llvm::ConstantRange zextOrTrunc(
uint32_t BitWidth) const
llvm::ConstantRange zextOrTrunc(
uint32_t BitWidth) const
Description
Make this range have the bit width given by \p BitWidth. The value is zero extended, truncated, or left alone to make it that width.
Declared at: llvm/include/llvm/IR/ConstantRange.h:317
Parameters
- uint32_t BitWidth