[mlir][Linalg] Generalize the logic to compute reassociation maps
authorMahesh Ravishankar <ravishankarm@google.com>
Tue, 29 Sep 2020 23:14:49 +0000 (16:14 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Wed, 30 Sep 2020 14:58:06 +0000 (07:58 -0700)
commit892fdc923f06adbef507ebe594fa7b48224d93f0
treeaa396740a747d4a26d975ed431b914bbe494830b
parent3a7487f903e2a6be29de39058eee2372e30798d5
[mlir][Linalg] Generalize the logic to compute reassociation maps
while folding tensor_reshape op.

While folding reshapes that introduce unit extent dims, the logic to
compute the reassociation maps can be generalized to handle some
corner cases, for example, when the folded shape still has unit-extent
dims but corresponds to folded unit extent dims of the expanded shape.

Differential Revision: https://reviews.llvm.org/D88521
mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir