[mlir][linalg] Fix tensor tiling together with interchange
authorLei Zhang <antiagainst@google.com>
Fri, 15 Jul 2022 17:43:57 +0000 (13:43 -0400)
committerLei Zhang <antiagainst@google.com>
Fri, 15 Jul 2022 17:54:47 +0000 (13:54 -0400)
commit56796ae1a8db4c85dada28676f8303a5a3609c63
treea7b9f63a20123350207834499a1941b76eca1fe9
parent6fe766bebac7ab2d4d8822d808064e467c542120
[mlir][linalg] Fix tensor tiling together with interchange

In `linalg::tileConsumerAndFuseProducers`, there are two levels of
tiling and fusion; we partition the tile sizes and only use one
half for each of them. The partition is using the first non-parallel
dimension *after* interchange as the boundary. However, concrete
tiling happens *together with* loop interchange, so we still need
to provide the partial tile sizes *before* the interchange.
Otherwise, there will be inconsistency, which is what this patch
is to fix.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D129804
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
mlir/test/Dialect/Linalg/transform-op-fuse.mlir