Go to the documentation of this file.
14 #ifndef LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
15 #define LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
21 class AssumptionCache;
114 "This is only intend for use in min/max to select the best for "
115 "RetainedKnowledge that is otherwise equal");
159 Filter = [](
auto...) {
return true; });
165 const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
166 const Instruction *CtxI,
const DominatorTree *DT =
nullptr,
167 AssumptionCache *AC =
nullptr);
172 const CallBase::BundleOpInfo &BOI);
This is an optimization pass for GlobalISel generic memory operations.
RetainedKnowledge getKnowledgeFromUse(const Use *U, ArrayRef< Attribute::AttrKind > AttrKinds)
Return a valid Knowledge associated to the Use U if its Attribute kind is in AttrKinds.
@ TombstoneKey
Use as Tombstone key for DenseMap of AttrKind.
constexpr StringRef IgnoreBundleTag
Tag in operand bundle indicating that this bundle should be ignored.
bool isAssumeWithEmptyBundle(AssumeInst &Assume)
Return true iff the operand bundles of the provided llvm.assume doesn't contain any valuable informat...
@ EmptyKey
Use as Empty key for DenseMap of AttrKind.
This represents the llvm.assume intrinsic.
bool operator==(RetainedKnowledge Other) const
An information struct used to provide DenseMap with the various necessary components for a given valu...
AssumeBundleArg
Index of elements in the operand bundle.
bool operator!=(RetainedKnowledge Other) const
bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn, StringRef AttrName, uint64_t *ArgVal=nullptr)
Query the operand bundle of an llvm.assume to find a single attribute of the specified kind applied o...
static Attribute::AttrKind getEmptyKey()
Used to keep track of an operand bundle.
RetainedKnowledge getKnowledgeFromBundle(AssumeInst &Assume, const CallBase::BundleOpInfo &BOI)
This extracts the Knowledge from an element of an operand bundle.
RetainedKnowledge getKnowledgeFromUseInAssume(const Use *U)
Retreive the information help by the Use U of an llvm.assume.
An efficient, type-erasing, non-owning reference to a callable.
Attribute::AttrKind AttrKind
@ None
No attributes have been set.
bool operator<(RetainedKnowledge Other) const
This is only intended for use in std::min/stdmax between attribute that only differ in ArgValue.
static RetainedKnowledge none()
void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result)
Insert into the map all the informations contained in the operand bundles of the llvm....
static bool isEqual(Attribute::AttrKind LHS, Attribute::AttrKind RHS)
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static Attribute::AttrKind getTombstoneKey()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
A cache of @llvm.assume calls within a function.
Represent one information held inside an operand bundle of an llvm.assume.
static unsigned getHashValue(Attribute::AttrKind AK)
static StringRef getNameFromAttrKind(Attribute::AttrKind AttrKind)
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
RetainedKnowledge getKnowledgeValidInContext(const Value *V, ArrayRef< Attribute::AttrKind > AttrKinds, const Instruction *CtxI, const DominatorTree *DT=nullptr, AssumptionCache *AC=nullptr)
Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and the know...
RetainedKnowledge getKnowledgeFromOperandInAssume(AssumeInst &Assume, unsigned Idx)
Retreive the information help by Assume on the operand at index Idx.
std::pair< Value *, Attribute::AttrKind > RetainedKnowledgeKey
The map Key contains the Value on for which the attribute is valid and the Attribute that is valid fo...
LLVM Value Representation.
Optional< std::vector< StOtherPiece > > Other
A Use represents the edge between a Value definition and its users.
RetainedKnowledge getKnowledgeForValue(const Value *V, ArrayRef< Attribute::AttrKind > AttrKinds, AssumptionCache *AC=nullptr, function_ref< bool(RetainedKnowledge, Instruction *, const CallBase::BundleOpInfo *)> Filter=[](auto...) { return true;})
Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and it match...