[mlir][vector] Add patterns to convert multidimreduce to vector.contract
authorthomasraoux <thomasraoux@google.com>
Thu, 21 Oct 2021 20:20:52 +0000 (13:20 -0700)
committerthomasraoux <thomasraoux@google.com>
Thu, 21 Oct 2021 21:03:32 +0000 (14:03 -0700)
commit1d8cc45b0e4e316dbc4d4724964f1115fdb3f909
tree95a3aa9dc1b2169d3baddfc841a11e55c9c21725
parent5dc339d9825f1dbe788cfb69c88210a59bbf8e3a
[mlir][vector] Add patterns to convert multidimreduce to vector.contract

add several patterns that will simplify contraction vectorization in the
future. With those canonicalizationns we will be able to remove the special
case for contration during vectorization and rely on those transformations to
avoid materizalizing broadcast ops.

Differential Revision: https://reviews.llvm.org/D112121
mlir/include/mlir/Dialect/Vector/VectorOps.h
mlir/lib/Dialect/Vector/VectorTransforms.cpp
mlir/test/Dialect/Vector/vector-reduce-to-contract.mlir [new file with mode: 0644]
mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp