This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization][sparse] put restriction on sparse tensor allocation
ClosedPublic

Authored by aartbik on Jun 23 2022, 2:12 PM.

Details

Summary

Putting some direct use restrictions on tensor allocations in the
sparse case enables the use of simplifying assumptions in the
bufferization analysis.

Diff Detail

Event Timeline

aartbik created this revision.Jun 23 2022, 2:12 PM
aartbik requested review of this revision.Jun 23 2022, 2:12 PM
springerm accepted this revision.Jun 24 2022, 12:59 AM
springerm added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
260–261

I think you mentioned that it is also not allowed to pass an AllocTensorOp result into a ConvertOp.

This revision is now accepted and ready to land.Jun 24 2022, 12:59 AM
aartbik marked an inline comment as done.Jun 24 2022, 10:57 AM
aartbik added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
260–261

You are right that there are a few other "local" cases we should verify, but I need to think about this a bit more (and most of these are "caught" by failure to rewrite). But for now, this at least avoids passing those weird uninitialized sparse tensors across function boundaries ;-)

This revision was automatically updated to reflect the committed changes.
aartbik marked an inline comment as done.