class ValueLatticeElement
Declaration
class ValueLatticeElement { /* full declaration omitted */ };
Description
This class represents lattice values for constants. FIXME: This is basically just for bringup, this can be made a lot more rich in the future.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:29
Member Variables
- private llvm::ValueLatticeElement::ValueLatticeElementTy Tag
- private unsigned int NumRangeExtensions
- Number of times a constant range has been extended with widening enabled.
- private anonymous struct / union
Method Overview
- public ValueLatticeElement()
- public ValueLatticeElement(const llvm::ValueLatticeElement & Other)
- public ValueLatticeElement(llvm::ValueLatticeElement && Other)
- public Optional<llvm::APInt> asConstantInteger() const
- private void destroy()
- public static llvm::ValueLatticeElement get(llvm::Constant * C)
- public llvm::Constant * getCompare(CmpInst::Predicate Pred, llvm::Type * Ty, const llvm::ValueLatticeElement & Other) const
- public llvm::Constant * getConstant() const
- public const llvm::ConstantRange & getConstantRange(bool UndefAllowed = true) const
- public static llvm::ValueLatticeElement getNot(llvm::Constant * C)
- public llvm::Constant * getNotConstant() const
- public unsigned int getNumRangeExtensions() const
- public static llvm::ValueLatticeElement getOverdefined()
- public static llvm::ValueLatticeElement getRange(llvm::ConstantRange CR, bool MayIncludeUndef = false)
- public bool isConstant() const
- public bool isConstantRange(bool UndefAllowed = true) const
- public bool isConstantRangeIncludingUndef() const
- public bool isNotConstant() const
- public bool isOverdefined() const
- public bool isUndef() const
- public bool isUnknown() const
- public bool isUnknownOrUndef() const
- public bool markConstant(llvm::Constant * V, bool MayIncludeUndef = false)
- public bool markConstantRange(llvm::ConstantRange NewR, llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions())
- public bool markNotConstant(llvm::Constant * V)
- public bool markOverdefined()
- public bool markUndef()
- public bool mergeIn(const llvm::ValueLatticeElement & RHS, llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions())
- public void setNumRangeExtensions(unsigned int N)
- public ~ValueLatticeElement()
Methods
¶ValueLatticeElement()
ValueLatticeElement()
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:148
¶ValueLatticeElement(
const llvm::ValueLatticeElement& Other)
ValueLatticeElement(
const llvm::ValueLatticeElement& Other)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:152
Parameters
- const llvm::ValueLatticeElement& Other
¶ValueLatticeElement(
llvm::ValueLatticeElement&& Other)
ValueLatticeElement(
llvm::ValueLatticeElement&& Other)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:171
Parameters
- llvm::ValueLatticeElement&& Other
¶Optional<llvm::APInt> asConstantInteger() const
Optional<llvm::APInt> asConstantInteger() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:278
¶void destroy()
void destroy()
Description
Destroy contents of lattice value, without destructing the object.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:94
¶static llvm::ValueLatticeElement get(
llvm::Constant* C)
static llvm::ValueLatticeElement get(
llvm::Constant* C)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:203
Parameters
¶llvm::Constant* getCompare(
CmpInst::Predicate Pred,
llvm::Type* Ty,
const llvm::ValueLatticeElement& Other) const
llvm::Constant* getCompare(
CmpInst::Predicate Pred,
llvm::Type* Ty,
const llvm::ValueLatticeElement& Other) const
Description
true, false or undef constants, or nullptr if the comparison cannot be evaluated.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:454
Parameters
- CmpInst::Predicate Pred
- llvm::Type* Ty
- const llvm::ValueLatticeElement& Other
¶llvm::Constant* getConstant() const
llvm::Constant* getConstant() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:258
¶const llvm::ConstantRange& getConstantRange(
bool UndefAllowed = true) const
const llvm::ConstantRange& getConstantRange(
bool UndefAllowed = true) const
Description
Returns the constant range for this value. Use \p UndefAllowed to exclude non-singleton constant ranges that may also be undef. Note that this function also returns a range if the range may include undef, but only contains a single element. In that case, it can be replaced by a constant.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:272
Parameters
- bool UndefAllowed = true
¶static llvm::ValueLatticeElement getNot(
llvm::Constant* C)
static llvm::ValueLatticeElement getNot(
llvm::Constant* C)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:211
Parameters
¶llvm::Constant* getNotConstant() const
llvm::Constant* getNotConstant() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:263
¶unsigned int getNumRangeExtensions() const
unsigned int getNumRangeExtensions() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:487
¶static llvm::ValueLatticeElement getOverdefined()
static llvm::ValueLatticeElement getOverdefined()
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:234
¶static llvm::ValueLatticeElement getRange(
llvm::ConstantRange CR,
bool MayIncludeUndef = false)
static llvm::ValueLatticeElement getRange(
llvm::ConstantRange CR,
bool MayIncludeUndef = false)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:217
Parameters
- llvm::ConstantRange CR
- bool MayIncludeUndef = false
¶bool isConstant() const
bool isConstant() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:243
¶bool isConstantRange(
bool UndefAllowed = true) const
bool isConstantRange(
bool UndefAllowed = true) const
Description
Returns true if this value is a constant range. Use \p UndefAllowed to exclude non-singleton constant ranges that may also be undef. Note that this function also returns true if the range may include undef, but only contains a single element. In that case, it can be replaced by a constant.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:252
Parameters
- bool UndefAllowed = true
¶bool isConstantRangeIncludingUndef() const
bool isConstantRangeIncludingUndef() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:245
¶bool isNotConstant() const
bool isNotConstant() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:244
¶bool isOverdefined() const
bool isOverdefined() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:256
¶bool isUndef() const
bool isUndef() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:240
¶bool isUnknown() const
bool isUnknown() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:241
¶bool isUnknownOrUndef() const
bool isUnknownOrUndef() const
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:242
¶bool markConstant(llvm::Constant* V,
bool MayIncludeUndef = false)
bool markConstant(llvm::Constant* V,
bool MayIncludeUndef = false)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:304
Parameters
- llvm::Constant* V
- bool MayIncludeUndef = false
¶bool markConstantRange(
llvm::ConstantRange NewR,
llvm::ValueLatticeElement::MergeOptions Opts =
llvm::ValueLatticeElement::MergeOptions())
bool markConstantRange(
llvm::ConstantRange NewR,
llvm::ValueLatticeElement::MergeOptions Opts =
llvm::ValueLatticeElement::MergeOptions())
Description
Mark the object as constant range with \p NewR. If the object is already a constant range, nothing changes if the existing range is equal to \p NewR and the tag. Otherwise \p NewR must be a superset of the existing range or the object must be undef. The tag is set to constant_range_including_undef if either the existing value or the new range may include undef.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:350
Parameters
- llvm::ConstantRange NewR
- llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions()
¶bool markNotConstant(llvm::Constant* V)
bool markNotConstant(llvm::Constant* V)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:324
Parameters
¶bool markOverdefined()
bool markOverdefined()
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:287
¶bool markUndef()
bool markUndef()
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:295
¶bool mergeIn(
const llvm::ValueLatticeElement& RHS,
llvm::ValueLatticeElement::MergeOptions Opts =
llvm::ValueLatticeElement::MergeOptions())
bool mergeIn(
const llvm::ValueLatticeElement& RHS,
llvm::ValueLatticeElement::MergeOptions Opts =
llvm::ValueLatticeElement::MergeOptions())
Description
Updates this object to approximate both this object and RHS. Returns true if this object has been changed.
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:388
Parameters
- const llvm::ValueLatticeElement& RHS
- llvm::ValueLatticeElement::MergeOptions Opts = llvm::ValueLatticeElement::MergeOptions()
¶void setNumRangeExtensions(unsigned int N)
void setNumRangeExtensions(unsigned int N)
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:488
Parameters
- unsigned int N
¶~ValueLatticeElement()
~ValueLatticeElement()
Declared at: llvm/include/llvm/Analysis/ValueLattice.h:150