[mlir][Linalg] Fix incorrect fusion with reshape ops by linearization.
authorMaheshRavishankar <ravishankarm@google.com>
Tue, 25 Jan 2022 18:58:53 +0000 (10:58 -0800)
committerMaheshRavishankar <ravishankarm@google.com>
Tue, 25 Jan 2022 19:42:58 +0000 (11:42 -0800)
commitea1ac183f47ebc03051e63f76c4cb3ad3c5b9f3a
treeff0e573c1f564d8227a1f858dad360cf91e88a69
parent0ad19a833177861be55fefaff725ab89c8695d01
[mlir][Linalg] Fix incorrect fusion with reshape ops by linearization.

Fusion of reshape ops by linearization incorrectly inverted the
indexing map before linearizing dimensions. This leads to incorrect
indexing maps used in the fused operation.

Differential Revision: https://reviews.llvm.org/D117908
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
mlir/test/Dialect/Linalg/reshape_linearization_fusion.mlir