[mlir][sparse] retry sparse-only for cyclic iteration graphs
authorAart Bik <ajcbik@google.com>
Thu, 14 Jan 2021 20:04:49 +0000 (12:04 -0800)
committerAart Bik <ajcbik@google.com>
Fri, 15 Jan 2021 06:39:29 +0000 (22:39 -0800)
commit5508516b06633e95fb5c2d6a5e196e4dcaa72c8d
tree0a3f1f3b729d65285992f429b0baf885db9012bb
parent39665d9aabb7cd92d58f8ba45b32a1899922ec01
[mlir][sparse] retry sparse-only for cyclic iteration graphs

This is a very minor improvement during iteration graph construction.
If the first attempt considering the dimension order of all tensors fails,
a second attempt is made using the constraints of sparse tensors only.
Dense tensors prefer dimension order (locality) but provide random access
if needed, enabling the compilation of more sparse kernels.

Reviewed By: penpornk

Differential Revision: https://reviews.llvm.org/D94709
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
mlir/test/Dialect/Linalg/sparse_nd.mlir [new file with mode: 0644]