Page MenuHomePhabricator

[mlir][bufferization][NFC] Make `escape` a dialect attribute
ClosedPublic

Authored by springerm on Sun, Jun 19, 4:24 AM.

Details

Summary

All bufferizable ops that bufferize to an allocation receive a bufferization.escape attribute during TensorCopyInsertion.

Diff Detail

Event Timeline

springerm created this revision.Sun, Jun 19, 4:24 AM
springerm requested review of this revision.Sun, Jun 19, 4:24 AM
aartbik added inline comments.Wed, Jun 22, 9:51 AM
mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
31

did you really intent, "may bufferize to", or will "bufferizes to" be better?

mlir/include/mlir/Dialect/Bufferization/IR/BufferizationBase.td
43

perhaps add one more sentence on clarifying "escape", for example

which means the buffer needs to be allocated outside this method

or

which means the allocation "escape" the scope of the method to the caller

(or something like that

mlir/lib/Dialect/Bufferization/Transforms/TensorCopyInsertion.cpp
69

Can't we use this condition to guard the whole analysis?

springerm marked 2 inline comments as done.Thu, Jun 23, 4:09 AM
springerm added inline comments.
mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
31

Yes, this is on purpose. Sometimes we don't know what's going to happen at runtime. Then we should return true here. Extended the comment.

springerm updated this revision to Diff 439325.Thu, Jun 23, 4:10 AM

address comments

aartbik accepted this revision.Thu, Jun 23, 9:41 AM
This revision is now accepted and ready to land.Thu, Jun 23, 9:41 AM
This revision was landed with ongoing or failed builds.Thu, Jun 23, 10:34 AM
This revision was automatically updated to reflect the committed changes.