This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] lower trivial tensor.cast on identical sparse tensors
ClosedPublic

Authored by aartbik on Oct 20 2021, 12:49 PM.

Details

Summary

Even though tensor.cast is not part of the sparse tensor dialect,
it may be used to cast static dimension sizes to dynamic dimension
sizes for sparse tensors without changing the actual sparse tensor
itself. Those cases should be lowered properly when replacing sparse
tensor types with their opaque pointers. Likewise, no op sparse
conversions are handled by this revision in a similar manner.

Diff Detail

Event Timeline

aartbik created this revision.Oct 20 2021, 12:49 PM
aartbik requested review of this revision.Oct 20 2021, 12:49 PM
aartbik updated this revision to Diff 381085.Oct 20 2021, 1:27 PM

handle hidden nop cast too

bixia accepted this revision.Oct 25 2021, 10:08 AM

This PR also fixes sparse_tensor.convert to handle the no-op conversion case.
It would be nice to mention this in the PR description.
Rather than this, everything looks good to me.

This revision is now accepted and ready to land.Oct 25 2021, 10:08 AM
aartbik edited the summary of this revision. (Show Details)Oct 25 2021, 10:29 AM