[all-commits] [llvm/llvm-project] c8a3f5: Decouple registring passes from specifying argumen...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Wed Jun 16 16:42:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8a3f561ebfd6a5fd6c3efb65944760c7a1a446f
      https://github.com/llvm/llvm-project/commit/c8a3f561ebfd6a5fd6c3efb65944760c7a1a446f
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M mlir/docs/PassManagement.md
    M mlir/include/mlir/Pass/Pass.h
    M mlir/include/mlir/Pass/PassRegistry.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Pass/PassRegistry.cpp
    M mlir/test/Transforms/print-op-graph.mlir
    M mlir/test/python/pass_manager.py
    M mlir/tools/mlir-tblgen/PassGen.cpp

  Log Message:
  -----------
  Decouple registring passes from specifying argument/description

This patch changes the (not recommended) static registration API from:

 static PassRegistration<MyPass> reg("my-pass", "My Pass Description.");

to:

 static PassRegistration<MyPass> reg;

And the explicit registration from:

  void registerPass("my-pass", "My Pass Description.",
                    [] { return createMyPass(); });

To:

  void registerPass([] { return createMyPass(); });

It is expected that Pass implementations overrides the getArgument() method
instead. This will ensure that pipeline description can be printed and parsed
back.

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




More information about the All-commits mailing list