[mlir][sparse] improved testing and codegen for semi-ring operations
authorAart Bik <ajcbik@google.com>
Thu, 16 Jun 2022 19:02:34 +0000 (12:02 -0700)
committerAart Bik <ajcbik@google.com>
Thu, 16 Jun 2022 23:13:42 +0000 (16:13 -0700)
commit2a2886160d80f285d7637f91133ded7bac0f9879
treed8df739645c474a68e918bbc281d83157aaa336b
parent21f557e13a2cf926a97d76ff30ca67bce56c64bb
[mlir][sparse] improved testing and codegen for semi-ring operations

The semi-ring blocks were simply "inlined" by the sparse compiler but
without any filtering or patching. This revision improves the analysis
(rejecting blocks that use non-invariant computations from outside
their blocks, except for linalg.index) and also improves the codegen
by properly patching up index computations (previous version crashed).

With a regression test. Also updated the documentation now that the
example code is properly working.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D128000
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
mlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_triangular_bin.mlir [new file with mode: 0644]