Skip to content

Commit 4a02001

Browse files
[NFC] Simplify the tiling implementation using cloning. (#72178)
The current implementation of tiling using `scf.for` is convoluted to make sure that the destination passing style of the untiled program is preserved. The addition of support to tile using `scf.forall` (adapted from the transform operation in Linalg) in #67083 used cloning of the tiled operations to better streamline the implementation. This PR adapts the other tiling methods to use a similar approach, making the transformations (and handling destination passing style semantics) more systematic. --------- Co-authored-by: Abhishek-Varma <[email protected]>
1 parent 80d3a4c commit 4a02001

File tree

6 files changed

+366
-279
lines changed

6 files changed

+366
-279
lines changed

mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ FailureOr<SCFTilingResult> tileUsingSCFForOp(RewriterBase &rewriter,
8383
TilingInterface op,
8484
const SCFTilingOptions &options);
8585

86+
/// Method to tile an op that implements the `TilingInterface` using
87+
/// `scf.forall`.
88+
FailureOr<SCFTilingResult>
89+
tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
90+
const SCFTilingOptions &options);
91+
8692
/// Options used to control tile + fuse.
8793
struct SCFTileAndFuseOptions {
8894
/// The tiling options used to control the tiling of the consumer.
@@ -93,12 +99,6 @@ struct SCFTileAndFuseOptions {
9399
}
94100
};
95101

96-
/// Method to tile an op that implements the `TilingInterface` using
97-
/// `scf.forall`.
98-
FailureOr<SCFTilingResult>
99-
tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
100-
const SCFTilingOptions &options);
101-
102102
/// Fuse the producer of the source of `candidateSliceOp` by computing the
103103
/// required slice of the producer in-place. Note that the method
104104
/// replaces the uses of `candidateSliceOp` with the tiled and fused producer

0 commit comments

Comments
 (0)