[all-commits] [llvm/llvm-project] d4c873: Implement Pass and Dialect plugins for mlir-opt

xblang-project via All-commits all-commits at lists.llvm.org
Thu Apr 6 09:33:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4c873b044aeebaa43e6989fb1f9606530ec60cf
      https://github.com/llvm/llvm-project/commit/d4c873b044aeebaa43e6989fb1f9606530ec60cf
  Author: Fabian Mora <fmorac at udel.edu>
  Date:   2023-04-06 (Thu, 06 Apr 2023)

  Changed paths:
    M mlir/examples/standalone/CMakeLists.txt
    M mlir/examples/standalone/include/Standalone/CMakeLists.txt
    A mlir/examples/standalone/include/Standalone/StandalonePasses.h
    A mlir/examples/standalone/include/Standalone/StandalonePasses.td
    M mlir/examples/standalone/lib/Standalone/CMakeLists.txt
    A mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp
    M mlir/examples/standalone/standalone-opt/standalone-opt.cpp
    A mlir/examples/standalone/standalone-plugin/CMakeLists.txt
    A mlir/examples/standalone/standalone-plugin/standalone-plugin.cpp
    A mlir/examples/standalone/test/Standalone/standalone-pass-plugin.mlir
    A mlir/examples/standalone/test/Standalone/standalone-plugin.mlir
    M mlir/examples/standalone/test/lit.cfg.py
    A mlir/include/mlir/IR/DialectPlugin.h
    A mlir/include/mlir/Pass/PassPlugin.h
    M mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
    M mlir/lib/IR/CMakeLists.txt
    A mlir/lib/IR/DialectPlugin.cpp
    M mlir/lib/Pass/CMakeLists.txt
    A mlir/lib/Pass/PassPlugin.cpp
    M mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
    M mlir/tools/mlir-opt/CMakeLists.txt

  Log Message:
  -----------
  Implement Pass and Dialect plugins for mlir-opt

Implementation of Pass and Dialect Plugins that mirrors LLVM Pass Plugin  implementation from the new pass manager.

Currently the implementation only supports using the pass-pipeline option for adding passes. This restriction is imposed by the `PassPipelineCLParser` variable in mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:114 that loads the parse options statically before parsing the cmd line args.

```
mlir-opt stanalone-plugin.mlir --load-dialect-plugin=lib/libStandalonePlugin.so --pass-pipeline="builtin.module(standalone-switch-bar-foo)"
```

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D147053




More information about the All-commits mailing list