This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Decouple buffer-deallocation from One-Shot Bufferize
ClosedPublic

Authored by springerm on May 23 2022, 3:59 PM.

Details

Summary

The buffer deallocation pass must now be run explicitly when allow-return-alloc is set.

This results in a few extra buffer copies in unoptimized test cases. The proper way to avoid such copies is to relax the OpOperand/OpResult aliasing contract on ops such as scf.for. Some of these copies can also be avoided by improving the buffer deallocation pass.

The purpose of this change is to remove finalizeBuffers, which made it difficult to extend the bufferization to custom buffer types.

Depends On D126569

Diff Detail

Event Timeline

springerm created this revision.May 23 2022, 3:59 PM
springerm requested review of this revision.May 23 2022, 3:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 3:59 PM
aartbik accepted this revision.Jun 9 2022, 8:41 AM
This revision is now accepted and ready to land.Jun 9 2022, 8:41 AM