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

Maksim Levental llvmlistbot at llvm.org
Thu Aug 20 20:47:18 PDT 2026


================
@@ -2685,6 +2685,28 @@ void PyDynamicOpTraits::IsIsolatedFromAbove::bind(nb::module_ &m) {
       nb::arg("context").none() = nb::none());
 }
 
+bool PyDynamicOpTraits::RecursiveMemoryEffects::attach(const nb::object &opName,
+                                                       PyMlirContext &context) {
+  MlirDynamicOpTrait trait = mlirDynamicOpTraitRecursiveMemoryEffectsCreate();
+  return attachOpTrait(opName, trait, context);
+}
+
+void PyDynamicOpTraits::RecursiveMemoryEffects::bind(nb::module_ &m) {
+  nb::class_<PyDynamicOpTraits::RecursiveMemoryEffects, PyDynamicOpTrait> cls(
+      m, "RecursiveMemoryEffectsTrait");
+  cls.attr(typeIDAttr) =
----------------
makslevental wrote:

This is weird - why not just def_method on the class itself (like everywhere else)?

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


More information about the Mlir-commits mailing list