27 static constexpr llvm::StringRef
kPrintI64 =
"printI64";
28 static constexpr llvm::StringRef
kPrintU64 =
"printU64";
29 static constexpr llvm::StringRef
kPrintF32 =
"printF32";
30 static constexpr llvm::StringRef
kPrintF64 =
"printF64";
31 static constexpr llvm::StringRef
kPrintOpen =
"printOpen";
35 static constexpr llvm::StringRef
kMalloc =
"malloc";
37 static constexpr llvm::StringRef
kFree =
"free";
44 auto func = moduleOp.lookupSymbol<LLVM::LLVMFuncOp>(name);
48 return b.
create<LLVM::LLVMFuncOp>(
49 moduleOp->getLoc(), name,
55 IntegerType::get(moduleOp->getContext(), 64),
56 LLVM::LLVMVoidType::get(moduleOp->getContext()));
61 IntegerType::get(moduleOp->getContext(), 64),
62 LLVM::LLVMVoidType::get(moduleOp->getContext()));
67 Float32Type::get(moduleOp->getContext()),
68 LLVM::LLVMVoidType::get(moduleOp->getContext()));
73 Float64Type::get(moduleOp->getContext()),
74 LLVM::LLVMVoidType::get(moduleOp->getContext()));
79 LLVM::LLVMVoidType::get(moduleOp->getContext()));
84 LLVM::LLVMVoidType::get(moduleOp->getContext()));
89 LLVM::LLVMVoidType::get(moduleOp->getContext()));
94 LLVM::LLVMVoidType::get(moduleOp->getContext()));
115 LLVM::LLVMVoidType::get(moduleOp->getContext()));
120 Type unrankedDescriptorType) {
123 ArrayRef<Type>{indexType, unrankedDescriptorType, unrankedDescriptorType},
124 LLVM::LLVMVoidType::get(moduleOp->getContext()));
132 .
create<LLVM::CallOp>(loc, resultTypes, SymbolRefAttr::get(fn),
TODO: Remove this file when SCCP and integer range analysis have been ported to the new framework...
static constexpr llvm::StringRef kPrintComma
static constexpr llvm::StringRef kPrintF64
static constexpr llvm::StringRef kPrintNewline
LLVM::LLVMFuncOp lookupOrCreatePrintF32Fn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreatePrintU64Fn(ModuleOp moduleOp)
static constexpr llvm::StringRef kPrintF32
This class implements the result iterators for the Operation class.
static LLVMFunctionType get(Type result, ArrayRef< Type > arguments, bool isVarArg=false)
Gets or creates an instance of LLVM dialect function in the same context as the result type...
LLVM::LLVMFuncOp lookupOrCreatePrintCommaFn(ModuleOp moduleOp)
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
LLVM::LLVMFuncOp lookupOrCreatePrintI64Fn(ModuleOp moduleOp)
Helper functions to lookup or create the declaration for commonly used external C function calls...
LLVM::LLVMFuncOp lookupOrCreatePrintNewlineFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateFn(ModuleOp moduleOp, StringRef name, ArrayRef< Type > paramTypes={}, Type resultType={})
Create a FuncOp with signature resultType(paramTypes)and namename`.
static constexpr llvm::StringRef kFree
static LLVMPointerType get(MLIRContext *context, unsigned addressSpace=0)
Gets or creates an instance of LLVM dialect pointer type pointing to an object of pointee type in the...
static constexpr llvm::StringRef kPrintClose
static constexpr llvm::StringRef kPrintOpen
static constexpr llvm::StringRef kAlignedAlloc
LLVM::LLVMFuncOp lookupOrCreateAlignedAllocFn(ModuleOp moduleOp, Type indexType)
static constexpr llvm::StringRef kPrintI64
Helper functions to lookup or create the declaration for commonly used external C function calls...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
LLVM::LLVMFuncOp lookupOrCreatePrintCloseFn(ModuleOp moduleOp)
Operation::result_range createLLVMCall(OpBuilder &b, Location loc, LLVM::LLVMFuncOp fn, ValueRange args={}, ArrayRef< Type > resultTypes={})
Helper wrapper to create a call to fn with args and resultTypes.
LLVM::LLVMFuncOp lookupOrCreateMemRefCopyFn(ModuleOp moduleOp, Type indexType, Type unrankedDescriptorType)
static constexpr llvm::StringRef kMemRefCopy
LLVM::LLVMFuncOp lookupOrCreatePrintOpenFn(ModuleOp moduleOp)
LLVM::LLVMFuncOp lookupOrCreateMallocFn(ModuleOp moduleOp, Type indexType)
static constexpr llvm::StringRef kPrintU64
static constexpr llvm::StringRef kMalloc
This class helps build Operations.
LLVM::LLVMFuncOp lookupOrCreatePrintF64Fn(ModuleOp moduleOp)
This class provides an abstraction over the different types of ranges over Values.
LLVM::LLVMFuncOp lookupOrCreateFreeFn(ModuleOp moduleOp)