[Mlir-commits] [mlir] [MLIR][CAPI][Python] Add support for querying memory effect instances (PR #213459)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Aug 1 21:47:06 PDT 2026


================
@@ -231,9 +272,12 @@ typedef struct {
   void (*construct)(void *userData);
   /// Optional destructor for user data. Set to nullptr to disable it.
   void (*destruct)(void *userData);
-  /// Get memory effects callback.
-  void (*getEffects)(MlirOperation op, MlirMemoryEffectInstancesList effects,
-                     void *userData);
+  /// Get memory effects callback. Implementations return effects by invoking
+  /// `callback` with an array of memory effect instances. The callback copies
+  /// the instances synchronously, so implementations retain ownership of them.
----------------
PragmaTwice wrote:

Ahh it means that the ownership of these `MlirMemoryEffectInstance`s is retained instead of transferred since these are copied into the `SmallVector`. I'll refine the comment.

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


More information about the Mlir-commits mailing list