[mlir][Linalg] Add support for fusion between indexed_generic ops and generic ops...
authorHanhan Wang <hanchung@google.com>
Wed, 3 Jun 2020 21:58:19 +0000 (14:58 -0700)
committerHanhan Wang <hanchung@google.com>
Wed, 3 Jun 2020 21:58:43 +0000 (14:58 -0700)
commitcc11ceda165b5ba0a87e812fbd6ed1bce4fefd2f
treebe080406166133d693f5542d04ed4ad701e353ad
parent49cbe56a657b91e612f8305e7f8f9119ffe84378
[mlir][Linalg] Add support for fusion between indexed_generic ops and generic ops on tensors.

Summary:
Different from the fusion between generic ops, indices are involved. In this
context, we need to re-map the indices for producer since the fused op is built
on consumer's perspective. This patch supports all combination of the fusion
between indexed_generic ops and generic ops, which includes tests case:
  1) generic op as producer and indexed_generic op as consumer.
  2) indexed_generic op as producer and generic op as consumer.
  3) indexed_generic op as producer and indexed_generic op as consumer.

Differential Revision: https://reviews.llvm.org/D80347
mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
mlir/test/Dialect/Linalg/fusion-tensor.mlir