[mlir][sparse] generalize reduction support in sparse compiler
authorAart Bik <ajcbik@google.com>
Tue, 21 Sep 2021 21:48:49 +0000 (14:48 -0700)
committerAart Bik <ajcbik@google.com>
Wed, 22 Sep 2021 19:36:46 +0000 (12:36 -0700)
commit5da21338bcd0fe377fc788b1b24cf055ab1977af
treec64af83dcb229cf86879b1b930013654e6318ee2
parenta85d7a56c7bbd9b3c8409c00f48de47bec5fc8af
[mlir][sparse] generalize reduction support in sparse compiler

Now not just SUM, but also PRODUCT, AND, OR, XOR. The reductions
MIN and MAX are still to be done (also depends on recognizing
these operations in cmp-select constructs).

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D110203
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
mlir/test/Dialect/SparseTensor/sparse_vector.mlir
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_reductions.mlir [new file with mode: 0644]