[llvm] [mlir][bufferization] Add OwnershipBasedBufferDeallocation pass option to forbid clones (PR #66626)

Martin Erhart via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 00:34:19 PDT 2023


================
@@ -134,8 +135,9 @@ func::FuncOp buildDeallocationLibraryFunction(OpBuilder &builder, Location loc,
 LogicalResult deallocateBuffers(Operation *op);
 
 /// Run ownership basedbuffer deallocation.
-LogicalResult deallocateBuffersOwnershipBased(FunctionOpInterface op,
-                                              bool privateFuncDynamicOwnership);
+LogicalResult deallocateBuffersOwnershipBased(
+    FunctionOpInterface op,
+    const DeallocationOptions &options = DeallocationOptions());
----------------
maerhart wrote:

If I understand the standard correctly, this should be fine. The livetime of the temporary object will be extended to that of the const reference bound to. (it would be illegal for non-const references though)

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


More information about the llvm-commits mailing list