This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Add optional `copy` operand to AllocTensorOp
ClosedPublic

Authored by springerm on May 27 2022, 3:08 PM.

Details

Summary

If copy is specified, the newly allocated buffer is initialized with the given contents. Also add an optional escape attribute to indicate whether the buffer of the tensor may be returned from the parent block (aka. "escape") after bufferization.

This change is in preparation of connecting One-Shot Bufferize to the sparse compiler.

Depends On D126814

Diff Detail

Event Timeline

springerm created this revision.May 27 2022, 3:08 PM
springerm requested review of this revision.May 27 2022, 3:08 PM
aartbik added inline comments.May 27 2022, 3:19 PM
mlir/include/mlir/Dialect/Bufferization/IR/BufferizationOps.td
41

typo

42

rephrase: should be deallocated elsewhere?

mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
300

type needs to be verify()-ed as well

springerm updated this revision to Diff 432660.May 27 2022, 3:51 PM
springerm marked 2 inline comments as done.

address comments

springerm marked an inline comment as done.May 27 2022, 3:51 PM
springerm edited the summary of this revision. (Show Details)Jun 8 2022, 6:57 AM
aartbik accepted this revision.Jun 9 2022, 8:47 AM
This revision is now accepted and ready to land.Jun 9 2022, 8:47 AM
This revision was landed with ongoing or failed builds.Jun 9 2022, 12:42 PM
This revision was automatically updated to reflect the committed changes.