[Mlir-commits] [mlir] 5f8228d - [mlir][linalg][bufferize] Fix bufferizesToMemoryWrite for TiledLoopOp

Matthias Springer llvmlistbot at llvm.org
Thu Oct 21 06:23:48 PDT 2021


Author: Matthias Springer
Date: 2021-10-21T22:17:05+09:00
New Revision: 5f8228d310627889716b51e1acd5840ec653d899

URL: https://github.com/llvm/llvm-project/commit/5f8228d310627889716b51e1acd5840ec653d899
DIFF: https://github.com/llvm/llvm-project/commit/5f8228d310627889716b51e1acd5840ec653d899.diff

LOG: [mlir][linalg][bufferize] Fix bufferizesToMemoryWrite for TiledLoopOp

This is the same fix as for scf.for.

Differential Revision: https://reviews.llvm.org/D112218

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
index f68ea6b7de65..4134cc042ebd 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
@@ -654,12 +654,8 @@ static bool bufferizesToMemoryRead(OpOperand &opOperand) {
     return isValueRead(forOp.getRegionIterArgForOpOperand(opOperand));
   // TiledLoop alone doesn't bufferize to a memory read, one of the uses of its
   // matching bbArg may.
-  if (auto tiledLoopOp = dyn_cast<TiledLoopOp>(opOperand.getOwner())) {
-    for (OpOperand &use : tiledLoopOp.getTiedBlockArgument(opOperand).getUses())
-      if (bufferizesToMemoryRead(use))
-        return true;
-    return false;
-  }
+  if (auto tiledLoopOp = dyn_cast<TiledLoopOp>(opOperand.getOwner()))
+    return isValueRead(tiledLoopOp.getTiedBlockArgument(opOperand));
   // CallOpInterface alone doesn't bufferize to a memory read, one of the uses
   // of the matching bbArg may. It is the responsibility of the caller to
   // inspect bbArgs. In the absence of a BufferizationAliasInfo, we need to be


        


More information about the Mlir-commits mailing list