LLVM 17.0.0git
|
This class represents lattice values for constants. More...
#include "llvm/Analysis/ValueLattice.h"
Classes | |
struct | MergeOptions |
Struct to control some aspects related to merging constant ranges. More... | |
Static Public Member Functions | |
static ValueLatticeElement | get (Constant *C) |
static ValueLatticeElement | getNot (Constant *C) |
static ValueLatticeElement | getRange (ConstantRange CR, bool MayIncludeUndef=false) |
static ValueLatticeElement | getOverdefined () |
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.
Definition at line 29 of file ValueLattice.h.
|
inline |
Definition at line 148 of file ValueLattice.h.
Referenced by operator=().
|
inline |
Definition at line 150 of file ValueLattice.h.
|
inline |
Definition at line 152 of file ValueLattice.h.
References ConstVal, llvm::Other, and Range.
|
inline |
Definition at line 171 of file ValueLattice.h.
References ConstVal, llvm::Other, and Range.
|
inline |
Definition at line 278 of file ValueLattice.h.
References getConstant(), getConstantRange(), llvm::ConstantRange::getSingleElement(), isConstant(), and isConstantRange().
Referenced by getEdgeValueLocal().
|
inlinestatic |
Definition at line 203 of file ValueLattice.h.
References llvm::CallingConv::C, markConstant(), and markUndef().
Referenced by getEdgeValueLocal(), and getValueFromICmpCondition().
Constant * llvm::ValueLatticeElement::getCompare | ( | CmpInst::Predicate | Pred, |
Type * | Ty, | ||
const ValueLatticeElement & | Other, | ||
const DataLayout & | DL | ||
) | const |
true, false or undef constants, or nullptr if the comparison cannot be evaluated.
Definition at line 14 of file ValueLattice.cpp.
References llvm::ConstantFoldCompareInstOperands(), DL, getConstant(), getConstantRange(), llvm::ConstantInt::getFalse(), llvm::CmpInst::getInversePredicate(), getNotConstant(), llvm::ConstantInt::getTrue(), llvm::CmpInst::ICMP_NE, isConstant(), isConstantRange(), llvm::ICmpInst::isEquality(), isNotConstant(), isUndef(), isUnknown(), and llvm::Other.
|
inline |
Definition at line 258 of file ValueLattice.h.
References assert(), ConstVal, and isConstant().
Referenced by asConstantInteger(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getPredicateResult(), markConstant(), mergeIn(), and llvm::operator<<().
|
inline |
Returns the constant range for this value.
Use 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.
Definition at line 272 of file ValueLattice.h.
References assert(), isConstantRange(), and Range.
Referenced by asConstantInteger(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getConstantRange(), getConstantRangeOrFull(), getEdgeValueLocal(), getPredicateResult(), hasSingleValue(), llvm::SCCPSolver::isConstant(), markConstantRange(), mergeIn(), llvm::operator<<(), and runIPSCCP().
|
inlinestatic |
Definition at line 211 of file ValueLattice.h.
References assert(), llvm::CallingConv::C, and markNotConstant().
Referenced by getValueFromICmpCondition(), and getValueFromMetadata().
|
inline |
Definition at line 263 of file ValueLattice.h.
References assert(), ConstVal, and isNotConstant().
Referenced by getCompare(), getPredicateResult(), markNotConstant(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 458 of file ValueLattice.h.
|
inlinestatic |
Definition at line 234 of file ValueLattice.h.
References markOverdefined().
Referenced by constantFoldUser(), getFromRangeMetadata(), getRange(), getValueFromCondition(), getValueFromConditionImpl(), getValueFromICmpCondition(), getValueFromMetadata(), and getValueFromOverflowCondition().
|
inlinestatic |
Definition at line 217 of file ValueLattice.h.
References getOverdefined(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), markConstantRange(), and markUndef().
Referenced by constantFoldUser(), getEdgeValueLocal(), getFromRangeMetadata(), getValueFromICmpCondition(), getValueFromMetadata(), getValueFromOverflowCondition(), getValueFromSimpleICmpCondition(), and intersect().
|
inline |
Definition at line 243 of file ValueLattice.h.
Referenced by asConstantInteger(), getCompare(), getConstant(), llvm::SCCPInstVisitor::getConstant(), getPredicateResult(), hasSingleValue(), llvm::SCCPSolver::isConstant(), markConstant(), and mergeIn().
Returns true if this value is a constant range.
Use 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.
Definition at line 252 of file ValueLattice.h.
References llvm::ConstantRange::isSingleElement(), and Range.
Referenced by asConstantInteger(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getConstantRange(), getConstantRange(), getConstantRangeOrFull(), getPredicateResult(), hasSingleValue(), llvm::SCCPSolver::isConstant(), markConstantRange(), mergeIn(), llvm::operator<<(), and runIPSCCP().
|
inline |
Definition at line 245 of file ValueLattice.h.
Referenced by markConstantRange(), llvm::operator<<(), and runIPSCCP().
|
inline |
Definition at line 244 of file ValueLattice.h.
Referenced by getCompare(), getNotConstant(), getPredicateResult(), markNotConstant(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 256 of file ValueLattice.h.
Referenced by getEdgeValueLocal(), markOverdefined(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 240 of file ValueLattice.h.
Referenced by getCompare(), markConstant(), markConstantRange(), markUndef(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 241 of file ValueLattice.h.
Referenced by getCompare(), markConstant(), markConstantRange(), markNotConstant(), markUndef(), mergeIn(), llvm::operator<<(), and llvm::SCCPInstVisitor::resolvedUndef().
|
inline |
Definition at line 242 of file ValueLattice.h.
Referenced by llvm::SCCPSolver::isOverdefined(), and runIPSCCP().
Definition at line 304 of file ValueLattice.h.
References assert(), ConstVal, getConstant(), isConstant(), isUndef(), isUnknown(), markConstantRange(), and markUndef().
Referenced by get(), mergeIn(), and llvm::SCCPInstVisitor::setLatticeValueForSpecializationArguments().
|
inline |
Mark the object as constant range with NewR
.
If the object is already a constant range, nothing changes if the existing range is equal to NewR
and the tag. Otherwise 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.
Definition at line 350 of file ValueLattice.h.
References assert(), llvm::ConstantRange::contains(), getConstantRange(), isConstantRange(), isConstantRangeIncludingUndef(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), isUndef(), isUnknown(), markOverdefined(), and Range.
Referenced by getRange(), markConstant(), markNotConstant(), and mergeIn().
Definition at line 324 of file ValueLattice.h.
References assert(), ConstVal, getNotConstant(), isNotConstant(), isUnknown(), and markConstantRange().
Referenced by getNot().
|
inline |
Definition at line 287 of file ValueLattice.h.
References isOverdefined().
Referenced by getOverdefined(), markConstantRange(), and mergeIn().
|
inline |
Definition at line 295 of file ValueLattice.h.
References assert(), isUndef(), and isUnknown().
Referenced by get(), getRange(), and markConstant().
|
inline |
Updates this object to approximate both this object and RHS.
Returns true if this object has been changed.
Definition at line 388 of file ValueLattice.h.
References assert(), getConstant(), getConstantRange(), getNotConstant(), isConstant(), isConstantRange(), isNotConstant(), isOverdefined(), isUndef(), isUnknown(), markConstant(), markConstantRange(), markOverdefined(), RHS, and llvm::ConstantRange::unionWith().
|
inline |
Definition at line 191 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 197 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 459 of file ValueLattice.h.
References N.
Constant* llvm::ValueLatticeElement::ConstVal |
Definition at line 89 of file ValueLattice.h.
Referenced by getConstant(), getNotConstant(), markConstant(), markNotConstant(), and ValueLatticeElement().
ConstantRange llvm::ValueLatticeElement::Range |
Definition at line 90 of file ValueLattice.h.
Referenced by getConstantRange(), isConstantRange(), markConstantRange(), and ValueLatticeElement().