LLVM: include/llvm/Analysis/AssumeBundleQueries.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
15#define LLVM_ANALYSIS_ASSUMEBUNDLEQUERIES_H
16
20
21namespace llvm {
25
26
27
28
33
34
35
36
37
38
39
40
41
43 StringRef AttrName,
51
66
67
68
69
71
76
77
78
79
80
82
85
86
87
88
89
90
93
94
95
96
97
98
99
100
101
115
116
120 "This is only intend for use in min/max to select the best for "
121 "RetainedKnowledge that is otherwise equal");
123 }
126};
127
128
129
131 unsigned Idx);
132
133
134
137 U->getOperandNo());
138}
139
140
142
143
144
145
146
147
148
149
150
152
153
154
157
158
159
165 Filter = [](auto...) { return true; });
166
167
168
169
172 AssumptionCache &AC, const Instruction *CtxI,
173 const DominatorTree *DT = nullptr);
174
175
176
179
180}
181
182#endif
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.
Definition AssumeBundleQueries.h:81
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.
Definition AssumeBundleQueries.h:141
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
Definition AssumeBundleQueries.h:83
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...
Definition AssumeBundleQueries.h:70
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 - 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.
Definition AssumeBundleQueries.h:135
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
AssumeBundleArg
Index of elements in the operand bundle.
Definition AssumeBundleQueries.h:29
@ ABA_Argument
Definition AssumeBundleQueries.h:31
@ ABA_WasOn
Definition AssumeBundleQueries.h:30
Used to keep track of an operand bundle.
static Attribute::AttrKind getEmptyKey()
Definition AssumeBundleQueries.h:53
static unsigned getHashValue(Attribute::AttrKind AK)
Definition AssumeBundleQueries.h:59
static bool isEqual(Attribute::AttrKind LHS, Attribute::AttrKind RHS)
Definition AssumeBundleQueries.h:62
static Attribute::AttrKind getTombstoneKey()
Definition AssumeBundleQueries.h:56
An information struct used to provide DenseMap with the various necessary components for a given valu...
uint64_t Min
Definition AssumeBundleQueries.h:73
uint64_t Max
Definition AssumeBundleQueries.h:74
Represent one information held inside an operand bundle of an llvm.assume.
Definition AssumeBundleQueries.h:102
Attribute::AttrKind AttrKind
Definition AssumeBundleQueries.h:103
uint64_t ArgValue
Definition AssumeBundleQueries.h:104
RetainedKnowledge(Attribute::AttrKind AttrKind=Attribute::None, uint64_t ArgValue=0, Value *WasOn=nullptr)
Definition AssumeBundleQueries.h:107
static RetainedKnowledge none()
Definition AssumeBundleQueries.h:125
bool operator!=(RetainedKnowledge Other) const
Definition AssumeBundleQueries.h:114
Value * WasOn
Definition AssumeBundleQueries.h:106
Value * IRArgValue
Definition AssumeBundleQueries.h:105
bool operator==(RetainedKnowledge Other) const
Definition AssumeBundleQueries.h:110
bool operator<(RetainedKnowledge Other) const
This is only intended for use in std::min/stdmax between attribute that only differ in ArgValue.
Definition AssumeBundleQueries.h:117