Skip to content

[NFC][mlir][bufferization] Add paragraph about runtime and space cost to bufferization.dealloc op documentation #65612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ def Bufferization_DeallocOp : Bufferization_Op<"dealloc", [
`%r0`, `%r1`, or `%r2` are aliases of `%a0`. `%a1` will be deallocated when
`%cond1` is set to 'true' and none of `%r0`, %r1`, `%r2`, and `%a0` are
aliases.

Note that this can be an expensive operation if there are many operands that
cannot be optimized away. The runtime cost of this operation (assuming that
nothing is optimized away) is `O(|memrefs|^2+|memrefs|*|retained|)`. The
cost in terms of memory space is `O(|memrefs|+|retained|)`. As a result, it
is recommended to place it carefully in the IR such that most operands can
be optimized away by running the `buffer-deallocation-simplification` pass.
}];

let arguments = (ins Variadic<AnyRankedOrUnrankedMemRef>:$memrefs,
Expand Down