LLVM: include/llvm/IR/VFABIDemangler.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_IR_VFABIDEMANGLER_H
14#define LLVM_IR_VFABIDEMANGLER_H
15
22
23namespace llvm {
24
25
43
44
57
58
59
60
61
62
63
77
78
79
80
81
82
83
87
91
92
98
99
100
105
106
107
108
110 bool HasGlobalPred) {
114 if (HasGlobalPred)
117
119 }
120
122};
123
124
127 std::string ScalarName;
128 std::string VectorName;
130
131
132
134 unsigned ParamCount = Shape.Parameters.size();
135 for (unsigned i = 0; i < ParamCount; ++i)
137 return i;
138
139 return std::nullopt;
140 }
141
142
143
145};
146
148
149static constexpr char const *_LLVM_ = "_LLVM_";
150
151
152
153
154
155
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
186
187
189
190
191static constexpr char const *MappingsAttrName = "vector-function-abi-variant";
192
193
194
195
196
197
201
202
203
204
205
206
207
208
211
212
213
216
217}
218
219}
220
221#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents a function call, abstracting a target machine's calling convention.
static constexpr ElementCount getFixed(ScalarTy MinVal)
Class to represent function types.
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition VFABIDemangler.h:147
static constexpr char const * MappingsAttrName
Definition VFABIDemangler.h:191
static constexpr char const * _LLVM_Scalarize_
Prefix for internal name redirection for vector function that tells the compiler to scalarize the cal...
Definition VFABIDemangler.h:156
LLVM_ABI std::optional< VFInfo > tryDemangleForVFABI(StringRef MangledName, const FunctionType *FTy)
Function to construct a VFInfo out of a mangled names in the following format:
LLVM_ABI FunctionType * createFunctionType(const VFInfo &Info, const FunctionType *ScalarFTy)
Constructs a FunctionType by applying vector function information to the type of a matching scalar fu...
LLVM_ABI void getVectorVariantNames(const CallInst &CI, SmallVectorImpl< std::string > &VariantMappings)
Populates a set of strings representing the Vector Function ABI variants associated to the CallInst C...
LLVM_ABI void setVectorVariantNames(CallInst *CI, ArrayRef< std::string > VariantMappings)
Overwrite the Vector Function ABI variants attribute with the names provide in VariantMappings.
LLVM_ABI VFParamKind getVFParamKindFromString(const StringRef Token)
Retrieve the VFParamKind from a string token.
static constexpr char const * _LLVM_
LLVM Internal VFABI ISA token for vector functions.
Definition VFABIDemangler.h:149
This is an optimization pass for GlobalISel generic memory operations.
VFISAKind
Describes the type of Instruction Set Architecture.
Definition VFABIDemangler.h:45
@ RVV
Definition VFABIDemangler.h:48
@ AVX
Definition VFABIDemangler.h:50
@ AVX512
Definition VFABIDemangler.h:52
@ SSE
Definition VFABIDemangler.h:49
@ LLVM
Definition VFABIDemangler.h:53
@ SVE
Definition VFABIDemangler.h:47
@ AdvancedSIMD
Definition VFABIDemangler.h:46
@ AVX2
Definition VFABIDemangler.h:51
VFParamKind
Describes the type of Parameters.
Definition VFABIDemangler.h:26
@ OMP_LinearRef
Definition VFABIDemangler.h:29
@ OMP_Linear
Definition VFABIDemangler.h:28
@ OMP_LinearVal
Definition VFABIDemangler.h:30
@ OMP_LinearUValPos
Definition VFABIDemangler.h:35
@ Vector
Definition VFABIDemangler.h:27
@ OMP_LinearPos
Definition VFABIDemangler.h:32
@ OMP_LinearRefPos
Definition VFABIDemangler.h:34
@ OMP_LinearValPos
Definition VFABIDemangler.h:33
@ OMP_LinearUVal
Definition VFABIDemangler.h:31
@ OMP_Uniform
Definition VFABIDemangler.h:36
@ GlobalPredicate
Definition VFABIDemangler.h:37
This struct is a compact representation of a valid (non-zero power of two) alignment.
Holds the VFShape for a specific scalar to vector function mapping.
Definition VFABIDemangler.h:125
bool isMasked() const
Returns true if at least one of the operands to the vectorized function has the kind 'GlobalPredicate...
Definition VFABIDemangler.h:144
std::string VectorName
Scalar Function Name.
Definition VFABIDemangler.h:128
std::optional< unsigned > getParamIndexForOptionalMask() const
Instruction Set Architecture.
Definition VFABIDemangler.h:133
VFISAKind ISA
Vector Function Name associated to this VFInfo.
Definition VFABIDemangler.h:129
std::string ScalarName
Classification of the vector function.
Definition VFABIDemangler.h:127
VFShape Shape
Definition VFABIDemangler.h:126
Encapsulates information needed to describe a parameter.
Definition VFABIDemangler.h:64
int LinearStepOrPos
Definition VFABIDemangler.h:67
bool operator==(const VFParameter &Other) const
Definition VFABIDemangler.h:71
VFParamKind ParamKind
Definition VFABIDemangler.h:66
Align Alignment
Definition VFABIDemangler.h:68
unsigned ParamPos
Definition VFABIDemangler.h:65
Contains the information about the kind of vectorization available.
Definition VFABIDemangler.h:84
LLVM_ABI bool hasValidParameterList() const
Validation check on the Parameters in the VFShape.
ElementCount VF
Definition VFABIDemangler.h:85
void updateParam(VFParameter P)
Update the parameter in position P.ParamPos to P.
Definition VFABIDemangler.h:93
SmallVector< VFParameter, 8 > Parameters
Definition VFABIDemangler.h:86
static VFShape get(const FunctionType *FTy, ElementCount EC, bool HasGlobalPred)
Retrieve the basic vectorization shape of the function, where all parameters are mapped to VFParamKin...
Definition VFABIDemangler.h:109
static VFShape getScalarShape(const FunctionType *FTy)
Retrieve the VFShape that can be used to map a scalar function to itself, with VF = 1.
Definition VFABIDemangler.h:101
bool operator==(const VFShape &Other) const
Definition VFABIDemangler.h:88