[mlir][linalg] Fix generic reduction vectorization
authorthomasraoux <thomasraoux@google.com>
Tue, 12 Oct 2021 22:42:02 +0000 (15:42 -0700)
committerthomasraoux <thomasraoux@google.com>
Tue, 12 Oct 2021 22:46:04 +0000 (15:46 -0700)
commit7c97e328b3b4f5bdf25359057e0aa898aa0a05ca
tree81eb479cde3e0e54d7be37272a8f3131997dc148
parentb6a8c695542b2987eb9a203d5663a0740cb4725f
[mlir][linalg] Fix generic reduction vectorization

We shouldn't broadcast the original value when doing reduction. Instead
we compute the reduction and then combine it with the original value.

Differential Revision: https://reviews.llvm.org/D111666
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/test/Dialect/Linalg/vectorization.mlir