[Mlir-commits] [mlir] b662c9a - [mlir][bufferization][NFC] Buffer deallocation: Add comment to `handleInterface` (#76956)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 5 00:30:56 PST 2024


Author: Matthias Springer
Date: 2024-01-05T09:30:52+01:00
New Revision: b662c9aa0e0580e1fc78a8787414c86ad1984742

URL: https://github.com/llvm/llvm-project/commit/b662c9aa0e0580e1fc78a8787414c86ad1984742
DIFF: https://github.com/llvm/llvm-project/commit/b662c9aa0e0580e1fc78a8787414c86ad1984742.diff

LOG: [mlir][bufferization][NFC] Buffer deallocation: Add comment to `handleInterface` (#76956)

This is a follow-up for #68648.

Added: 
    

Modified: 
    mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
index 9459cc43547faf..529d5a808c012a 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
@@ -861,6 +861,12 @@ BufferDeallocation::handleInterface(MemoryEffectOpInterface op) {
 
   for (auto operand : llvm::make_filter_range(op->getOperands(), isMemref)) {
     if (op.getEffectOnValue<MemoryEffects::Free>(operand).has_value()) {
+      // The bufferization.manual_deallocation attribute can be attached to ops
+      // with an allocation and/or deallocation side effect. It indicates that
+      // the op is under a "manual deallocation" scheme. Deallocation ops are
+      // usually forbidden in the input IR (not supported by the buffer
+      // deallocation pass). However, if they are under manual deallocation,
+      // they can be safely ignored by the buffer deallocation pass.
       if (!op->hasAttr(BufferizationDialect::kManualDeallocation))
         return op->emitError(
             "memory free side-effect on MemRef value not supported!");


        


More information about the Mlir-commits mailing list