[Mlir-commits] [mlir] [MLIR][Python] Add effect and speculatability specifiers for Python-defined ops (PR #216773)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Aug 22 08:03:35 PDT 2026


================
@@ -169,6 +187,17 @@ def run_pass(source, pipeline):
 with ir.Context(), ir.Location.unknown():
     MemoryEffectsTest.load()
 
+    from mlir.dialects import scf, arith
+
+    # CHECK: recursive memory effects traits: False True True False
+    print(
+        "recursive memory effects traits:",
+        RegionOp.has_trait(ir.RecursiveMemoryEffectsTrait),
----------------
PragmaTwice wrote:

No. `ext.Pure` is not a trait. It is just a helper class to attach both `HasNoMemoryEffect` and `AlwaysSpecutable`. Same as in C++: https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Interfaces/SideEffectInterfaces.td#L147.

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


More information about the Mlir-commits mailing list