[Mlir-commits] [mlir] f164814 - [mlir][SCF][bufferize] Small simplification and more comments

Matthias Springer llvmlistbot at llvm.org
Mon Jun 27 08:07:50 PDT 2022


Author: Matthias Springer
Date: 2022-06-27T17:04:29+02:00
New Revision: f164814f2f18f8f1f4215ba237270f0d411de5f4

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

LOG: [mlir][SCF][bufferize] Small simplification and more comments

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

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
index 3af3e5dc5953..0227816b7784 100644
--- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -1118,6 +1118,7 @@ struct ParallelInsertSliceOpInterface
 
   LogicalResult resolveConflicts(Operation *op, RewriterBase &rewriter,
                                  const AnalysisState &state) const {
+    // RaW conflicts are resolved as part of ForeachThreadOp.
     return success();
   }
 
@@ -1129,9 +1130,7 @@ struct ParallelInsertSliceOpInterface
     auto foreachThreadOp =
         cast<ForeachThreadOp>(performConcurrentlyOp->getParentOp());
 
-    // If the op bufferizes out-of-place, allocate the copy before the
-    // ForeachThreadOp.
-    rewriter.setInsertionPoint(foreachThreadOp);
+    // Get destination buffer.
     FailureOr<Value> destBuffer =
         getBuffer(rewriter, insertOp.getDest(), options);
     if (failed(destBuffer))
@@ -1156,6 +1155,8 @@ struct ParallelInsertSliceOpInterface
     rewriter.setInsertionPointAfter(foreachThreadOp);
     Value toTensorOp =
         rewriter.create<ToTensorOp>(foreachThreadOp.getLoc(), *destBuffer);
+    // PerformConcurrentlyOp can have multiple ParallelInserSliceOps. Find the
+    // index of `op` within yielding ops.
     unsigned resultNum = 0;
     for (Operation &nextOp : performConcurrentlyOp.yieldingOps()) {
       if (&nextOp == op)


        


More information about the Mlir-commits mailing list