This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Favors synthetic tensor over other undefined tensors
ClosedPublic

Authored by Peiming on Oct 6 2022, 11:39 AM.

Diff Detail

Event Timeline

Peiming created this revision.Oct 6 2022, 11:39 AM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Oct 6 2022, 11:39 AM
Peiming updated this revision to Diff 465816.Oct 6 2022, 11:42 AM

remove debug log

again bonus points for having a nice test

mlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
283

Now that this has become more complex, let's also remove the rather expensive % operator
Why not simply start i = be - 1 -offset in the loop header
and then at the end do

i = i == 0 ? be - 1 : i -1;

It probably also improves readability if you reverse the roles of b and i, since we always use "b" in the indexing, see e.g. L274

mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
412

period at end

Peiming updated this revision to Diff 465854.Oct 6 2022, 1:27 PM
Peiming marked 2 inline comments as done.

address comments.

aartbik accepted this revision.Oct 6 2022, 1:46 PM
This revision is now accepted and ready to land.Oct 6 2022, 1:46 PM
This revision was landed with ongoing or failed builds.Oct 6 2022, 1:51 PM
This revision was automatically updated to reflect the committed changes.