Skip to content

Commit b662c9a

Browse files
[mlir][bufferization][NFC] Buffer deallocation: Add comment to handleInterface (#76956)
This is a follow-up for #68648.
1 parent bb6d5c2 commit b662c9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,12 @@ BufferDeallocation::handleInterface(MemoryEffectOpInterface op) {
861861

862862
for (auto operand : llvm::make_filter_range(op->getOperands(), isMemref)) {
863863
if (op.getEffectOnValue<MemoryEffects::Free>(operand).has_value()) {
864+
// The bufferization.manual_deallocation attribute can be attached to ops
865+
// with an allocation and/or deallocation side effect. It indicates that
866+
// the op is under a "manual deallocation" scheme. Deallocation ops are
867+
// usually forbidden in the input IR (not supported by the buffer
868+
// deallocation pass). However, if they are under manual deallocation,
869+
// they can be safely ignored by the buffer deallocation pass.
864870
if (!op->hasAttr(BufferizationDialect::kManualDeallocation))
865871
return op->emitError(
866872
"memory free side-effect on MemRef value not supported!");

0 commit comments

Comments
 (0)