[Mlir-commits] [mlir] [mlir][bufferization] Allow returning allocs in empty tensor elimination (PR #66198)

Matthias Springer llvmlistbot at llvm.org
Wed Sep 13 04:59:55 PDT 2023


https://github.com/matthias-springer created https://github.com/llvm/llvm-project/pull/66198:

This flag was renamed in 6a91dfedeb956dfa092a6a3f411e8b02f0d5d289 and accidentally removed from the pass.

>From 7556a32e32cd8a26b5c27734a77c95248baf5ba6 Mon Sep 17 00:00:00 2001
From: Matthias Springer <me at m-sp.org>
Date: Wed, 13 Sep 2023 13:58:35 +0200
Subject: [PATCH] [mlir][bufferization] Allow returning allocs in empty tensor
 elimination

This flag was renamed in 6a91dfedeb956dfa092a6a3f411e8b02f0d5d289 and
accidentally removed from the pass.
---
 .../Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
index 4dbf22593b911ae..d2e3f512ff30c66 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
@@ -268,6 +268,7 @@ struct EmptyTensorElimination
 void EmptyTensorElimination::runOnOperation() {
   Operation *op = getOperation();
   OneShotBufferizationOptions options;
+  options.allowReturnAllocsFromLoops = true;
   OneShotAnalysisState state(op, options);
   if (failed(analyzeOp(op, state))) {
     signalPassFailure();



More information about the Mlir-commits mailing list