This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] fixed bug with unary op, dense output
ClosedPublic

Authored by aartbik on Jun 2 2023, 5:13 PM.

Details

Summary

Note that by sparse compiler convention, dense output
is zerod out when not set, so complement results in
zeros where elements were present.

Diff Detail

Event Timeline

aartbik created this revision.Jun 2 2023, 5:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 5:13 PM
aartbik requested review of this revision.Jun 2 2023, 5:13 PM
wrengr accepted this revision.Jun 2 2023, 5:20 PM
wrengr added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
1067–1068

Even though it'd make the diff larger, I think it'd be a lot clearer to invert this conditional. That way we'd have if (isSparseOut) { if (kind != kSelect) { genInsertionStore; return; } ...everything_else; return; } which helps "resolve" the conditional right away so the reader doesn't have to keep it pending in the back of their mind while reading that long everything_else part.

This revision is now accepted and ready to land.Jun 2 2023, 5:20 PM
aartbik updated this revision to Diff 528049.Jun 2 2023, 5:51 PM

addressed comment

This revision was automatically updated to reflect the committed changes.