10 #ifndef LLVM_ANALYSIS_VALUELATTICE_H 11 #define LLVM_ANALYSIS_VALUELATTICE_H 28 enum ValueLatticeElementTy {
52 ValueLatticeElementTy Tag;
76 Range.~ConstantRange();
93 Range.~ConstantRange();
122 if (!isa<UndefValue>(
C))
128 if (!isa<UndefValue>(C))
129 Res.markNotConstant(C);
134 Res.markConstantRange(std::move(CR));
139 Res.markOverdefined();
161 "Cannot get the constant-range of a non-constant-range!");
167 return cast<ConstantInt>(
getConstant())->getValue();
175 void markOverdefined() {
181 Range.~ConstantRange();
186 assert(V &&
"Marking constant with NULL");
191 if (isa<UndefValue>(V))
195 "Marking constant with different value");
202 assert(V &&
"Marking constant with NULL");
204 markConstantRange(
ConstantRange(CI->getValue() + 1, CI->getValue()));
207 if (isa<UndefValue>(V))
211 "Marking constant !constant with same value");
213 "Marking !constant with different value");
224 Range = std::move(NewR);
281 markConstantRange(std::move(NewR));
287 "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)
ConstantRange unionWith(const ConstantRange &CR) const
Return the range that results from the union of this range with another range.
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)
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()