27 static constexpr llvm::StringRef
kPrintI64 =
"printI64";
28 static constexpr llvm::StringRef
kPrintU64 =
"printU64";
29 static constexpr llvm::StringRef
kPrintF16 =
"printF16";
30 static constexpr llvm::StringRef
kPrintBF16 =
"printBF16";
31 static constexpr llvm::StringRef
kPrintF32 =
"printF32";
32 static constexpr llvm::StringRef
kPrintF64 =
"printF64";
34 static constexpr llvm::StringRef
kPrintOpen =
"printOpen";
38 static constexpr llvm::StringRef
kMalloc =
"malloc";
40 static constexpr llvm::StringRef
kFree =
"free";
41 static constexpr llvm::StringRef
kGenericAlloc =
"_mlir_memref_to_llvm_alloc";
43 "_mlir_memref_to_llvm_aligned_alloc";
44 static constexpr llvm::StringRef
kGenericFree =
"_mlir_memref_to_llvm_free";
50 Type resultType,
bool isVarArg) {
51 auto func = moduleOp.lookupSymbol<LLVM::LLVMFuncOp>(name);
55 return b.
create<LLVM::LLVMFuncOp>(
56 moduleOp->getLoc(), name,
106 ModuleOp moduleOp, std::optional<StringRef> runtimeFunctionName) {
160 {indexType, indexType},
172 Type unrankedDescriptorType) {
175 ArrayRef<Type>{indexType, unrankedDescriptorType, unrankedDescriptorType},
static LLVM::LLVMPointerType getVoidPtr(MLIRContext *context)
static constexpr llvm::StringRef kPrintI64
Helper functions to lookup or create the declaration for commonly used external C function calls.
static constexpr llvm::StringRef kFree
static constexpr llvm::StringRef kPrintU64
static constexpr llvm::StringRef kPrintBF16
static constexpr llvm::StringRef kPrintString
static constexpr llvm::StringRef kGenericAlignedAlloc
static constexpr llvm::StringRef kAlignedAlloc
static constexpr llvm::StringRef kPrintClose
static constexpr llvm::StringRef kMalloc
static constexpr llvm::StringRef kMemRefCopy
static constexpr llvm::StringRef kPrintComma
static constexpr llvm::StringRef kGenericAlloc
static constexpr llvm::StringRef kPrintNewline
static LLVM::LLVMPointerType getCharPtr(MLIRContext *context)
static constexpr llvm::StringRef kPrintOpen
static constexpr llvm::StringRef kGenericFree
static constexpr llvm::StringRef kPrintF16
static constexpr llvm::StringRef kPrintF32
static constexpr llvm::StringRef kPrintF64
MLIRContext is the top-level object for a collection of MLIR operations.
This class helps build Operations.
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
LLVM::LLVMFuncOp lookupOrCreateGenericFreeFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateAlignedAllocFn(ModuleOp moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreateMemRefCopyFn(ModuleOp moduleOp, Type indexType, Type unrankedDescriptorType)
LLVM::LLVMFuncOp lookupOrCreatePrintF16Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateGenericAlignedAllocFn(ModuleOp moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreateFreeFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintStringFn(ModuleOp moduleOp, std::optional< StringRef > runtimeFunctionName={})
Declares a function to print a C-string.
LLVM::LLVMFuncOp lookupOrCreateMallocFn(ModuleOp moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreatePrintU64Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintF64Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateGenericAllocFn(ModuleOp moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreatePrintNewlineFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintBF16Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintCommaFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintCloseFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintF32Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintOpenFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateFn(ModuleOp moduleOp, StringRef name, ArrayRef< Type > paramTypes={}, Type resultType={}, bool isVarArg=false)
Create a FuncOp with signature resultType(paramTypes)and namename`.
LLVM::LLVMFuncOp lookupOrCreatePrintI64Fn(ModuleOp moduleOp)
Helper functions to lookup or create the declaration for commonly used external C function calls.
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...