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";
51 Type resultType,
bool isVarArg) {
53 "expected SymbolTable operation");
54 auto func = llvm::dyn_cast_or_null<LLVM::LLVMFuncOp>(
59 return b.
create<LLVM::LLVMFuncOp>(
110 Operation *moduleOp, std::optional<StringRef> runtimeFunctionName) {
164 {indexType, indexType},
176 Type unrankedDescriptorType) {
179 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.
A trait used to provide symbol table functionalities to a region operation.
Operation is the basic unit of execution within MLIR.
bool hasTrait()
Returns true if the operation was registered with a particular trait, e.g.
MLIRContext * getContext()
Return the context this operation is associated with.
Location getLoc()
The source location the operation was defined or derived from.
Region & getRegion(unsigned index)
Returns the region held by this operation at position 'index'.
static Operation * lookupSymbolIn(Operation *op, StringAttr symbol)
Returns the operation registered with the given symbol name with the regions of 'symbolTableOp'.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
LLVM::LLVMFuncOp lookupOrCreateMemRefCopyFn(Operation *moduleOp, Type indexType, Type unrankedDescriptorType)
LLVM::LLVMFuncOp lookupOrCreatePrintNewlineFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreateFreeFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreateGenericFreeFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintI64Fn(Operation *moduleOp)
Helper functions to lookup or create the declaration for commonly used external C function calls.
LLVM::LLVMFuncOp lookupOrCreatePrintOpenFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreateAlignedAllocFn(Operation *moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreateGenericAllocFn(Operation *moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreateGenericAlignedAllocFn(Operation *moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreatePrintStringFn(Operation *moduleOp, std::optional< StringRef > runtimeFunctionName={})
Declares a function to print a C-string.
LLVM::LLVMFuncOp lookupOrCreateFn(Operation *moduleOp, StringRef name, ArrayRef< Type > paramTypes={}, Type resultType={}, bool isVarArg=false)
Create a FuncOp with signature resultType(paramTypes)and namename`.
LLVM::LLVMFuncOp lookupOrCreatePrintBF16Fn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintF16Fn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintF32Fn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintCloseFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreateMallocFn(Operation *moduleOp, Type indexType)
LLVM::LLVMFuncOp lookupOrCreatePrintF64Fn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintCommaFn(Operation *moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintU64Fn(Operation *moduleOp)
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...