diff --git a/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h b/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h --- a/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h +++ b/mlir/include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h @@ -22,10 +22,10 @@ #define GEN_PASS_DECL_CONVERTFUNCTOLLVM #include "mlir/Conversion/Passes.h.inc" -/// Creates a pass to convert the Func dialect into the LLVMIR dialect. +/// Creates a pass to convert the Func dialect into the LLVM dialect. std::unique_ptr> createConvertFuncToLLVMPass(); std::unique_ptr> -createConvertFuncToLLVMPass(const LowerToLLVMOptions &options); +createConvertFuncToLLVMPass(const ConvertFuncToLLVMOptions &options); } // namespace mlir diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td --- a/mlir/include/mlir/Conversion/Passes.td +++ b/mlir/include/mlir/Conversion/Passes.td @@ -298,7 +298,6 @@ returns are updated accordingly. Block argument types are updated to use LLVM IR types. }]; - let constructor = "mlir::createConvertFuncToLLVMPass()"; let dependentDialects = ["LLVM::LLVMDialect"]; let options = [ Option<"useBarePtrCallConv", "use-bare-ptr-memref-call-conv", "bool", diff --git a/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp b/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp --- a/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp +++ b/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp @@ -712,14 +712,7 @@ /// A pass converting Func operations into the LLVM IR dialect. struct ConvertFuncToLLVMPass : public impl::ConvertFuncToLLVMBase { - ConvertFuncToLLVMPass() = default; - ConvertFuncToLLVMPass(bool useBarePtrCallConv, unsigned indexBitwidth, - bool useAlignedAlloc, - const llvm::DataLayout &dataLayout) { - this->useBarePtrCallConv = useBarePtrCallConv; - this->indexBitwidth = indexBitwidth; - this->dataLayout = dataLayout.getStringRepresentation(); - } + using ConvertFuncToLLVMBase::ConvertFuncToLLVMBase; /// Run the dialect converter on the module. void runOnOperation() override { @@ -767,15 +760,6 @@ } std::unique_ptr> -mlir::createConvertFuncToLLVMPass(const LowerToLLVMOptions &options) { - auto allocLowering = options.allocLowering; - // There is no way to provide additional patterns for pass, so - // AllocLowering::None will always fail. - assert(allocLowering != LowerToLLVMOptions::AllocLowering::None && - "ConvertFuncToLLVMPass doesn't support AllocLowering::None"); - bool useAlignedAlloc = - (allocLowering == LowerToLLVMOptions::AllocLowering::AlignedAlloc); - return std::make_unique( - options.useBarePtrCallConv, options.getIndexBitwidth(), useAlignedAlloc, - options.dataLayout); +mlir::createConvertFuncToLLVMPass(const ConvertFuncToLLVMOptions &options) { + return std::make_unique(options); }