[mlir][Linalg] Add fusion of IndexedGenericOp with TensorReshapeOp by expansion.
authorMaheshRavishankar <ravishankarm@google.com>
Tue, 27 Oct 2020 23:15:08 +0000 (16:15 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Tue, 27 Oct 2020 23:15:34 +0000 (16:15 -0700)
commit9d5239d39e48b8b171a0fbc47dbbb22381f4d9be
treeed88c55558ff1b30f8e97f02a45c47b8f0e938e7
parenta7b662d0f4098371b96ce4446fb0eba79b0b649f
[mlir][Linalg] Add fusion of IndexedGenericOp with TensorReshapeOp by expansion.

This patch adds support for fusing linalg.indexed_generic op with
linalg.tensor_reshape op by expansion, i.e.
- linalg.indexed_generic op -> linalg.tensor_reshape op when the
  latter is expanding.
- linalg.tensor_reshape op -> linalg.indexed_generic op when the
  former is folding.

Differential Revision: https://reviews.llvm.org/D90082
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
mlir/test/Dialect/Linalg/reshape_fusion.mlir