Skip to content

Commit

Permalink
[NFC] Simplify the tiling implementation using cloning. (llvm#72178)
Browse files Browse the repository at this point in the history
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
llvm#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]>
  • Loading branch information
MaheshRavishankar and Abhishek-Varma authored Nov 20, 2023
1 parent 80d3a4c commit 4a02001
Show file tree
Hide file tree
Showing 6 changed files with 366 additions and 279 deletions.
12 changes: 6 additions & 6 deletions mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ FailureOr<SCFTilingResult> tileUsingSCFForOp(RewriterBase &rewriter,
TilingInterface op,
const SCFTilingOptions &options);

/// Method to tile an op that implements the `TilingInterface` using
/// `scf.forall`.
FailureOr<SCFTilingResult>
tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
const SCFTilingOptions &options);

/// Options used to control tile + fuse.
struct SCFTileAndFuseOptions {
/// The tiling options used to control the tiling of the consumer.
Expand All @@ -93,12 +99,6 @@ struct SCFTileAndFuseOptions {
}
};

/// Method to tile an op that implements the `TilingInterface` using
/// `scf.forall`.
FailureOr<SCFTilingResult>
tileUsingSCFForallOp(RewriterBase &rewriter, TilingInterface op,
const SCFTilingOptions &options);

/// Fuse the producer of the source of `candidateSliceOp` by computing the
/// required slice of the producer in-place. Note that the method
/// replaces the uses of `candidateSliceOp` with the tiled and fused producer
Expand Down
Loading

0 comments on commit 4a02001

Please sign in to comment.