This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] add narrower choices for pointers/indices
ClosedPublic

Authored by aartbik on Jan 19 2021, 6:48 PM.

Details

Summary

Use cases with 16- or even 8-bit pointer/index structures have been identified.

Diff Detail

Event Timeline

aartbik created this revision.Jan 19 2021, 6:48 PM
aartbik requested review of this revision.Jan 19 2021, 6:48 PM
penpornk accepted this revision.Jan 19 2021, 7:26 PM

Thank you for adding this, Aart! :)

mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
518

Is the type signed by default when isSigned is not specified? I think we want unsigned int8 too.

This revision is now accepted and ready to land.Jan 19 2021, 7:26 PM
aartbik marked an inline comment as done.Jan 19 2021, 7:57 PM
aartbik added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
518

These are "signless" (MLIR knows signed, unsigned, and signless). I indeed don't like that the lowering of the cast from signless to index uses a sign extension (llvm.sext), but explicitly unsigned integers are cast incompatible with index for some reason.

aartbik marked an inline comment as done.Jan 19 2021, 8:07 PM
aartbik added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
518

Signless really leaves it to the operator to decide what interpretation is the best. So I think I should use "zexti" instead of the index_cast, and we are good!

I will do that in a follow-up CL though....

This revision was automatically updated to reflect the committed changes.