From a54f23fc2237acae5002675ff4d7c250c58c3b25 Mon Sep 17 00:00:00 2001 From: Jeremy Kun Date: Mon, 30 Oct 2023 10:27:33 -0700 Subject: [PATCH] add starter poly-to-llvm pipeline --- tools/tutorial-opt.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/tutorial-opt.cpp b/tools/tutorial-opt.cpp index 9336d03..72a6392 100644 --- a/tools/tutorial-opt.cpp +++ b/tools/tutorial-opt.cpp @@ -7,6 +7,13 @@ #include "mlir/include/mlir/Pass/PassManager.h" #include "mlir/include/mlir/Pass/PassRegistry.h" #include "mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h" +#include "mlir/include/mlir/Transforms/Passes.h" + +void polyToLLVMPipelineBuilder(mlir::OpPassManager &manager) { + // Poly + manager.addPass(mlir::tutorial::poly::createPolyToStandard()); + manager.addPass(mlir::createCanonicalizerPass()); +} int main(int argc, char **argv) { mlir::DialectRegistry registry; @@ -20,6 +27,10 @@ int main(int argc, char **argv) { // Dialect conversion passes mlir::tutorial::poly::registerPolyToStandardPasses(); + mlir::PassPipelineRegistration<>("poly-to-llvm", + "Run passes to lower the poly dialect to LLVM", + polyToLLVMPipelineBuilder); + return mlir::asMainReturnCode( mlir::MlirOptMain(argc, argv, "Tutorial Pass Driver", registry)); }