diff --git a/mlir/include/mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h b/mlir/include/mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h --- a/mlir/include/mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h +++ b/mlir/include/mlir/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.h @@ -17,14 +17,12 @@ class RewritePatternSet; class Pass; -#define GEN_PASS_DECL_CONVERTARITHMETICTOLLVM +#define GEN_PASS_DECL_ARITHMETICTOLLVMCONVERSIONPASS #include "mlir/Conversion/Passes.h.inc" namespace arith { void populateArithmeticToLLVMConversionPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns); - -std::unique_ptr createConvertArithmeticToLLVMPass(); } // namespace arith } // 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 @@ -96,12 +96,11 @@ // ArithmeticToLLVM //===----------------------------------------------------------------------===// -def ConvertArithmeticToLLVM : Pass<"convert-arith-to-llvm"> { +def ArithmeticToLLVMConversionPass : Pass<"convert-arith-to-llvm"> { let summary = "Convert Arithmetic dialect to LLVM dialect"; let description = [{ This pass converts supported Arithmetic ops to LLVM dialect instructions. }]; - let constructor = "mlir::arith::createConvertArithmeticToLLVMPass()"; let dependentDialects = ["LLVM::LLVMDialect"]; let options = [ Option<"indexBitwidth", "index-bitwidth", "unsigned", diff --git a/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp b/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp --- a/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp +++ b/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp @@ -16,7 +16,7 @@ #include "mlir/Pass/Pass.h" namespace mlir { -#define GEN_PASS_DEF_CONVERTARITHMETICTOLLVM +#define GEN_PASS_DEF_ARITHMETICTOLLVMCONVERSIONPASS #include "mlir/Conversion/Passes.h.inc" } // namespace mlir @@ -320,9 +320,10 @@ //===----------------------------------------------------------------------===// namespace { -struct ConvertArithmeticToLLVMPass - : public impl::ConvertArithmeticToLLVMBase { - ConvertArithmeticToLLVMPass() = default; +struct ArithmeticToLLVMConversionPass + : public impl::ArithmeticToLLVMConversionPassBase< + ArithmeticToLLVMConversionPass> { + using Base::Base; void runOnOperation() override { LLVMConversionTarget target(getContext()); @@ -395,7 +396,3 @@ >(converter); // clang-format on } - -std::unique_ptr mlir::arith::createConvertArithmeticToLLVMPass() { - return std::make_unique(); -} diff --git a/mlir/test/CAPI/execution_engine.c b/mlir/test/CAPI/execution_engine.c --- a/mlir/test/CAPI/execution_engine.c +++ b/mlir/test/CAPI/execution_engine.c @@ -35,8 +35,8 @@ MlirOpPassManager opm = mlirPassManagerGetNestedUnder( pm, mlirStringRefCreateFromCString("func.func")); mlirPassManagerAddOwnedPass(pm, mlirCreateConversionConvertFuncToLLVM()); - mlirOpPassManagerAddOwnedPass(opm, - mlirCreateConversionConvertArithmeticToLLVM()); + mlirOpPassManagerAddOwnedPass( + opm, mlirCreateConversionArithmeticToLLVMConversionPass()); MlirLogicalResult status = mlirPassManagerRun(pm, module); if (mlirLogicalResultIsFailure(status)) { fprintf(stderr, "Unexpected failure running pass pipeline\n"); diff --git a/mlir/unittests/ExecutionEngine/Invoke.cpp b/mlir/unittests/ExecutionEngine/Invoke.cpp --- a/mlir/unittests/ExecutionEngine/Invoke.cpp +++ b/mlir/unittests/ExecutionEngine/Invoke.cpp @@ -54,8 +54,7 @@ static LogicalResult lowerToLLVMDialect(ModuleOp module) { PassManager pm(module.getContext()); pm.addPass(mlir::createMemRefToLLVMConversionPass()); - pm.addNestedPass( - mlir::arith::createConvertArithmeticToLLVMPass()); + pm.addNestedPass(mlir::createArithmeticToLLVMConversionPass()); pm.addPass(mlir::createConvertFuncToLLVMPass()); pm.addPass(mlir::createReconcileUnrealizedCastsPass()); return pm.run(module);