[Mlir-commits] [mlir] [MLIR][Python] Support Python-defined rewrite patterns (PR #162699)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Oct 10 19:06:50 PDT 2025


================
@@ -0,0 +1,72 @@
+# RUN: %PYTHON %s 2>&1 | FileCheck %s
+
+import gc, sys
+from mlir.ir import *
+from mlir.passmanager import *
+from mlir.dialects.builtin import ModuleOp
+from mlir.dialects import arith
+from mlir.rewrite import *
+
+
+def run(f):
+    print("\nTEST:", f.__name__)
+    f()
+    gc.collect()
+    assert Context._get_live_count() == 0
----------------
PragmaTwice wrote:

Ahh thanks. Fixed in https://github.com/llvm/llvm-project/pull/162699/commits/14d1fb49c7bc6628aa93315043efcc362b15a052.

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


More information about the Mlir-commits mailing list