[Mlir-commits] [mlir] [mlir][bufferization] Don't clone on unknown ownership and verify function boundary ABI (PR #66626)

Matthias Springer llvmlistbot at llvm.org
Wed Sep 27 01:20:25 PDT 2023


================
@@ -95,7 +95,17 @@ struct DeallocationOptions {
   // A pass option indicating whether private functions should be modified to
   // pass the ownership of MemRef values instead of adhering to the function
   // boundary ABI.
-  bool privateFuncDynamicOwnership = false;
+  bool privateFuncDynamicOwnership = true;
+
+  /// Inserts `cf.assert` operations to verify the function boundary ABI at
+  /// runtime. Currently, it is only checked that the ownership of returned
+  /// MemRefs is 'true'. This makes sure that ownership is yielded and the
+  /// returned MemRef does not originate from the same allocation as a function
+  /// argument. TODO: check that returned MemRefs don't alias each other.
+  /// If it can be determined statically that the ABI is not adhered
+  /// to, an error will already be emitted at compile time. This cannot be
+  /// changed with this option.
+  bool verifyFunctionBoundaryABI = true;
----------------
matthias-springer wrote:

I think there are no checks in case of dynamic ownership of private functions (?). That should be mentioned here.

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


More information about the Mlir-commits mailing list