31 #ifndef LLVM_IR_CONSTANTRANGE_H 32 #define LLVM_IR_CONSTANTRANGE_H 145 unsigned NoWrapKind);
151 unsigned NoWrapKind);
169 bool isFullSet()
const;
172 bool isEmptySet()
const;
178 bool isWrappedSet()
const;
185 bool isUpperWrapped()
const;
191 bool isSignWrappedSet()
const;
198 bool isUpperSignWrapped()
const;
208 if (Upper == Lower + 1)
216 if (Lower == Upper + 1)
225 bool isSizeStrictlySmallerThan(
const ConstantRange &CR)
const;
228 bool isSizeLargerThan(uint64_t MaxSize)
const;
231 bool isAllNegative()
const;
234 bool isAllNonNegative()
const;
237 APInt getUnsignedMax()
const;
240 APInt getUnsignedMin()
const;
243 APInt getSignedMax()
const;
246 APInt getSignedMin()
const;
250 return Lower == CR.Lower && Upper == CR.Upper;
335 unsigned NoWrapKind)
const;
505 #endif // LLVM_IR_CONSTANTRANGE_H static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
This class represents lattice values for constants.
const APInt & getUpper() const
Return the upper value for this range.
const APInt * getSingleElement() const
If this set contains a single element, return it, otherwise return null.
Always overflows in the direction of signed/unsigned min value.
static ConstantRange getEmpty(uint32_t BitWidth)
Create empty constant range with the given bit width.
void print(raw_ostream &OS) const
Print out the bounds to a stream.
unsigned getBitWidth() const
Return the number of bits in the APInt.
return AArch64::GPR64RegClass contains(Reg)
uint32_t getBitWidth() const
Get the bit width of this ConstantRange.
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.
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.
static ConstantRange getFull(uint32_t BitWidth)
Create full constant range with the given bit width.
OverflowResult
Represents whether an operation on the given constant range is known to always or never overflow...
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
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...
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
bool operator!=(const ConstantRange &CR) const
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
const APInt & umin(const APInt &A, const APInt &B)
Determine the smaller of two APInts considered to be signed.
static uint64_t add(uint64_t LeftOp, uint64_t RightOp)
This class represents a range of values.
Class for arbitrary precision integers.
const APInt & umax(const APInt &A, const APInt &B)
Determine the larger of two APInts considered to be unsigned.
const APInt * getSingleMissingElement() const
If this set contains all but a single element, return it, otherwise return null.
Always overflows in the direction of signed/unsigned max value.
const APInt & getLower() const
Return the lower value for this range.
APFloat abs(APFloat X)
Returns the absolute value of the argument.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
bool isSingleElement() const
Return true if this set contains exactly one member.
LLVM Value Representation.
PreferredRangeType
If represented precisely, the result of some range operations may consist of multiple disjoint ranges...
bool operator==(const ConstantRange &CR) const
Return true if this range is equal to another range.
static uint64_t sub(uint64_t LeftOp, uint64_t RightOp)
This class implements an extremely fast bulk output stream that can only output to a stream...
bool operator==(uint64_t V1, const APInt &V2)