10 #ifndef MLIR_C_DIALECT_LLVM_H
11 #define MLIR_C_DIALECT_LLVM_H
24 unsigned addressSpace);
38 unsigned numElements);
43 MlirType
const *argumentTypes,
bool isVarArg);
76 MlirType
const *fieldTypes,
bool isPacked);
82 MlirType
const *fieldTypes,
bool isPacked);
98 MlirType
const *fieldTypes,
bool isPacked);
107 MlirType
const *fieldTypes,
bool isPacked);
202 intptr_t nArguments, uint64_t
const *arguments);
206 MlirContext ctx, intptr_t nOperations, MlirAttribute
const *operations);
234 MlirContext ctx,
unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
243 MlirContext ctx, MlirAttribute recId,
bool isRecSelf,
unsigned int tag,
244 MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
245 MlirAttribute baseType, int64_t flags, uint64_t sizeInBits,
246 uint64_t alignInBits, intptr_t nElements, MlirAttribute
const *elements,
247 MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
248 MlirAttribute associated);
254 MlirContext ctx,
unsigned int tag, MlirAttribute name,
255 MlirAttribute baseType, uint64_t sizeInBits, uint32_t alignInBits,
256 uint64_t offsetInBits, int64_t dwarfAddressSpace, MlirAttribute extraData);
259 MlirContext ctx,
unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
260 uint32_t alignInBits, MlirAttribute stringLength,
261 MlirAttribute stringLengthExp, MlirAttribute stringLocationExp,
265 #define MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL -1
274 MlirAttribute directory);
294 MlirContext ctx, MlirAttribute
id,
unsigned int sourceLanguage,
295 MlirAttribute file, MlirAttribute producer,
bool isOptimized,
304 MlirContext ctx, MlirAttribute scope, MlirAttribute file,
unsigned int line,
305 unsigned int column);
309 MlirContext ctx, MlirAttribute scope, MlirAttribute file,
310 unsigned int discriminator);
314 MlirContext ctx, MlirAttribute scope, MlirAttribute name,
315 MlirAttribute diFile,
unsigned int line,
unsigned int arg,
316 unsigned int alignInBits, MlirAttribute diType, int64_t flags);
324 MlirContext ctx, MlirAttribute recId,
bool isRecSelf, MlirAttribute
id,
325 MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
326 MlirAttribute linkageName, MlirAttribute file,
unsigned int line,
327 unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,
328 intptr_t nRetainedNodes, MlirAttribute
const *retainedNodes,
329 intptr_t nAnnotations, MlirAttribute
const *annotations);
333 MlirContext ctx, MlirAttribute name, MlirAttribute value);
362 intptr_t nTypes, MlirAttribute
const *types);
366 MlirContext ctx, MlirAttribute file, MlirAttribute scope,
367 MlirAttribute name, MlirAttribute configMacros, MlirAttribute includePath,
368 MlirAttribute apinotes,
unsigned int line,
bool isDecl);
372 MlirContext ctx,
unsigned int tag, MlirAttribute scope,
373 MlirAttribute entity, MlirAttribute file,
unsigned int line,
374 MlirAttribute name, intptr_t nElements, MlirAttribute
const *elements);
MLIR_CAPI_EXPORTED unsigned int mlirLLVMDISubprogramAttrGetScopeLine(MlirAttribute diSubprogram)
Gets the scope line from this DISubprogram.
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.
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.
@ MlirLLVMDINameTableKindNone
@ MlirLLVMDINameTableKindApple
@ MlirLLVMDINameTableKindDefault
@ MlirLLVMDINameTableKindGNU
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeIdentifiedGet(MlirContext ctx, MlirStringRef name)
Creates an LLVM identified struct type with no body.
MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMPointerType(MlirType type)
Returns true if the type is an LLVM dialect pointer type.
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.
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.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMCConvAttrGet(MlirContext ctx, MlirLLVMCConv cconv)
Creates a LLVM CConv attribute.
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx, unsigned addressSpace)
Creates an llvm.ptr type.
@ MlirLLVMLinkageExternal
@ MlirLLVMLinkageLinkonce
@ MlirLLVMLinkageExternWeak
@ MlirLLVMLinkageAppending
@ MlirLLVMLinkageAvailableExternally
@ MlirLLVMLinkageLinkonceODR
@ MlirLLVMLinkageInternal
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsLiteral(MlirType type)
Returns true if the type is a literal (unnamed) LLVM struct type.
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGet(MlirType elementType, unsigned numElements)
Creates an llvm.array type.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMLinkageAttrGet(MlirContext ctx, MlirLLVMLinkage linkage)
Creates a LLVM Linkage attribute.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMStructTypeGetIdentifier(MlirType type)
Returns the identifier of the identified struct.
@ MlirLLVMComdatExactMatch
@ MlirLLVMComdatNoDeduplicate
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsOpaque(MlirType type)
Returns true is the struct is explicitly opaque (will not have a body) or uninitialized (will eventua...
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsPacked(MlirType type)
Returns true if the struct is packed.
MLIR_CAPI_EXPORTED intptr_t mlirLLVMStructTypeGetNumElementTypes(MlirType type)
Returns the number of fields in the struct.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIExpressionAttrGet(MlirContext ctx, intptr_t nOperations, MlirAttribute const *operations)
Creates a LLVM DIExpression attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetScope(MlirAttribute diSubprogram)
Gets the scope from this DISubprogramAttr.
MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx)
Creates an llmv.void type.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx, unsigned int callingConvention, intptr_t nTypes, MlirAttribute const *types)
Creates a LLVM DISubroutineTypeAttr attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetFile(MlirAttribute diSubprogram)
Gets the file from this DISubprogramAttr.
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeGetElementType(MlirType type, intptr_t position)
Returns the positions-th field of the struct.
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.
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.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILexicalBlockFileAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int discriminator)
Creates a LLVM DILexicalBlockFile attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIBasicTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits, MlirLLVMTypeEncoding encoding)
Creates a LLVM DIBasicType attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFileAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute directory)
Creates a LLVM DIFileAttr attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx, MlirLLVMComdat comdat)
Creates a LLVM Comdat attribute.
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLVM, llvm)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIModuleAttrGetScope(MlirAttribute diModule)
Gets the scope of this DIModuleAttr.
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeOpaqueGet(MlirContext ctx, MlirStringRef name)
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes, MlirType const *argumentTypes, bool isVarArg)
Creates an llvm.func type.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DICompositeType attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIFlagsAttrGet(MlirContext ctx, uint64_t value)
Creates a LLVM DIFlags attribute.
@ MlirLLVMCConvPTX_Device
@ MlirLLVMCConvWASM_EmscriptenInvoke
@ MlirLLVMCConvX86_VectorCall
@ MlirLLVMCConvARM_AAPCS_VFP
@ MlirLLVMCConvMSP430_BUILTIN
@ MlirLLVMCConvX86_FastCall
@ MlirLLVMCConvPreserveMost
@ MlirLLVMCConvX86_ThisCall
@ MlirLLVMCConvPTX_Kernel
@ MlirLLVMCConvAMDGPU_KERNEL
@ MlirLLVMCConvCFGuard_Check
@ MlirLLVMCConvDUMMY_HHVM_C
@ MlirLLVMCConvDUMMY_HHVM
@ MlirLLVMCConvCXX_FAST_TLS
@ MlirLLVMCConvPreserveAll
@ MlirLLVMCConvAMDGPU_Gfx
@ MlirLLVMCConvX86_RegCall
@ MlirLLVMCConvAArch64_VectorCall
@ MlirLLVMCConvAArch64_SVE_VectorCall
@ MlirLLVMCConvX86_StdCall
@ MlirLLVMCConvMSP430_INTR
@ MlirLLVMCConvAVR_BUILTIN
@ MlirLLVMCConvX86_64_SysV
@ MlirLLVMCConvSPIR_KERNEL
@ MlirLLVMCConvIntel_OCL_BI
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DISubprogramAttr attribute.
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeLiteralGet(MlirContext ctx, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type.
@ MlirLLVMDIEmissionKindLineTablesOnly
@ MlirLLVMDIEmissionKindFull
@ MlirLLVMDIEmissionKindNone
@ MlirLLVMDIEmissionKindDebugDirectivesOnly
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIDerivedTypeAttrGetBaseType(MlirAttribute diDerivedType)
Gets the base type from a LLVM DIDerivedType attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIAnnotationAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute value)
Creates a LLVM DIAnnotation attribute.
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.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDILexicalBlockAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int line, unsigned int column)
Creates a LLVM DILexicalBlock attribute.
MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMStructType(MlirType type)
Returns true if the type is an LLVM dialect struct type.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIExpressionElemAttrGet(MlirContext ctx, unsigned int opcode, intptr_t nArguments, uint64_t const *arguments)
Creates a LLVM DIExpressionElem attribute.
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.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetCompileUnit(MlirAttribute diSubprogram)
Gets the compile unit from this DISubprogram.
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeLiteralGetChecked(MlirLocation loc, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type if possible.
@ MlirLLVMTypeEncodingComplexFloat
@ MlirLLVMTypeEncodingDecimalFloat
@ MlirLLVMTypeEncodingLoUser
@ MlirLLVMTypeEncodingUnsigned
@ MlirLLVMTypeEncodingSignedFixed
@ MlirLLVMTypeEncodingASCII
@ MlirLLVMTypeEncodingUTF
@ MlirLLVMTypeEncodingBoolean
@ MlirLLVMTypeEncodingPackedDecimal
@ MlirLLVMTypeEncodingHiUser
@ MlirLLVMTypeEncodingAddress
@ MlirLLVMTypeEncodingImaginaryFloat
@ MlirLLVMTypeEncodingUnsignedChar
@ MlirLLVMTypeEncodingUCS
@ MlirLLVMTypeEncodingNumericString
@ MlirLLVMTypeEncodingSignedChar
@ MlirLLVMTypeEncodingEdited
@ MlirLLVMTypeEncodingUnsignedFixed
@ MlirLLVMTypeEncodingSigned
@ MlirLLVMTypeEncodingFloatT
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDINullTypeAttrGet(MlirContext ctx)
Creates a LLVM DINullType attribute.
MLIR_CAPI_EXPORTED unsigned int mlirLLVMDISubprogramAttrGetLine(MlirAttribute diSubprogram)
Gets the line from this DISubprogramAttr.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetType(MlirAttribute diSubprogram)
Gets the type from this DISubprogramAttr.
MLIR_CAPI_EXPORTED unsigned mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType)
Returns address space of llvm.ptr.
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)
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.
#define MLIR_CAPI_EXPORTED
The OpAsmOpInterface, see OpAsmInterface.td for more details.
A logical result value, essentially a boolean with named states.
A pointer to a sized fragment of a string, not necessarily null-terminated.