MLIR  21.0.0git
LLVM.h
Go to the documentation of this file.
1 //===-- mlir-c/Dialect/LLVM.h - C API for LLVM --------------------*- C -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM
4 // Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef MLIR_C_DIALECT_LLVM_H
11 #define MLIR_C_DIALECT_LLVM_H
12 
13 #include "mlir-c/IR.h"
14 #include "mlir-c/Support.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
21 
22 /// Creates an llvm.ptr type.
23 MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx,
24  unsigned addressSpace);
25 
26 /// Returns `true` if the type is an LLVM dialect pointer type.
28 
29 /// Returns address space of llvm.ptr
30 MLIR_CAPI_EXPORTED unsigned
31 mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType);
32 
33 /// Creates an llmv.void type.
34 MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx);
35 
36 /// Creates an llvm.array type.
37 MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGet(MlirType elementType,
38  unsigned numElements);
39 
40 /// Returns the element type of the llvm.array type.
42 
43 /// Creates an llvm.func type.
44 MLIR_CAPI_EXPORTED MlirType
45 mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes,
46  MlirType const *argumentTypes, bool isVarArg);
47 
48 /// Returns the number of input types.
50 
51 /// Returns the pos-th input type.
53  intptr_t pos);
54 
55 /// Returns the return type of the function type.
57 
58 /// Returns `true` if the type is an LLVM dialect struct type.
60 
61 /// Returns `true` if the type is a literal (unnamed) LLVM struct type.
63 
64 /// Returns the number of fields in the struct. Asserts if the struct is opaque
65 /// or not yet initialized.
67 
68 /// Returns the `positions`-th field of the struct. Asserts if the struct is
69 /// opaque, not yet initialized or if the position is out of range.
71  intptr_t position);
72 
73 /// Returns `true` if the struct is packed.
75 
76 /// Returns the identifier of the identified struct. Asserts that the struct is
77 /// identified, i.e., not literal.
79 
80 /// Returns `true` is the struct is explicitly opaque (will not have a body) or
81 /// uninitialized (will eventually have a body).
83 
84 /// Creates an LLVM literal (unnamed) struct type. This may assert if the fields
85 /// have types not compatible with the LLVM dialect. For a graceful failure, use
86 /// the checked version.
87 MLIR_CAPI_EXPORTED MlirType
88 mlirLLVMStructTypeLiteralGet(MlirContext ctx, intptr_t nFieldTypes,
89  MlirType const *fieldTypes, bool isPacked);
90 
91 /// Creates an LLVM literal (unnamed) struct type if possible. Emits a
92 /// diagnostic at the given location and returns null otherwise.
93 MLIR_CAPI_EXPORTED MlirType
94 mlirLLVMStructTypeLiteralGetChecked(MlirLocation loc, intptr_t nFieldTypes,
95  MlirType const *fieldTypes, bool isPacked);
96 
97 /// Creates an LLVM identified struct type with no body. If a struct type with
98 /// this name already exists in the context, returns that type. Use
99 /// mlirLLVMStructTypeIdentifiedNewGet to create a fresh struct type,
100 /// potentially renaming it. The body should be set separatelty by calling
101 /// mlirLLVMStructTypeSetBody, if it isn't set already.
102 MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeIdentifiedGet(MlirContext ctx,
103  MlirStringRef name);
104 
105 /// Creates an LLVM identified struct type with no body and a name starting with
106 /// the given prefix. If a struct with the exact name as the given prefix
107 /// already exists, appends an unspecified suffix to the name so that the name
108 /// is unique in context.
110  MlirContext ctx, MlirStringRef name, intptr_t nFieldTypes,
111  MlirType const *fieldTypes, bool isPacked);
112 
113 MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeOpaqueGet(MlirContext ctx,
114  MlirStringRef name);
115 
116 /// Sets the body of the identified struct if it hasn't been set yet. Returns
117 /// whether the operation was successful.
119 mlirLLVMStructTypeSetBody(MlirType structType, intptr_t nFieldTypes,
120  MlirType const *fieldTypes, bool isPacked);
121 
170 };
171 typedef enum MlirLLVMCConv MlirLLVMCConv;
172 
173 /// Creates a LLVM CConv attribute.
174 MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMCConvAttrGet(MlirContext ctx,
175  MlirLLVMCConv cconv);
176 
183 };
184 typedef enum MlirLLVMComdat MlirLLVMComdat;
185 
186 /// Creates a LLVM Comdat attribute.
187 MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx,
188  MlirLLVMComdat comdat);
189 
202 };
203 typedef enum MlirLLVMLinkage MlirLLVMLinkage;
204 
205 /// Creates a LLVM Linkage attribute.
206 MLIR_CAPI_EXPORTED MlirAttribute
207 mlirLLVMLinkageAttrGet(MlirContext ctx, MlirLLVMLinkage linkage);
208 
209 /// Creates a LLVM DINullType attribute.
210 MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDINullTypeAttrGet(MlirContext ctx);
211 
212 /// Creates a LLVM DIExpressionElem attribute.
213 MLIR_CAPI_EXPORTED MlirAttribute
214 mlirLLVMDIExpressionElemAttrGet(MlirContext ctx, unsigned int opcode,
215  intptr_t nArguments, uint64_t const *arguments);
216 
217 /// Creates a LLVM DIExpression attribute.
219  MlirContext ctx, intptr_t nOperations, MlirAttribute const *operations);
220 
242 };
244 
245 /// Creates a LLVM DIBasicType attribute.
247  MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
248  MlirLLVMTypeEncoding encoding);
249 
250 /// Creates a self-referencing LLVM DICompositeType attribute.
251 MLIR_CAPI_EXPORTED MlirAttribute
252 mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId);
253 
254 /// Creates a LLVM DICompositeType attribute.
256  MlirContext ctx, MlirAttribute recId, bool isRecSelf, unsigned int tag,
257  MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
258  MlirAttribute baseType, int64_t flags, uint64_t sizeInBits,
259  uint64_t alignInBits, intptr_t nElements, MlirAttribute const *elements,
260  MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
261  MlirAttribute associated);
262 
263 /// Creates a LLVM DIDerivedType attribute. Note that `dwarfAddressSpace` is an
264 /// optional field, where `MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL` indicates null
265 /// and non-negative values indicate a value present.
267  MlirContext ctx, unsigned int tag, MlirAttribute name,
268  MlirAttribute baseType, uint64_t sizeInBits, uint32_t alignInBits,
269  uint64_t offsetInBits, int64_t dwarfAddressSpace, MlirAttribute extraData);
270 
272  MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
273  uint32_t alignInBits, MlirAttribute stringLength,
274  MlirAttribute stringLengthExp, MlirAttribute stringLocationExp,
275  MlirLLVMTypeEncoding encoding);
276 
277 /// Constant to represent std::nullopt for dwarfAddressSpace to omit the field.
278 #define MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL -1
279 
280 /// Gets the base type from a LLVM DIDerivedType attribute.
281 MLIR_CAPI_EXPORTED MlirAttribute
282 mlirLLVMDIDerivedTypeAttrGetBaseType(MlirAttribute diDerivedType);
283 
284 /// Creates a LLVM DIFileAttr attribute.
285 MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFileAttrGet(MlirContext ctx,
286  MlirAttribute name,
287  MlirAttribute directory);
288 
294 };
296 
302 };
304 
305 /// Creates a LLVM DICompileUnit attribute.
307  MlirContext ctx, MlirAttribute id, unsigned int sourceLanguage,
308  MlirAttribute file, MlirAttribute producer, bool isOptimized,
309  MlirLLVMDIEmissionKind emissionKind, MlirLLVMDINameTableKind nameTableKind);
310 
311 /// Creates a LLVM DIFlags attribute.
312 MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFlagsAttrGet(MlirContext ctx,
313  uint64_t value);
314 
315 /// Creates a LLVM DILexicalBlock attribute.
317  MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int line,
318  unsigned int column);
319 
320 /// Creates a LLVM DILexicalBlockFile attribute.
322  MlirContext ctx, MlirAttribute scope, MlirAttribute file,
323  unsigned int discriminator);
324 
325 /// Creates a LLVM DILocalVariableAttr attribute.
327  MlirContext ctx, MlirAttribute scope, MlirAttribute name,
328  MlirAttribute diFile, unsigned int line, unsigned int arg,
329  unsigned int alignInBits, MlirAttribute diType, int64_t flags);
330 
331 /// Creates a self-referencing LLVM DISubprogramAttr attribute.
332 MLIR_CAPI_EXPORTED MlirAttribute
333 mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId);
334 
335 /// Creates a LLVM DISubprogramAttr attribute.
337  MlirContext ctx, MlirAttribute recId, bool isRecSelf, MlirAttribute id,
338  MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
339  MlirAttribute linkageName, MlirAttribute file, unsigned int line,
340  unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,
341  intptr_t nRetainedNodes, MlirAttribute const *retainedNodes,
342  intptr_t nAnnotations, MlirAttribute const *annotations);
343 
344 /// Creates a LLVM DIAnnotation attribute.
346  MlirContext ctx, MlirAttribute name, MlirAttribute value);
347 
348 /// Gets the scope from this DISubprogramAttr.
349 MLIR_CAPI_EXPORTED MlirAttribute
350 mlirLLVMDISubprogramAttrGetScope(MlirAttribute diSubprogram);
351 
352 /// Gets the line from this DISubprogramAttr.
353 MLIR_CAPI_EXPORTED unsigned int
354 mlirLLVMDISubprogramAttrGetLine(MlirAttribute diSubprogram);
355 
356 /// Gets the scope line from this DISubprogram.
357 MLIR_CAPI_EXPORTED unsigned int
358 mlirLLVMDISubprogramAttrGetScopeLine(MlirAttribute diSubprogram);
359 
360 /// Gets the compile unit from this DISubprogram.
361 MLIR_CAPI_EXPORTED MlirAttribute
362 mlirLLVMDISubprogramAttrGetCompileUnit(MlirAttribute diSubprogram);
363 
364 /// Gets the file from this DISubprogramAttr.
365 MLIR_CAPI_EXPORTED MlirAttribute
366 mlirLLVMDISubprogramAttrGetFile(MlirAttribute diSubprogram);
367 
368 /// Gets the type from this DISubprogramAttr.
369 MLIR_CAPI_EXPORTED MlirAttribute
370 mlirLLVMDISubprogramAttrGetType(MlirAttribute diSubprogram);
371 
372 /// Creates a LLVM DISubroutineTypeAttr attribute.
373 MLIR_CAPI_EXPORTED MlirAttribute
374 mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx, unsigned int callingConvention,
375  intptr_t nTypes, MlirAttribute const *types);
376 
377 /// Creates a LLVM DIModuleAttr attribute.
379  MlirContext ctx, MlirAttribute file, MlirAttribute scope,
380  MlirAttribute name, MlirAttribute configMacros, MlirAttribute includePath,
381  MlirAttribute apinotes, unsigned int line, bool isDecl);
382 
383 /// Creates a LLVM DIImportedEntityAttr attribute.
385  MlirContext ctx, unsigned int tag, MlirAttribute scope,
386  MlirAttribute entity, MlirAttribute file, unsigned int line,
387  MlirAttribute name, intptr_t nElements, MlirAttribute const *elements);
388 
389 /// Gets the scope of this DIModuleAttr.
390 MLIR_CAPI_EXPORTED MlirAttribute
391 mlirLLVMDIModuleAttrGetScope(MlirAttribute diModule);
392 
393 #ifdef __cplusplus
394 }
395 #endif
396 
397 #endif // MLIR_C_DIALECT_LLVM_H
MLIR_CAPI_EXPORTED unsigned int mlirLLVMDISubprogramAttrGetScopeLine(MlirAttribute diSubprogram)
Gets the scope line from this DISubprogram.
Definition: LLVM.cpp:356
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompositeTypeAttrGet(MlirContext ctx, MlirAttribute recId, bool isRecSelf, unsigned int tag, MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope, MlirAttribute baseType, int64_t flags, uint64_t sizeInBits, uint64_t alignInBits, intptr_t nElements, MlirAttribute const *elements, MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated, MlirAttribute associated)
Creates a LLVM DICompositeType attribute.
Definition: LLVM.cpp:185
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeIdentifiedNewGet(MlirContext ctx, MlirStringRef name, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM identified struct type with no body and a name starting with the given prefix.
Definition: LLVM.cpp:127
MlirLLVMDINameTableKind
Definition: LLVM.h:297
@ MlirLLVMDINameTableKindNone
Definition: LLVM.h:300
@ MlirLLVMDINameTableKindApple
Definition: LLVM.h:301
@ MlirLLVMDINameTableKindDefault
Definition: LLVM.h:298
@ MlirLLVMDINameTableKindGNU
Definition: LLVM.h:299
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeIdentifiedGet(MlirContext ctx, MlirStringRef name)
Creates an LLVM identified struct type with no body.
Definition: LLVM.cpp:123
MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMPointerType(MlirType type)
Returns true if the type is an LLVM dialect pointer type.
Definition: LLVM.cpp:30
MLIR_CAPI_EXPORTED MlirLogicalResult mlirLLVMStructTypeSetBody(MlirType structType, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Sets the body of the identified struct if it hasn't been set yet.
Definition: LLVM.cpp:137
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIDerivedTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, MlirAttribute baseType, uint64_t sizeInBits, uint32_t alignInBits, uint64_t offsetInBits, int64_t dwarfAddressSpace, MlirAttribute extraData)
Creates a LLVM DIDerivedType attribute.
Definition: LLVM.cpp:208
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMCConvAttrGet(MlirContext ctx, MlirLLVMCConv cconv)
Creates a LLVM CConv attribute.
Definition: LLVM.cpp:238
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGetInput(MlirType type, intptr_t pos)
Returns the pos-th input type.
Definition: LLVM.cpp:62
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx, unsigned addressSpace)
Creates an llvm.ptr type.
Definition: LLVM.cpp:26
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGetElementType(MlirType type)
Returns the element type of the llvm.array type.
Definition: LLVM.cpp:46
MlirLLVMLinkage
Definition: LLVM.h:190
@ MlirLLVMLinkageExternal
Definition: LLVM.h:191
@ MlirLLVMLinkageLinkonce
Definition: LLVM.h:193
@ MlirLLVMLinkageExternWeak
Definition: LLVM.h:200
@ MlirLLVMLinkageWeakODR
Definition: LLVM.h:196
@ MlirLLVMLinkageCommon
Definition: LLVM.h:201
@ MlirLLVMLinkageWeak
Definition: LLVM.h:195
@ MlirLLVMLinkageAppending
Definition: LLVM.h:197
@ MlirLLVMLinkageAvailableExternally
Definition: LLVM.h:192
@ MlirLLVMLinkageLinkonceODR
Definition: LLVM.h:194
@ MlirLLVMLinkageInternal
Definition: LLVM.h:198
@ MlirLLVMLinkagePrivate
Definition: LLVM.h:199
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsLiteral(MlirType type)
Returns true if the type is a literal (unnamed) LLVM struct type.
Definition: LLVM.cpp:76
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGet(MlirType elementType, unsigned numElements)
Creates an llvm.array type.
Definition: LLVM.cpp:42
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMLinkageAttrGet(MlirContext ctx, MlirLLVMLinkage linkage)
Creates a LLVM Linkage attribute.
Definition: LLVM.cpp:246
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMStructTypeGetIdentifier(MlirType type)
Returns the identifier of the identified struct.
Definition: LLVM.cpp:92
MlirLLVMComdat
Definition: LLVM.h:177
@ MlirLLVMComdatSameSize
Definition: LLVM.h:182
@ MlirLLVMComdatExactMatch
Definition: LLVM.h:179
@ MlirLLVMComdatNoDeduplicate
Definition: LLVM.h:181
@ MlirLLVMComdatAny
Definition: LLVM.h:178
@ MlirLLVMComdatLargest
Definition: LLVM.h:180
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsOpaque(MlirType type)
Returns true is the struct is explicitly opaque (will not have a body) or uninitialized (will eventua...
Definition: LLVM.cpp:96
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsPacked(MlirType type)
Returns true if the struct is packed.
Definition: LLVM.cpp:88
MLIR_CAPI_EXPORTED intptr_t mlirLLVMStructTypeGetNumElementTypes(MlirType type)
Returns the number of fields in the struct.
Definition: LLVM.cpp:80
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIExpressionAttrGet(MlirContext ctx, intptr_t nOperations, MlirAttribute const *operations)
Creates a LLVM DIExpression attribute.
Definition: LLVM.cpp:155
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetScope(MlirAttribute diSubprogram)
Gets the scope from this DISubprogramAttr.
Definition: LLVM.cpp:348
MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx)
Creates an llmv.void type.
Definition: LLVM.cpp:38
MLIR_CAPI_EXPORTED intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type)
Returns the number of input types.
Definition: LLVM.cpp:58
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx, unsigned int callingConvention, intptr_t nTypes, MlirAttribute const *types)
Creates a LLVM DISubroutineTypeAttr attribute.
Definition: LLVM.cpp:302
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetFile(MlirAttribute diSubprogram)
Gets the file from this DISubprogramAttr.
Definition: LLVM.cpp:365
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeGetElementType(MlirType type, intptr_t position)
Returns the positions-th field of the struct.
Definition: LLVM.cpp:84
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILocalVariableAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute name, MlirAttribute diFile, unsigned int line, unsigned int arg, unsigned int alignInBits, MlirAttribute diType, int64_t flags)
Creates a LLVM DILocalVariableAttr attribute.
Definition: LLVM.cpp:292
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGet(MlirContext ctx, MlirAttribute recId, bool isRecSelf, MlirAttribute id, MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name, MlirAttribute linkageName, MlirAttribute file, unsigned int line, unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type, intptr_t nRetainedNodes, MlirAttribute const *retainedNodes, intptr_t nAnnotations, MlirAttribute const *annotations)
Creates a LLVM DISubprogramAttr attribute.
Definition: LLVM.cpp:319
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILexicalBlockFileAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int discriminator)
Creates a LLVM DILexicalBlockFile attribute.
Definition: LLVM.cpp:283
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIBasicTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits, MlirLLVMTypeEncoding encoding)
Creates a LLVM DIBasicType attribute.
Definition: LLVM.cpp:171
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFileAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute directory)
Creates a LLVM DIFileAttr attribute.
Definition: LLVM.cpp:250
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx, MlirLLVMComdat comdat)
Creates a LLVM Comdat attribute.
Definition: LLVM.cpp:242
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLVM, llvm)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIModuleAttrGetScope(MlirAttribute diModule)
Gets the scope of this DIModuleAttr.
Definition: LLVM.cpp:387
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeOpaqueGet(MlirContext ctx, MlirStringRef name)
Definition: LLVM.cpp:119
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes, MlirType const *argumentTypes, bool isVarArg)
Creates an llvm.func type.
Definition: LLVM.cpp:50
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DICompositeType attribute.
Definition: LLVM.cpp:180
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFlagsAttrGet(MlirContext ctx, uint64_t value)
Creates a LLVM DIFlags attribute.
Definition: LLVM.cpp:269
MlirLLVMCConv
Definition: LLVM.h:122
@ MlirLLVMCConvPTX_Device
Definition: LLVM.h:144
@ MlirLLVMCConvWASM_EmscriptenInvoke
Definition: LLVM.h:167
@ MlirLLVMCConvX86_VectorCall
Definition: LLVM.h:150
@ MlirLLVMCConvARM_AAPCS_VFP
Definition: LLVM.h:140
@ MlirLLVMCConvMSP430_BUILTIN
Definition: LLVM.h:162
@ MlirLLVMCConvX86_FastCall
Definition: LLVM.h:137
@ MlirLLVMCConvHiPE
Definition: LLVM.h:127
@ MlirLLVMCConvAMDGPU_HS
Definition: LLVM.h:161
@ MlirLLVMCConvPreserveMost
Definition: LLVM.h:129
@ MlirLLVMCConvX86_ThisCall
Definition: LLVM.h:142
@ MlirLLVMCConvPTX_Kernel
Definition: LLVM.h:143
@ MlirLLVMCConvAMDGPU_KERNEL
Definition: LLVM.h:159
@ MlirLLVMCConvCFGuard_Check
Definition: LLVM.h:134
@ MlirLLVMCConvAMDGPU_ES
Definition: LLVM.h:164
@ MlirLLVMCConvSPIR_FUNC
Definition: LLVM.h:145
@ MlirLLVMCConvAMDGPU_LS
Definition: LLVM.h:163
@ MlirLLVMCConvDUMMY_HHVM_C
Definition: LLVM.h:152
@ MlirLLVMCConvCold
Definition: LLVM.h:125
@ MlirLLVMCConvWin64
Definition: LLVM.h:149
@ MlirLLVMCConvX86_INTR
Definition: LLVM.h:153
@ MlirLLVMCConvAnyReg
Definition: LLVM.h:128
@ MlirLLVMCConvDUMMY_HHVM
Definition: LLVM.h:151
@ MlirLLVMCConvTail
Definition: LLVM.h:133
@ MlirLLVMCConvCXX_FAST_TLS
Definition: LLVM.h:132
@ MlirLLVMCConvAVR_INTR
Definition: LLVM.h:154
@ MlirLLVMCConvSwift
Definition: LLVM.h:131
@ MlirLLVMCConvPreserveAll
Definition: LLVM.h:130
@ MlirLLVMCConvFast
Definition: LLVM.h:124
@ MlirLLVMCConvC
Definition: LLVM.h:123
@ MlirLLVMCConvAMDGPU_Gfx
Definition: LLVM.h:168
@ MlirLLVMCConvX86_RegCall
Definition: LLVM.h:160
@ MlirLLVMCConvAMDGPU_VS
Definition: LLVM.h:156
@ MlirLLVMCConvAArch64_VectorCall
Definition: LLVM.h:165
@ MlirLLVMCConvAMDGPU_CS
Definition: LLVM.h:158
@ MlirLLVMCConvGHC
Definition: LLVM.h:126
@ MlirLLVMCConvAArch64_SVE_VectorCall
Definition: LLVM.h:166
@ MlirLLVMCConvX86_StdCall
Definition: LLVM.h:136
@ MlirLLVMCConvAMDGPU_GS
Definition: LLVM.h:157
@ MlirLLVMCConvMSP430_INTR
Definition: LLVM.h:141
@ MlirLLVMCConvM68k_INTR
Definition: LLVM.h:169
@ MlirLLVMCConvARM_AAPCS
Definition: LLVM.h:139
@ MlirLLVMCConvAVR_BUILTIN
Definition: LLVM.h:155
@ MlirLLVMCConvX86_64_SysV
Definition: LLVM.h:148
@ MlirLLVMCConvSPIR_KERNEL
Definition: LLVM.h:146
@ MlirLLVMCConvSwiftTail
Definition: LLVM.h:135
@ MlirLLVMCConvIntel_OCL_BI
Definition: LLVM.h:147
@ MlirLLVMCConvARM_APCS
Definition: LLVM.h:138
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DISubprogramAttr attribute.
Definition: LLVM.cpp:315
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeLiteralGet(MlirContext ctx, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type.
Definition: LLVM.cpp:100
MlirLLVMDIEmissionKind
Definition: LLVM.h:289
@ MlirLLVMDIEmissionKindLineTablesOnly
Definition: LLVM.h:292
@ MlirLLVMDIEmissionKindFull
Definition: LLVM.h:291
@ MlirLLVMDIEmissionKindNone
Definition: LLVM.h:290
@ MlirLLVMDIEmissionKindDebugDirectivesOnly
Definition: LLVM.h:293
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIDerivedTypeAttrGetBaseType(MlirAttribute diDerivedType)
Gets the base type from a LLVM DIDerivedType attribute.
Definition: LLVM.cpp:234
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIAnnotationAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute value)
Creates a LLVM DIAnnotation attribute.
Definition: LLVM.cpp:405
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIImportedEntityAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute scope, MlirAttribute entity, MlirAttribute file, unsigned int line, MlirAttribute name, intptr_t nElements, MlirAttribute const *elements)
Creates a LLVM DIImportedEntityAttr attribute.
Definition: LLVM.cpp:391
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILexicalBlockAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int line, unsigned int column)
Creates a LLVM DILexicalBlock attribute.
Definition: LLVM.cpp:273
MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMStructType(MlirType type)
Returns true if the type is an LLVM dialect struct type.
Definition: LLVM.cpp:72
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIExpressionElemAttrGet(MlirContext ctx, unsigned int opcode, intptr_t nArguments, uint64_t const *arguments)
Creates a LLVM DIExpressionElem attribute.
Definition: LLVM.cpp:147
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompileUnitAttrGet(MlirContext ctx, MlirAttribute id, unsigned int sourceLanguage, MlirAttribute file, MlirAttribute producer, bool isOptimized, MlirLLVMDIEmissionKind emissionKind, MlirLLVMDINameTableKind nameTableKind)
Creates a LLVM DICompileUnit attribute.
Definition: LLVM.cpp:257
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetCompileUnit(MlirAttribute diSubprogram)
Gets the compile unit from this DISubprogram.
Definition: LLVM.cpp:361
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeLiteralGetChecked(MlirLocation loc, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type if possible.
Definition: LLVM.cpp:109
MlirLLVMTypeEncoding
Definition: LLVM.h:221
@ MlirLLVMTypeEncodingComplexFloat
Definition: LLVM.h:224
@ MlirLLVMTypeEncodingDecimalFloat
Definition: LLVM.h:236
@ MlirLLVMTypeEncodingLoUser
Definition: LLVM.h:240
@ MlirLLVMTypeEncodingUnsigned
Definition: LLVM.h:228
@ MlirLLVMTypeEncodingSignedFixed
Definition: LLVM.h:234
@ MlirLLVMTypeEncodingASCII
Definition: LLVM.h:239
@ MlirLLVMTypeEncodingUTF
Definition: LLVM.h:237
@ MlirLLVMTypeEncodingBoolean
Definition: LLVM.h:223
@ MlirLLVMTypeEncodingPackedDecimal
Definition: LLVM.h:231
@ MlirLLVMTypeEncodingHiUser
Definition: LLVM.h:241
@ MlirLLVMTypeEncodingAddress
Definition: LLVM.h:222
@ MlirLLVMTypeEncodingImaginaryFloat
Definition: LLVM.h:230
@ MlirLLVMTypeEncodingUnsignedChar
Definition: LLVM.h:229
@ MlirLLVMTypeEncodingUCS
Definition: LLVM.h:238
@ MlirLLVMTypeEncodingNumericString
Definition: LLVM.h:232
@ MlirLLVMTypeEncodingSignedChar
Definition: LLVM.h:227
@ MlirLLVMTypeEncodingEdited
Definition: LLVM.h:233
@ MlirLLVMTypeEncodingUnsignedFixed
Definition: LLVM.h:235
@ MlirLLVMTypeEncodingSigned
Definition: LLVM.h:226
@ MlirLLVMTypeEncodingFloatT
Definition: LLVM.h:225
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDINullTypeAttrGet(MlirContext ctx)
Creates a LLVM DINullType attribute.
Definition: LLVM.cpp:167
MLIR_CAPI_EXPORTED unsigned int mlirLLVMDISubprogramAttrGetLine(MlirAttribute diSubprogram)
Gets the line from this DISubprogramAttr.
Definition: LLVM.cpp:352
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetType(MlirAttribute diSubprogram)
Gets the type from this DISubprogramAttr.
Definition: LLVM.cpp:369
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGetReturnType(MlirType type)
Returns the return type of the function type.
Definition: LLVM.cpp:68
MLIR_CAPI_EXPORTED unsigned mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType)
Returns address space of llvm.ptr.
Definition: LLVM.cpp:34
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIStringTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits, uint32_t alignInBits, MlirAttribute stringLength, MlirAttribute stringLengthExp, MlirAttribute stringLocationExp, MlirLLVMTypeEncoding encoding)
Definition: LLVM.cpp:221
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIModuleAttrGet(MlirContext ctx, MlirAttribute file, MlirAttribute scope, MlirAttribute name, MlirAttribute configMacros, MlirAttribute includePath, MlirAttribute apinotes, unsigned int line, bool isDecl)
Creates a LLVM DIModuleAttr attribute.
Definition: LLVM.cpp:373
#define MLIR_CAPI_EXPORTED
Definition: Support.h:46
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition: CallGraph.h:229
A logical result value, essentially a boolean with named states.
Definition: Support.h:116
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition: Support.h:73