[mlir][sparse] fixed inaccury in maintaining universal index
authorAart Bik <ajcbik@google.com>
Fri, 26 Feb 2021 22:59:32 +0000 (14:59 -0800)
committerAart Bik <ajcbik@google.com>
Sun, 28 Feb 2021 01:32:57 +0000 (17:32 -0800)
commit6afaea6682dc3b0eb7e125847934759be6d0fb5c
tree673aa63ba40a2aa25a92bc56a1fd5dcb9f12d6c9
parent993f4d8ffad6a4504611261758dc42349949a240
[mlir][sparse] fixed inaccury in maintaining universal index

The universal index was maintained if dense indices were still
in place, and lattice points followed. However, it should only
be kept if any of those following lattice points actually
consumes the universal index. This change also fixes an
inaccuracy with a missing broadcast around vector invariant.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D97594
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
mlir/test/Dialect/Linalg/sparse_1d.mlir
mlir/test/Dialect/Linalg/sparse_2d.mlir