14 #ifndef LLVM_TRANSFORMS_UTILS_ASSUMEBUNDLEQUERIES_H 15 #define LLVM_TRANSFORMS_UTILS_ASSUMEBUNDLEQUERIES_H 23 class AssumptionCache;
43 uint64_t *ArgVal =
nullptr);
46 uint64_t *ArgVal =
nullptr) {
150 Filter = [](
auto...) {
return true; });
156 const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
157 const Instruction *CtxI,
const DominatorTree *DT =
nullptr,
158 AssumptionCache *AC =
nullptr);
163 const CallBase::BundleOpInfo &BOI);
Use as Tombstone key for DenseMap of AttrKind.
This class represents lattice values for constants.
static bool isEqual(Attribute::AttrKind LHS, Attribute::AttrKind RHS)
This class represents a function call, abstracting a target machine's calling convention.
An efficient, type-erasing, non-owning reference to a callable.
A cache of @llvm.assume calls within a function.
RetainedKnowledge getKnowledgeFromOperandInAssume(CallInst &Assume, unsigned Idx)
Retreive the information help by Assume on the operand at index Idx.
static Attribute::AttrKind getTombstoneKey()
bool operator!=(RetainedKnowledge Other) const
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...
Used to keep track of an operand bundle.
A Use represents the edge between a Value definition and its users.
This file contains the simple types necessary to represent the attributes associated with functions a...
No attributes have been set.
static StringRef getNameFromAttrKind(Attribute::AttrKind AttrKind)
Use as Empty key for DenseMap of AttrKind.
constexpr StringRef IgnoreBundleTag
Tag in operand bundle indicating that this bundle should be ignored.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static unsigned getHashValue(Attribute::AttrKind AK)
Attribute::AttrKind AttrKind
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...
bool hasAttributeInAssume(CallInst &AssumeCI, 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...
bool operator==(RetainedKnowledge Other) const
void fillMapFromAssume(CallInst &AssumeCI, RetainedKnowledgeMap &Result)
Insert into the map all the informations contained in the operand bundles of the llvm....
static RetainedKnowledge none()
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...
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
AssumeBundleArg
Index of elements in the operand bundle.
RetainedKnowledge getKnowledgeFromUseInAssume(const Use *U)
Retreive the information help by the Use U of an llvm.assume.
static Attribute::AttrKind getEmptyKey()
bool isAssumeWithEmptyBundle(CallInst &Assume)
Return true iff the operand bundles of the provided llvm.assume doesn't contain any valuable informat...
LLVM Value Representation.
RetainedKnowledge getKnowledgeFromBundle(CallInst &Assume, const CallBase::BundleOpInfo &BOI)
This extracts the Knowledge from an element of an operand bundle.
StringRef - Represent a constant reference to a string, i.e.
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.
Represent one information held inside an operand bundle of an llvm.assume.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...