Skip to content

Commit 4390e5c

Browse files
fix mlir function type
1 parent ac0ef7e commit 4390e5c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ mlir::arith::CmpIPredicate convertToBooleanMLIRComparison(ir::CompareOperation::
182182
}
183183
}
184184

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

189189
// The InsertionGuard saves the current insertion point (IP) and restores it
190190
// after scope is left.
@@ -554,7 +554,7 @@ void MLIRLoweringProvider::generateMLIR(ir::ProxyCallOperation* proxyCallOp, Val
554554
if (theModule.lookupSymbol<mlir::LLVM::LLVMFuncOp>(proxyCallOp->getFunctionSymbol())) {
555555
functionRef = mlir::SymbolRefAttr::get(context, proxyCallOp->getFunctionSymbol());
556556
} else {
557-
functionRef = insertExternalFunction(proxyCallOp->getFunctionSymbol(), proxyCallOp->getFunctionPtr(), getMLIRType(proxyCallOp->getStamp()), getMLIRType(proxyCallOp->getInputArguments()), true);
557+
functionRef = insertExternalFunction(proxyCallOp->getFunctionSymbol(), proxyCallOp->getFunctionPtr(), getMLIRType(proxyCallOp->getStamp()), getMLIRType(proxyCallOp->getInputArguments()));
558558
}
559559

560560
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, ::mlir::Type resultType, std::vector<::mlir::Type> argTypes, bool varArgs);
149+
::mlir::FlatSymbolRefAttr insertExternalFunction(const std::string& name, void* functionPtr, ::mlir::Type resultType, 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)