9 #ifndef LLVM_ANALYSIS_VALUELATTICE_H 10 #define LLVM_ANALYSIS_VALUELATTICE_H 27 enum ValueLatticeElementTy {
51 ValueLatticeElementTy Tag;
75 Range.~ConstantRange();
92 Range.~ConstantRange();
121 if (!isa<UndefValue>(
C))
127 if (!isa<UndefValue>(C))
128 Res.markNotConstant(C);
133 Res.markConstantRange(std::move(CR));
138 Res.markOverdefined();
160 "Cannot get the constant-range of a non-constant-range!");
166 return cast<ConstantInt>(
getConstant())->getValue();
174 void markOverdefined() {
180 Range.~ConstantRange();
185 assert(V &&
"Marking constant with NULL");
190 if (isa<UndefValue>(V))
194 "Marking constant with different value");
201 assert(V &&
"Marking constant with NULL");
203 markConstantRange(
ConstantRange(CI->getValue() + 1, CI->getValue()));
206 if (isa<UndefValue>(V))
210 "Marking constant !constant with same value");
212 "Marking !constant with different value");
223 Range = std::move(NewR);
280 markConstantRange(std::move(NewR));
286 "No integer constant");
ConstantInt * getConstantInt() const
Optional< APInt > asConstantInteger() const
A parsed version of the target data layout string in and methods for querying it. ...
static ConstantInt * getFalse(LLVMContext &Context)
This class represents lattice values for constants.
const APInt * getSingleElement() const
If this set contains a single element, return it, otherwise return null.
static Constant * getCompare(unsigned short pred, Constant *C1, Constant *C2, bool OnlyIfReduced=false)
Return an ICmp or FCmp comparison operator constant expression.
ValueLatticeElement(const ValueLatticeElement &Other)
Custom copy constructor, to ensure Range gets initialized when copying a constant range lattice eleme...
return AArch64::GPR64RegClass contains(Reg)
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
static ValueLatticeElement getNot(Constant *C)
~ValueLatticeElement()
Custom destructor to ensure Range is properly destroyed, when the object is deallocated.
const ConstantRange & getConstantRange() const
bool isOverdefined() const
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...
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isNotConstant() const
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
bool isConstantRange() const
bool isFullSet() const
Return true if this set contains all of the elements possible for this data-type. ...
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
static ValueLatticeElement getRange(ConstantRange CR)
Constant * getConstant() const
Constant * getNotConstant() const
bool isEmptySet() const
Return true if this set contains no members.
This is the shared class of boolean and integer constants.
Constant * getCompare(CmpInst::Predicate Pred, Type *Ty, const ValueLatticeElement &Other) const
Compares this symbolic value with Other using Pred and returns either true, false or undef constants...
This class represents a range of values.
static ConstantInt * getTrue(LLVMContext &Context)
bool mergeIn(const ValueLatticeElement &RHS, const DataLayout &DL)
Updates this object to approximate both this object and RHS.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
ConstantRange unionWith(const ConstantRange &CR, PreferredRangeType Type=Smallest) const
Return the range that results from the union of this range with another range.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ValueLatticeElement & operator=(const ValueLatticeElement &Other)
Custom assignment operator, to ensure Range gets initialized when assigning a constant range lattice ...
This class implements an extremely fast bulk output stream that can only output to a stream...
static ValueLatticeElement getOverdefined()