[Mlir-commits] [mlir] [MLIR][Python] Support Python-defined passes in MLIR (PR #156000)

Maksim Levental llvmlistbot at llvm.org
Mon Sep 1 19:43:32 PDT 2025


================
@@ -52,6 +129,26 @@ class PyPassManager {
 
 } // namespace
 
+void mlir::python::populatePassSubmodule(nanobind::module_ &m) {
+  //----------------------------------------------------------------------------
+  // Mapping of the Python-defined Pass interface
+  //----------------------------------------------------------------------------
+  nb::class_<PyPassBase, PyPass>(m, "Pass")
----------------
makslevental wrote:

isn't this backwards? cf [`<PyOperation, PyOperationBase>`](https://github.com/llvm/llvm-project/blob/7cc8a50c03f2c139070358fb55db925b8b6ceb9d/mlir/lib/Bindings/Python/IRCore.cpp#L3495)

https://github.com/llvm/llvm-project/pull/156000


More information about the Mlir-commits mailing list