This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Add `createDealloc` options
ClosedPublic

Authored by springerm on Dec 31 2021, 7:40 AM.

Details

Summary

If createDealloc is deactivated (enabled by default), newly allocated buffers are not deallocated anymore. In such a case, the missing deallocations can be inserted by the existing "BufferDeallocation" pass.

This change is needed for unifying core bufferization and Comprehensive Bufferize. Core bufferization has a separate pass for generating deallocations.

Note: In the future, this will evolve towards generating deallocation ops only for buffer allocations that do not escape block boundaries (i.e., that are in destination passing style).

Depends On D116449

Diff Detail

Event Timeline

springerm created this revision.Dec 31 2021, 7:40 AM
springerm requested review of this revision.Dec 31 2021, 7:40 AM
nicolasvasilache accepted this revision.Jan 6 2022, 12:21 AM

If createDealloc is true (default), newly allocated buffers are deallocated.
Otherwise, the missing deallocations should be inserted by explicitly calling the existing "BufferDeallocation" pass.

mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
380

can we drop the default here ? it does not seem to bring value

This revision is now accepted and ready to land.Jan 6 2022, 12:21 AM
This revision was automatically updated to reflect the committed changes.