This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize] Avoid tensor copies when the data is not read
ClosedPublic

Authored by springerm on Jun 1 2022, 1:24 PM.

Details

Summary

There are various shortcuts in BufferizationState::getBuffer that avoid a buffer copy when we just need an allocation (and no initialization). This change adds those shortcuts to the TensorCopyInsertion pass, so that getBuffer can be simplified in a subsequent change.

Depends On D126819

Diff Detail

Event Timeline

springerm created this revision.Jun 1 2022, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:24 PM
springerm requested review of this revision.Jun 1 2022, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:24 PM
aartbik accepted this revision.Jun 9 2022, 8:59 AM
aartbik added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
354

nit: rephrase, old values not needed or something like this

This revision is now accepted and ready to land.Jun 9 2022, 8:59 AM
springerm updated this revision to Diff 435827.Jun 10 2022, 1:17 AM

address comments

springerm marked an inline comment as done.Jun 10 2022, 1:18 AM
This revision was landed with ongoing or failed builds.Jun 10 2022, 1:26 AM
This revision was automatically updated to reflect the committed changes.