Skip to content

Commit

Permalink
add starter poly-to-llvm pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
j2kun committed Oct 30, 2023
1 parent 48f8909 commit a54f23f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/tutorial-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
}

0 comments on commit a54f23f

Please sign in to comment.