This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] LICM for SparseTensorReader::readCOO
ClosedPublic

Authored by wrengr on Nov 19 2022, 4:13 PM.

Details

Summary

This commit performs two related changes. First we adjust readCOOValue to take the IsPattern bool as a template parameter rather than a function argument. Second we factor readCOOLoop out from readCOO, and template it on IsPattern and IsSymmetric. Together this moves all the assertions and header-dependent conditionals out of the main for-loop of readCOO. The only remaining conditional is in the IsSymmetric=true variant: checking whether the element is on the diagonal or not (which cannot be lifted out of the loop).

Depends On D138363

Diff Detail

Event Timeline

wrengr created this revision.Nov 19 2022, 4:13 PM
wrengr requested review of this revision.Nov 19 2022, 4:13 PM
wrengr updated this revision to Diff 476971.Nov 21 2022, 12:18 PM

Rebasing to incorporate the bugfix of https://reviews.llvm.org/D138363#3941956

wrengr updated this revision to Diff 477336.Nov 22 2022, 4:09 PM

Fixing rebase bug

wrengr updated this revision to Diff 477367.Nov 22 2022, 6:40 PM

git-clang-format

aartbik accepted this revision.Nov 30 2022, 7:57 PM
This revision is now accepted and ready to land.Nov 30 2022, 7:57 PM
This revision was automatically updated to reflect the committed changes.