This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Refactor the convert operator conversion to support codegen for the operator.
ClosedPublic

Authored by bixia on Oct 18 2022, 4:11 PM.

Details

Summary

Outline the code that generates the loop structure to iterate over a dense
tensor or a sparse constant to genDenseTensorOrSparseConstantIterLoop.

Move a few routines to CodegenUtils for sharing.

Diff Detail

Event Timeline

bixia created this revision.Oct 18 2022, 4:11 PM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Oct 18 2022, 4:11 PM
Peiming added inline comments.Oct 19 2022, 10:51 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
816

Is the variable used in this function?

bixia updated this revision to Diff 469075.Oct 19 2022, 4:36 PM

Rebase.

bixia updated this revision to Diff 469080.Oct 19 2022, 4:44 PM

Remove an unused variable.

bixia marked an inline comment as done.Oct 19 2022, 4:45 PM
bixia added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
816

Good catch. Fixed.

bixia updated this revision to Diff 469408.Oct 20 2022, 4:42 PM
bixia marked an inline comment as done.

Rebase.

wrengr accepted this revision.Oct 20 2022, 4:47 PM
wrengr added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
80

"an"

mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
269

Should have a space after the period

This revision is now accepted and ready to land.Oct 20 2022, 4:47 PM
bixia updated this revision to Diff 469624.Oct 21 2022, 8:30 AM
bixia marked 2 inline comments as done.

Fix comment.