10#ifndef MLIR_C_DIALECT_LLVM_H
11#define MLIR_C_DIALECT_LLVM_H
24 unsigned addressSpace);
44 unsigned numElements);
54 MlirType
const *argumentTypes,
bool isVarArg);
103 MlirType
const *fieldTypes,
bool isPacked);
109 MlirType
const *fieldTypes,
bool isPacked);
125 MlirType
const *fieldTypes,
bool isPacked);
134 MlirType
const *fieldTypes,
bool isPacked);
237 intptr_t nArguments, uint64_t
const *arguments);
243 MlirContext ctx,
intptr_t nOperations, MlirAttribute
const *operations);
273 MlirContext ctx,
unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
284 MlirContext ctx, MlirAttribute recId,
bool isRecSelf,
unsigned int tag,
285 MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
286 MlirAttribute baseType,
int64_t flags, uint64_t sizeInBits,
287 uint64_t alignInBits,
intptr_t nElements, MlirAttribute
const *elements,
288 MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
289 MlirAttribute associated);
297 MlirContext ctx,
unsigned int tag, MlirAttribute name,
298 MlirAttribute baseType, uint64_t sizeInBits, uint32_t alignInBits,
299 uint64_t offsetInBits,
int64_t dwarfAddressSpace, MlirAttribute extraData);
304 MlirContext ctx,
unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
305 uint32_t alignInBits, MlirAttribute stringLength,
306 MlirAttribute stringLengthExp, MlirAttribute stringLocationExp,
312#define MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL -1
321 MlirAttribute directory);
343 MlirContext ctx, MlirAttribute
id,
unsigned int sourceLanguage,
344 MlirAttribute file, MlirAttribute producer,
bool isOptimized,
346 MlirAttribute splitDebugFilename);
358 MlirContext ctx, MlirAttribute scope, MlirAttribute file,
unsigned int line,
359 unsigned int column);
365 MlirContext ctx, MlirAttribute scope, MlirAttribute file,
366 unsigned int discriminator);
372 MlirContext ctx, MlirAttribute scope, MlirAttribute name,
373 MlirAttribute diFile,
unsigned int line,
unsigned int arg,
374 unsigned int alignInBits, MlirAttribute diType,
int64_t flags);
384 MlirContext ctx, MlirAttribute recId,
bool isRecSelf, MlirAttribute
id,
385 MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
386 MlirAttribute linkageName, MlirAttribute file,
unsigned int line,
387 unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,
388 intptr_t nRetainedNodes, MlirAttribute
const *retainedNodes,
389 intptr_t nAnnotations, MlirAttribute
const *annotations);
395 MlirContext ctx, MlirAttribute name, MlirAttribute value);
426 intptr_t nTypes, MlirAttribute
const *types);
432 MlirContext ctx, MlirAttribute file, MlirAttribute scope,
433 MlirAttribute name, MlirAttribute configMacros, MlirAttribute includePath,
434 MlirAttribute apinotes,
unsigned int line,
bool isDecl);
440 MlirContext ctx,
unsigned int tag, MlirAttribute scope,
441 MlirAttribute entity, MlirAttribute file,
unsigned int line,
442 MlirAttribute name,
intptr_t nElements, MlirAttribute
const *elements);
454#include "mlir/Dialect/LLVMIR/Transforms/Passes.capi.h.inc"
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDISubprogramAttrGetName(void)
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 MlirStringRef mlirLLVMDIStringTypeAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMLinkageAttrGetName(void)
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 MlirStringRef mlirLLVMStructTypeGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDILocalVariableAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMFunctionTypeGetName(void)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMCConvAttrGet(MlirContext ctx, MlirLLVMCConv cconv)
Creates a LLVM CConv attribute.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDIAnnotationAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDIFileAttrGetName(void)
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGetInput(MlirType type, intptr_t pos)
Returns the pos-th input type.
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx, unsigned addressSpace)
Creates an llvm.ptr type.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDIExpressionAttrGetName(void)
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGetElementType(MlirType type)
Returns the element type of the llvm.array 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.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDICompositeTypeAttrGetName(void)
@ 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 MlirStringRef mlirLLVMDILexicalBlockAttrGetName(void)
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 MlirTypeID mlirLLVMPointerTypeGetTypeID(void)
MLIR_CAPI_EXPORTED MlirTypeID mlirLLVMStructTypeGetTypeID(void)
MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx)
Creates an llmv.void type.
MLIR_CAPI_EXPORTED intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type)
Returns the number of input types.
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 MlirStringRef mlirLLVMDIModuleAttrGetName(void)
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 MlirStringRef mlirLLVMDICompileUnitAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMArrayTypeGetName(void)
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 MlirStringRef mlirLLVMDIFlagsAttrGetName(void)
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 MlirStringRef mlirLLVMDIDerivedTypeAttrGetName(void)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx, MlirLLVMComdat comdat)
Creates a LLVM Comdat attribute.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMPointerTypeGetName(void)
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.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDISubroutineTypeAttrGetName(void)
@ 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 MlirStringRef mlirLLVMComdatAttrGetName(void)
MLIR_CAPI_EXPORTED MlirType mlirLLVMStructTypeLiteralGet(MlirContext ctx, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDIImportedEntityAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDINullTypeAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMCConvAttrGetName(void)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompileUnitAttrGet(MlirContext ctx, MlirAttribute id, unsigned int sourceLanguage, MlirAttribute file, MlirAttribute producer, bool isOptimized, MlirLLVMDIEmissionKind emissionKind, MlirLLVMDINameTableKind nameTableKind, MlirAttribute splitDebugFilename)
Creates a LLVM DICompileUnit attribute.
@ 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 MlirStringRef mlirLLVMDIExpressionElemAttrGetName(void)
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 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 MlirStringRef mlirLLVMDIBasicTypeAttrGetName(void)
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGetType(MlirAttribute diSubprogram)
Gets the type from this DISubprogramAttr.
MLIR_CAPI_EXPORTED MlirType mlirLLVMFunctionTypeGetReturnType(MlirType type)
Returns the return type of the function type.
MLIR_CAPI_EXPORTED unsigned mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType)
Returns address space of llvm.ptr.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMDILexicalBlockFileAttrGetName(void)
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.
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMVoidTypeGetName(void)
#define MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Name, Namespace)
#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.