This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] refine insertion code
ClosedPublic

Authored by aartbik on Oct 18 2022, 10:41 AM.

Details

Summary

builds SSA cycle for compress insertion loop
adds casting on index mismatch during push_back

Diff Detail

Event Timeline

aartbik created this revision.Oct 18 2022, 10:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2022, 10:41 AM
aartbik requested review of this revision.Oct 18 2022, 10:41 AM
aartbik updated this revision to Diff 468627.Oct 18 2022, 11:15 AM

move finalization code to end

Peiming accepted this revision.Oct 18 2022, 12:13 PM
This revision is now accepted and ready to land.Oct 18 2022, 12:13 PM
Peiming added inline comments.Oct 18 2022, 12:16 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
283

Can you combine these two into one single Value &field?

283

Or you can return the Value instead to make it more clear

aartbik added inline comments.Oct 18 2022, 2:00 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
283

Note that we use fields[field] and field[1] always, which is why I pass the array.
I can make it field and sizes if you prefer?

Peiming added inline comments.Oct 18 2022, 2:07 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
283

Oh, okay.

I overlooked the field[1], then the current implementation LGTM.

aartbik added inline comments.Oct 18 2022, 2:14 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
283

Thanks!

This revision was automatically updated to reflect the committed changes.