[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
Fri Apr 26 18:48:30 PDT 2024
================
@@ -118,10 +119,14 @@ static LogicalResult updateReturnOps(func::FuncOp func,
keepAsReturnOperands.push_back(operand);
}
OpBuilder builder(op);
- for (auto t : llvm::zip(copyIntoOutParams, appendedEntryArgs)) {
- if (failed(
- memCpyFn(builder, op.getLoc(), std::get<0>(t), std::get<1>(t))))
- return WalkResult::interrupt();
+ for (auto [orig, arg] : llvm::zip(copyIntoOutParams, appendedEntryArgs)) {
+ if (avoidBufferResultAllocAndCopy && isa<memref::AllocOp>(orig.getDefiningOp())) {
----------------
Menooker wrote:
Thanks for the comments. This added option in the pass was supposed to work on statically shaped allocated memref. I will update the code to filter out dynamic-shaped cases.
https://github.com/llvm/llvm-project/pull/90011
More information about the Mlir-commits
mailing list