[Mlir-commits] [mlir] [MLIR][Python] Add walk_of_type() binding and get_ops_of_type() utility (PR #186131)

Jakub Kuderski llvmlistbot at llvm.org
Thu Mar 12 08:06:54 PDT 2026


================
@@ -3868,7 +3882,22 @@ void populateIRCore(nb::module_ &m) {
 
              Args:
                callback: A callable that takes an Operation and returns a WalkResult.
-               walk_order: The order of traversal (PRE_ORDER or POST_ORDER).)");
+               walk_order: The order of traversal (PRE_ORDER or POST_ORDER).)")
+      .def("walk_of_type", &PyOperationBase::walkOfType, "op_class"_a,
----------------
kuhar wrote:

Here, could we use a lambda that calls the plain `PyOperationBase::walk`?

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


More information about the Mlir-commits mailing list