[Mlir-commits] [mlir] [SCF] Set Insertion point after the root op when tiling using scf.for_all (PR #76874)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jan 3 14:51:49 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-scf

Author: Nirvedh Meshram (nirvedhmeshram)

<details>
<summary>Changes</summary>

This is consistent with that is done for tiling with scf.for utility

Co-authored-by: Abhishek Varma <abhvarma@<!-- -->amd.com>

---
Full diff: https://github.com/llvm/llvm-project/pull/76874.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp (+2) 


``````````diff
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 1b6b4db9d20907..71f6ab7f063bcf 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -804,6 +804,7 @@ mlir::scf::tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
                                 const scf::SCFTilingOptions &options) {
   Location loc = op->getLoc();
   OpBuilder::InsertionGuard g(rewriter);
+  rewriter.setInsertionPointAfter(op);
 
   // 1. Get the range of loops that are represented by the operation.
   SmallVector<Range> loopRanges = op.getIterationDomain(rewriter);
@@ -843,6 +844,7 @@ mlir::scf::tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
   // 6. Create the ForallOp. We don't use the lambda body-builder
   // version because we require the use of RewriterBase in the body, so we
   // manually move the insertion point to the body below.
+  rewriter.setInsertionPointAfter(op);
   auto forallOp =
       rewriter.create<scf::ForallOp>(loc, lbs, ubs, steps, dest, mappingAttr);
 

``````````

</details>


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


More information about the Mlir-commits mailing list