[mlir][TilingInterface] Add an option to tile and fuse to yield replacement for the...
authorMahesh Ravishankar <ravishankarm@google.com>
Thu, 5 Jan 2023 00:57:50 +0000 (00:57 +0000)
committerMahesh Ravishankar <ravishankarm@google.com>
Mon, 16 Jan 2023 18:30:13 +0000 (18:30 +0000)
commit9db7d4edd82ed5bb3867bbe6093ed2c63b18425a
tree4d7d73cfb2a08da62c5a607464ef7b182862d757
parentf4f8f9f18590d6fdf531bb9d6981a6081a244d33
[mlir][TilingInterface] Add an option to tile and fuse to yield replacement for the fused producer.

This patch adds an option to the method that fuses a producer with a
tiled consumer, to also yield from the tiled loops a value that can be
used to replace the original producer. This is only valid if it can be
assertained that the slice of the producer computed within each
iteration of the tiled loop nest does not compute slices of the
producer redundantly. The analysis to derive this is very involved. So
this is left to the caller to assertain.  A test is added that mimics
the `scf::tileConsumerAndFuseProducersGreedilyUsingSCFForOp`, but also
yields the values of all fused producers. This can be used as a
reference for how a caller could use this functionality.

Differential Revision: https://reviews.llvm.org/D141028
mlir/include/mlir/Dialect/SCF/Transforms/TileUsingInterface.h
mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-interface.mlir [new file with mode: 0644]
mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp