|
LLVM 24.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 27 of file ValueLattice.h.
|
inline |
Definition at line 151 of file ValueLattice.h.
Referenced by get(), getCompare(), getNot(), getOverdefined(), getRange(), intersect(), mergeIn(), operator=(), operator=(), ValueLatticeElement(), and ValueLatticeElement().
|
inline |
Definition at line 153 of file ValueLattice.h.
|
inline |
Definition at line 155 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 175 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 280 of file ValueLattice.h.
References llvm::cast(), getConstant(), getConstantRange(), llvm::ConstantRange::getSingleElement(), llvm::isa(), isConstant(), and isConstantRange().
|
inline |
Definition at line 299 of file ValueLattice.h.
References asConstantRange(), and assert().
|
inline |
Definition at line 289 of file ValueLattice.h.
References getConstant(), getConstantRange(), isConstant(), isConstantRange(), isUnknown(), and llvm::Constant::toConstantRange().
Referenced by asConstantRange(), and llvm::getRange().
|
inlinestatic |
Definition at line 208 of file ValueLattice.h.
References C(), markConstant(), and ValueLatticeElement().
Referenced by llvm::LazyValueInfoImpl::getValueAt().
| 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 15 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(), llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 260 of file ValueLattice.h.
References assert(), ConstVal, and isConstant().
Referenced by asConstantInteger(), asConstantRange(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getPredicateResult(), markConstant(), markConstantRange(), 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 274 of file ValueLattice.h.
References assert(), isConstantRange(), and Range.
Referenced by asConstantInteger(), asConstantRange(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getPredicateResult(), hasSingleValue(), llvm::hasSingleValue(), llvm::inferAttribute(), intersect(), llvm::SCCPSolver::isConstant(), markConstantRange(), mergeIn(), and llvm::operator<<().
|
inlinestatic |
Definition at line 213 of file ValueLattice.h.
References assert(), C(), llvm::isa(), markNotConstant(), and ValueLatticeElement().
Referenced by llvm::SCCPInstVisitor::getArgAttributeVL(), and getValueFromMetadata().
|
inline |
Definition at line 265 of file ValueLattice.h.
References assert(), ConstVal, and isNotConstant().
Referenced by getCompare(), getPredicateResult(), llvm::inferAttribute(), markNotConstant(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 505 of file ValueLattice.h.
|
inlinestatic |
Definition at line 236 of file ValueLattice.h.
References markOverdefined(), and ValueLatticeElement().
Referenced by constantFoldUser(), llvm::SCCPInstVisitor::getArgAttributeVL(), getFromRangeMetadata(), getRange(), llvm::LazyValueInfoImpl::getValueAt(), getValueFromICmpCtpop(), getValueFromMetadata(), and getValueFromOverflowCondition().
|
inlinestatic |
Definition at line 219 of file ValueLattice.h.
References getOverdefined(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), markConstantRange(), markUndef(), and ValueLatticeElement().
Referenced by constantFoldUser(), llvm::SCCPInstVisitor::getArgAttributeVL(), getFromRangeMetadata(), getValueFromICmpCtpop(), getValueFromMetadata(), getValueFromOverflowCondition(), and intersect().
| ValueLatticeElement llvm::ValueLatticeElement::intersect | ( | const ValueLatticeElement & | Other | ) | const |
Combine two sets of facts about the same value into a single set of facts.
Note that this method is not suitable for merging facts along different paths in a CFG; that's what the mergeIn function is for. This is for merging facts gathered about the same value at the same location through two independent means. Notes:
Definition at line 78 of file ValueLattice.cpp.
References getConstantRange(), getRange(), llvm::hasSingleValue(), llvm::ConstantRange::intersectWith(), isConstantRange(), isConstantRangeIncludingUndef(), isOverdefined(), isUnknown(), llvm::Other, Range, and ValueLatticeElement().
Referenced by llvm::LazyValueInfoImpl::getValueAtUse().
|
inline |
Definition at line 245 of file ValueLattice.h.
Referenced by asConstantInteger(), asConstantRange(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getConstant(), getPredicateResult(), hasSingleValue(), llvm::hasSingleValue(), llvm::SCCPSolver::isConstant(), markConstant(), markConstantRange(), 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 254 of file ValueLattice.h.
References Range.
Referenced by asConstantInteger(), asConstantRange(), getCompare(), llvm::SCCPInstVisitor::getConstant(), getConstantRange(), getPredicateResult(), hasSingleValue(), llvm::hasSingleValue(), llvm::inferAttribute(), intersect(), llvm::SCCPSolver::isConstant(), markConstantRange(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 247 of file ValueLattice.h.
Referenced by llvm::inferAttribute(), intersect(), markConstantRange(), and llvm::operator<<().
|
inline |
Definition at line 246 of file ValueLattice.h.
Referenced by getCompare(), getNotConstant(), getPredicateResult(), llvm::inferAttribute(), markNotConstant(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 258 of file ValueLattice.h.
Referenced by intersect(), markOverdefined(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 242 of file ValueLattice.h.
Referenced by getCompare(), markConstant(), markConstantRange(), markUndef(), mergeIn(), and llvm::operator<<().
|
inline |
Definition at line 243 of file ValueLattice.h.
Referenced by asConstantRange(), getCompare(), intersect(), markConstant(), markConstantRange(), markNotConstant(), markUndef(), mergeIn(), llvm::operator<<(), and llvm::SCCPInstVisitor::resolvedUndef().
|
inline |
Definition at line 244 of file ValueLattice.h.
Referenced by llvm::SCCPSolver::isOverdefined().
Definition at line 321 of file ValueLattice.h.
References assert(), ConstVal, llvm::dyn_cast(), getConstant(), llvm::isa(), 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 367 of file ValueLattice.h.
References assert(), llvm::ConstantRange::contains(), getConstant(), getConstantRange(), isConstant(), isConstantRange(), isConstantRangeIncludingUndef(), llvm::ConstantRange::isEmptySet(), llvm::ConstantRange::isFullSet(), isUndef(), isUnknown(), markOverdefined(), and Range.
Referenced by getRange(), markConstant(), markNotConstant(), and mergeIn().
Definition at line 341 of file ValueLattice.h.
References assert(), ConstVal, llvm::dyn_cast(), getNotConstant(), llvm::isa(), isNotConstant(), isUnknown(), and markConstantRange().
Referenced by getNot().
|
inline |
Definition at line 304 of file ValueLattice.h.
References isOverdefined().
Referenced by getOverdefined(), markConstantRange(), and mergeIn().
|
inline |
Definition at line 312 of file ValueLattice.h.
References assert(), isUndef(), and isUnknown().
Referenced by getRange(), and markConstant().
|
inline |
Definition at line 508 of file ValueLattice.h.
Referenced by llvm::SCCPSolver::isReplaceableConstant().
|
inline |
Updates this object to approximate both this object and RHS.
Returns true if this object has been changed.
Definition at line 407 of file ValueLattice.h.
References assert(), getConstant(), getConstantRange(), getNotConstant(), getType(), isConstant(), isConstantRange(), isNotConstant(), isOverdefined(), isUndef(), isUnknown(), markConstant(), markConstantRange(), markOverdefined(), RHS, llvm::Constant::toConstantRange(), and ValueLatticeElement().
|
inline |
Definition at line 196 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 202 of file ValueLattice.h.
References llvm::Other, and ValueLatticeElement().
|
inline |
Definition at line 509 of file ValueLattice.h.
|
inline |
Definition at line 506 of file ValueLattice.h.
References N.
| Constant* llvm::ValueLatticeElement::ConstVal |
Definition at line 92 of file ValueLattice.h.
Referenced by getConstant(), getNotConstant(), markConstant(), and markNotConstant().
| ConstantRange llvm::ValueLatticeElement::Range |
Definition at line 93 of file ValueLattice.h.
Referenced by getConstantRange(), intersect(), isConstantRange(), and markConstantRange().