[Mlir-commits] [mlir] [MLIR][Python][NO MERGE] Support Python-defined passes in MLIR (PR #157369)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Sep 7 20:04:53 PDT 2025
================
@@ -157,6 +159,44 @@ void mlir::python::populatePassManagerSubmodule(nb::module_ &m) {
"pipeline"_a,
"Add textual pipeline elements to the pass manager. Throws a "
"ValueError if the pipeline can't be parsed.")
+ .def(
+ "add_python_pass",
+ [](PyPassManager &passManager, const std::string &name,
+ const std::string &argument, const std::string &description,
+ const std::string &opName, const nb::callable &run) {
----------------
PragmaTwice wrote:
If possible maybe we can make `argument`, `description` and `opName` keyword arguments? So that we can use it like `pm.add_python_pass(name, run)`.
https://github.com/llvm/llvm-project/pull/157369
More information about the Mlir-commits
mailing list