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

Maksim Levental llvmlistbot at llvm.org
Thu Oct 9 21:17:10 PDT 2025


================
@@ -0,0 +1,77 @@
+# 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 log(*args):
+    print(*args, file=sys.stderr)
+    sys.stderr.flush()
----------------
makslevental wrote:

nit: you don't need this - this is only for when the cpp emits errors (like to stderr) and we want to reconcile/collate prints from both sides 

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


More information about the Mlir-commits mailing list