This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Replace the folding of nop convert with a codegen rule.
ClosedPublic

Authored by bixia on Oct 18 2022, 5:22 PM.

Details

Summary

This is to allow the use of a nop convert to express that the sparse tensor
allocated through bufferization::AllocTensorOp will be expanded to sparse
tensor storage by sparse tensor codegen.

Diff Detail

Event Timeline

bixia created this revision.Oct 18 2022, 5:22 PM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Oct 18 2022, 5:22 PM
bixia updated this revision to Diff 468926.Oct 19 2022, 8:27 AM

Rebase. Fix format.

aartbik accepted this revision.Oct 19 2022, 8:54 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
710

we now have a difference between codegen ("folded") and conversion (not "folded").
You probably want to add it to conversion too as new case (and test), so we are consistent again

mlir/test/Dialect/SparseTensor/fold.mlir
5

please remove this test completely from this file
(fold.mlir is to test folding, and we no longer do that)

This revision is now accepted and ready to land.Oct 19 2022, 8:54 AM
bixia updated this revision to Diff 468948.Oct 19 2022, 9:59 AM
bixia marked an inline comment as done.

Remove trivial convert from fold.mlir.

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
710

Actually, the conversion pass already folds this, see code