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.
Depends On D121520