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

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Apr 6 18:28:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9b415870dc3036f989c03eb553473aed614658a
      https://github.com/llvm/llvm-project/commit/e9b415870dc3036f989c03eb553473aed614658a
  Author: Mehdi Amini <joker.eph at gmail.com>
  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/Tools/Plugins/DialectPlugin.h
    A mlir/include/mlir/Tools/Plugins/PassPlugin.h
    M mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
    M mlir/lib/Tools/CMakeLists.txt
    A mlir/lib/Tools/Plugins/CMakeLists.txt
    A mlir/lib/Tools/Plugins/DialectPlugin.cpp
    A mlir/lib/Tools/Plugins/PassPlugin.cpp
    M mlir/lib/Tools/mlir-opt/CMakeLists.txt
    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