This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Implement heap sort for sparse_tensor.sort.
ClosedPublic

Authored by bixia on Jan 30 2023, 10:15 AM.

Diff Detail

Event Timeline

bixia created this revision.Jan 30 2023, 10:15 AM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Jan 30 2023, 10:15 AM
aartbik accepted this revision.Feb 2 2023, 11:26 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp
685

has index type (not an, there is only one)

697

The generated

706

the ++ are not on the variables

706

the comment that the right child exists does not apply to L706, so it should be moved as header of the if-statement

747

since you do this twice, would a helper make this shorter?

This revision is now accepted and ready to land.Feb 2 2023, 11:26 AM
bixia updated this revision to Diff 494440.Feb 2 2023, 2:55 PM
bixia marked 4 inline comments as done.

Fix comments to address review feedback.

mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp
747

The two if ((n-2)/2==child) look the same in c but different in MLIR, as the second one needs to yields (child, childIdx) so support the enclosing while-stmt. So I have a helper lambda to generate getLargerChild instead.

This revision was automatically updated to reflect the committed changes.