[mlir][sparse] Improve the rewriting for NewOp with dimension ordering.
authorbixia1 <bixia@google.com>
Mon, 9 Jan 2023 16:45:18 +0000 (08:45 -0800)
committerbixia1 <bixia@google.com>
Mon, 9 Jan 2023 22:40:33 +0000 (14:40 -0800)
commitf3fd739d39abd3bee289e00a7ae9a4602d995cbb
tree75238c3bf1f99019d70fd6ebe1c677e82dabe7aa
parent8b259fe573e109ea03c91aca34d5bd60f1a432ff
[mlir][sparse] Improve the rewriting for NewOp with dimension ordering.

Previously, we use a temporary tensor with identity ordering. We now use a
temporary tensor with the destination dimension ordering, to enable the use of
sort_coo for sorting the tensor.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D141295
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
mlir/test/Dialect/SparseTensor/rewriting_for_codegen.mlir