[Mlir-commits] [mlir] Extend `TilingInterface` to allow more flexible tiling (PR #95422)

Srinath Avadhanula llvmlistbot at llvm.org
Thu Jun 13 08:40:12 PDT 2024


================
@@ -962,13 +965,12 @@ LogicalResult mlir::scf::yieldReplacementForFusedProducer(
                   .getDefiningOp<DestinationStyleOpInterface>()) {
         rewriter.setInsertionPoint(tiledDestStyleOp);
         Value newRegionArg = newRegionIterArgs.back();
-        auto destSlice = rewriter.create<tensor::ExtractSliceOp>(
-            sliceOp.getLoc(), newRegionArg, sliceOp.getMixedOffsets(),
-            sliceOp.getMixedSizes(), sliceOp.getMixedStrides());
         unsigned resultNumber = fusableProducer.getResultNumber();
-        rewriter.modifyOpInPlace(tiledDestStyleOp, [&]() {
-          tiledDestStyleOp.getDpsInitsMutable()[resultNumber].set(destSlice);
-        });
+        auto origSlice = tiledDestStyleOp.getDpsInits()[resultNumber]
----------------
srinathava wrote:

We were previously creating a new `tensor::ExtractSliceOp` to set as the destination argument of the tiled op. This worked before because we would be looking at the operands of the tiled op to build the worklist of candidate `tensor::ExtractSliceOps` in `tileConsumerAndFuseProducers`. However, we now directly use the slice ops returned by the `TilingInterfaceOp` _before_ we call into `yieldReplacementForFusedProducer`. 

We therefore modify the slice op argument of the fused producer _in place_ instead of creating a new `tensor::ExtractSliceOp`


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


More information about the Mlir-commits mailing list