This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization][NFC] Move sparse_tensor.release to bufferization dialect
ClosedPublic

Authored by springerm on Jul 18 2022, 12:42 AM.

Details

Summary

This op used to belong to the sparse dialect, but there are use cases for dense bufferization as well. (E.g., when a tensor alloc is returned from a function and should be deallocated at the call site.) This change moves the op to the bufferization dialect, which now has an alloc_tensor and a dealloc_tensor op.

Diff Detail

Event Timeline

springerm created this revision.Jul 18 2022, 12:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 12:42 AM
springerm requested review of this revision.Jul 18 2022, 12:42 AM
aartbik accepted this revision.Jul 18 2022, 10:32 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
142

just curious, we add the full dialect but also some individual ops; does that work as expected?

142

He, did we have this twice defined? Good catch.

This revision is now accepted and ready to land.Jul 18 2022, 10:32 AM
springerm marked 2 inline comments as done.Jul 19 2022, 12:13 AM
springerm added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
142

I think all ops of the bufferization dialect are legal. Except for the ones for which we have special rules (AllocTensorOp, DeallocTensorOp), those have another chance to become illegal.