[mlir][SparseTensor] Split scf.for loop into masked/unmasked parts
authorMatthias Springer <springerm@google.com>
Thu, 19 Aug 2021 12:46:12 +0000 (21:46 +0900)
committerMatthias Springer <springerm@google.com>
Thu, 19 Aug 2021 12:53:11 +0000 (21:53 +0900)
commit76a186181634feaeaa2d0493aac2b796d2a3ef25
tree26ddef30a24abb1bfdc9ab3e7c6933a5cb2345b1
parentec54e275f56cc042eb9c25acd76bff18b9ea8092
[mlir][SparseTensor] Split scf.for loop into masked/unmasked parts

Apply the "for loop peeling" pattern from SCF dialect transforms. This pattern splits scf.for loops into full and partial iterations. In the full iteration, all masked loads/stores are canonicalized to unmasked loads/stores.

Differential Revision: https://reviews.llvm.org/D107733
mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.td
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
mlir/test/Dialect/SparseTensor/sparse_vector.mlir
mlir/test/Dialect/SparseTensor/sparse_vector_peeled.mlir [new file with mode: 0644]
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel