14#ifndef LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
15#define LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
120 "This is only intend for use in min/max to select the best for "
121 "RetainedKnowledge that is otherwise equal");
165 Filter = [](
auto...) {
return true; });
172 AssumptionCache &AC,
const Instruction *CtxI,
173 const DominatorTree *DT =
nullptr);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This represents the llvm.assume intrinsic.
A cache of @llvm.assume calls within a function.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
static LLVM_ABI StringRef getNameFromAttrKind(Attribute::AttrKind AttrKind)
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
@ TombstoneKey
Use as Tombstone key for DenseMap of AttrKind.
@ None
No attributes have been set.
@ EmptyKey
Use as Empty key for DenseMap of AttrKind.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
StringRef - Represent a constant reference to a string, i.e.
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI RetainedKnowledge getKnowledgeForValue(const Value *V, ArrayRef< Attribute::AttrKind > AttrKinds, AssumptionCache &AC, 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...
DenseMap< AssumeInst *, MinMax > Assume2KnowledgeMap
A mapping from intrinsics (=llvm.assume calls) to a value range (=knowledge) that is encoded in them.
LLVM_ABI RetainedKnowledge getKnowledgeFromOperandInAssume(AssumeInst &Assume, unsigned Idx)
Retreive the information help by Assume on the operand at index Idx.
constexpr StringRef IgnoreBundleTag
Tag in operand bundle indicating that this bundle should be ignored.
LLVM_ABI bool isAssumeWithEmptyBundle(const AssumeInst &Assume)
Return true iff the operand bundles of the provided llvm.assume doesn't contain any valuable informat...
LLVM_ABI RetainedKnowledge getKnowledgeFromBundle(AssumeInst &Assume, const CallBase::BundleOpInfo &BOI)
This extracts the Knowledge from an element of an operand bundle.
DenseMap< RetainedKnowledgeKey, Assume2KnowledgeMap > RetainedKnowledgeMap
LLVM_ABI 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.
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_ABI RetainedKnowledge getKnowledgeValidInContext(const Value *V, ArrayRef< Attribute::AttrKind > AttrKinds, AssumptionCache &AC, const Instruction *CtxI, const DominatorTree *DT=nullptr)
Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and the know...
ArrayRef(const T &OneElt) -> ArrayRef< T >
LLVM_ABI 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...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result)
Insert into the map all the informations contained in the operand bundles of the llvm....
RetainedKnowledge getKnowledgeFromUseInAssume(const Use *U)
Retreive the information help by the Use U of an llvm.assume.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
AssumeBundleArg
Index of elements in the operand bundle.
Used to keep track of an operand bundle.
static Attribute::AttrKind getEmptyKey()
static unsigned getHashValue(Attribute::AttrKind AK)
static bool isEqual(Attribute::AttrKind LHS, Attribute::AttrKind RHS)
static Attribute::AttrKind getTombstoneKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
Represent one information held inside an operand bundle of an llvm.assume.
Attribute::AttrKind AttrKind
RetainedKnowledge(Attribute::AttrKind AttrKind=Attribute::None, uint64_t ArgValue=0, Value *WasOn=nullptr)
static RetainedKnowledge none()
bool operator!=(RetainedKnowledge Other) const
bool operator==(RetainedKnowledge Other) const
bool operator<(RetainedKnowledge Other) const
This is only intended for use in std::min/stdmax between attribute that only differ in ArgValue.