[mlir][Vector] Add more vector.contract -> outerproduct lowerings and fix vector...
authorNicolas Vasilache <ntv@google.com>
Tue, 26 May 2020 19:34:57 +0000 (15:34 -0400)
committerNicolas Vasilache <ntv@google.com>
Tue, 26 May 2020 19:40:55 +0000 (15:40 -0400)
commitba10daa820fa868816eed2b85e70197d354ebfe6
treea712c284376674ecced0001d9741f1393386b553
parente99d50d8440efe8fa3515db4dae873ba39810dfd
[mlir][Vector] Add more vector.contract -> outerproduct lowerings and fix vector.contract type inference.

This revision expands the types of vector contractions that can be lowered to vector.outerproduct.
All 8 permutation cases are support.
The idiomatic manipulation of AffineMap written declaratively makes this straightforward.

In the process a bug with the vector.contract verifier was uncovered.
The vector shape verification part of the contract op is rewritten to use AffineMap composition.
One bug in the vector `ops.mlir` test is fixed and a new case not yet captured is added
to the vector`invalid.mlir` test.

Differential Revision: https://reviews.llvm.org/D80393
mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
mlir/lib/Dialect/Vector/VectorOps.cpp
mlir/lib/Dialect/Vector/VectorTransforms.cpp
mlir/test/Dialect/Vector/invalid.mlir
mlir/test/Dialect/Vector/ops.mlir
mlir/test/Dialect/Vector/vector-contract-transforms.mlir