diff options
author | Matthias Springer <springerm@google.com> | 2022-03-16 17:01:17 +0900 |
---|---|---|
committer | Matthias Springer <springerm@google.com> | 2022-03-16 18:59:27 +0900 |
commit | 9e24f0f4589dfdbc405f72eddd174af7511b2ff3 (patch) | |
tree | f2e020640fccec136d0a8e34dd5bd3a1fc25a7cf /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | fdb41a22ac33edc29703ec9545a451c07bfcfdf8 (diff) | |
download | llvm-9e24f0f4589dfdbc405f72eddd174af7511b2ff3.zip llvm-9e24f0f4589dfdbc405f72eddd174af7511b2ff3.tar.gz llvm-9e24f0f4589dfdbc405f72eddd174af7511b2ff3.tar.bz2 |
[mlir][bufferize] Do not deallocate allocs that are returned from a block
Such IR is rejected by default, but can be allowed with `allow-return-memref`. In preparation of future refactorings, do not deallocate such buffers.
One-Shot Analysis now gathers information about yielded tensors, so that we know during the actual bufferization whether a newly allocated buffer should be deallocated again. (Otherwise, it will leak. This will be addressed in a subsequent commit that also makes `allow-return-memref` a non-experimental flag.)
As a cleanup, `allow-return-memref` is now part of OneShotBufferizationOptions. (It was previously ignored by AlwaysCopyBufferizationState.) Moreover, AlwaysCopyBufferizationState now asserts that `create-deallocs` is deactivated to prevent surprising behavior.
Differential Revision: https://reviews.llvm.org/D121521
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions