[Mlir-commits] [mlir] [MLIR][Bufferization] BufferResultsToOutParams: Add an option to eliminate AllocOp and avoid Copy (PR #90011)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Apr 29 18:30:57 PDT 2024


================
@@ -320,6 +320,11 @@ def BufferResultsToOutParams : Pass<"buffer-results-to-out-params", "ModuleOp">
     Option<"addResultAttribute", "add-result-attr", "bool",
        /*default=*/"false",
        "Add the attribute 'bufferize.result' to all output parameters.">,
+    Option<"avoidBufferResultAllocAndCopy", "avoid-buffer-result-alloc-copy",
+       "bool", /*default=*/"false",
+       "When the returned memref has static shape and is allocated by "
----------------
ciyongch wrote:

This enhancement is indeed helpful to remove the overhead of result copy.
Just curious about the new name:  as the original pass always requires the the caller to allocate the buffer for the output params(newly added function argument), it might be a bit confusing that we're running with "buffer-results-to-out-params" pass but with "hoist-static-allocs=0".

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


More information about the Mlir-commits mailing list