[mlir][linalg] Allow outer dims perm and untiled dims in pack/unpack generalization
authorQuinn Dawkins <quinn@nod-labs.com>
Sun, 2 Apr 2023 19:46:32 +0000 (15:46 -0400)
committerQuinn Dawkins <quinn@nod-labs.com>
Tue, 2 May 2023 16:26:45 +0000 (12:26 -0400)
commit009c053e3f822d0df556c6b39f632e31594373de
treec87f556e6869bacba58174cbef6252c852b284a9
parent0d5b51e0ac885b6119e788cf6f0a6836c3908afc
[mlir][linalg] Allow outer dims perm and untiled dims in pack/unpack generalization

Extends the pack/unpack generalization patterns to work for any packing
op with only full tiles. This produces a combination of rank-reduced
insert/extract slice ops paired with a transpose on the reduced shape,
similar to what the pattern currently produces for fully tiled
pack/unpacks. Note that only the outer dims are rank-reduced in this
pattern, leaving the shape of the inner tile intact.

Differential Revision: https://reviews.llvm.org/D147555
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
mlir/test/Dialect/Linalg/generalize-tensor-pack.mlir
mlir/test/Dialect/Linalg/generalize-tensor-unpack.mlir