Skip to content

Commit 042fbcc

Browse files
fix mlir function type (#62)
1 parent 26a1e1b commit 042fbcc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

nautilus/src/nautilus/compiler/backends/mlir/MLIRLoweringProvider.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,9 @@ mlir::arith::CmpIPredicate convertToBooleanMLIRComparison(ir::CompareOperation::
183183

184184
mlir::FlatSymbolRefAttr MLIRLoweringProvider::insertExternalFunction(const std::string& name, void* functionPtr,
185185
const mlir::Type& resultType,
186-
const std::vector<mlir::Type>& argTypes,
187-
bool varArgs) {
186+
const std::vector<mlir::Type>& argTypes) {
188187
// Create function arg & result types (currently only int for result).
189-
mlir::LLVM::LLVMFunctionType llvmFnType = mlir::LLVM::LLVMFunctionType::get(resultType, argTypes, varArgs);
188+
mlir::LLVM::LLVMFunctionType llvmFnType = mlir::LLVM::LLVMFunctionType::get(resultType, argTypes);
190189

191190
// The InsertionGuard saves the current insertion point (IP) and restores it
192191
// after scope is left.
@@ -543,7 +542,7 @@ void MLIRLoweringProvider::generateMLIR(ir::ProxyCallOperation* proxyCallOp, Val
543542
} else {
544543
functionRef = insertExternalFunction(proxyCallOp->getFunctionSymbol(), proxyCallOp->getFunctionPtr(),
545544
getMLIRType(proxyCallOp->getStamp()),
546-
getMLIRType(proxyCallOp->getInputArguments()), true);
545+
getMLIRType(proxyCallOp->getInputArguments()));
547546
}
548547

549548
std::vector<mlir::Value> functionArgs;

nautilus/src/nautilus/compiler/backends/mlir/MLIRLoweringProvider.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,9 @@ class MLIRLoweringProvider {
144144
* @param name: Function name.
145145
* @param numResultBits: Number of bits of returned Integer.
146146
* @param argTypes: Argument types of function.
147-
* @param varArgs: Include variable arguments.
148147
* @return FlatSymbolRefAttr: Reference to function used in CallOps.
149148
*/
150-
::mlir::FlatSymbolRefAttr insertExternalFunction(const std::string& name, void* functionPtr, const ::mlir::Type& resultType, const std::vector<::mlir::Type>& argTypes, bool varArgs);
149+
::mlir::FlatSymbolRefAttr insertExternalFunction(const std::string& name, void* functionPtr, const ::mlir::Type& resultType, const std::vector<::mlir::Type>& argTypes);
151150

152151
/**
153152
* @brief Generates a Name(d)Loc(ation) that is attached to the operation.

0 commit comments

Comments
 (0)