[mlir][Linalg] Implement fusion of linalg.generic operation on tensors.
authorMaheshRavishankar <ravishankarm@google.com>
Fri, 7 Feb 2020 18:28:20 +0000 (10:28 -0800)
committerMaheshRavishankar <ravishankarm@google.com>
Fri, 7 Feb 2020 18:36:53 +0000 (10:36 -0800)
commitd06dd29e09b6b03a834ec0639d57446fb8515d12
treedc0fbe1180f1ccba76b7e072f0015cbd44a408aa
parent88073d40c7d84d59cffe7703e2a85694936fff68
[mlir][Linalg] Implement fusion of linalg.generic operation on tensors.

The initial implementation of the fusion operation exposes a method to
fuse a consumer with its producer, when
- both the producer and consumer operate on tensors
- the producer has only a single result value
- the producer has only "parallel" iterator types
A new interface method hasTensorSemantics is added to verify that an
operation has all operands and results of type RankedTensorType.

Differential Revision: https://reviews.llvm.org/D74172
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
mlir/test/Dialect/Linalg/fusion-tensor.mlir [new file with mode: 0644]