[Mlir-commits] [mlir] 48fcfaf - [NFC][mlir][bufferization] Add paragraph about runtime and space cost to bufferization.dealloc op documentation (#65612)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 7 08:55:45 PDT 2023


Author: Martin Erhart
Date: 2023-09-07T17:55:41+02:00
New Revision: 48fcfaf2ba51618258a75e976896024fbb626240

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

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
index fec07af349b3a8d..62ff0426098e332 100644
--- a/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
+++ b/mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
@@ -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,


        


More information about the Mlir-commits mailing list