[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


================
@@ -599,6 +599,11 @@ class MLIR_PYTHON_API_EXPORTED PyOperationBase {
   void walk(std::function<PyWalkResult(MlirOperation)> callback,
             PyWalkOrder walkOrder);
 
+  // Wrap the walk method with a type filter.
+  void walkOfType(nanobind::object opClass,
+                  std::function<PyWalkResult(MlirOperation)> callback,
+                  PyWalkOrder walkOrder);
----------------
kuhar wrote:

Would it be possible to use the same walk function as before? I don't we need it in the public C++ API.

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


More information about the Mlir-commits mailing list