swift
46433c4c - SIL: array buffer re-allocation functions are not deinit barriers

Commit
39 days ago
SIL: array buffer re-allocation functions are not deinit barriers Add a "realloc_array_buffer" semantics attribute to the `_consumeAndCreateNew` functions of `_ArrayBuffer` and `_ContiguousArrayBuffer` and don't treat calls to such functions as deinit barriers. Those functions only move or copy the array elements into a new buffer. They cannot run any user code and therefore cannot observe a de-initializer which runs earlier. But because they are not inlined and their side effects include releasing the old buffer, calls to them would be conservatively considered as deinit barriers. This blocks optimizations, like CopyPropagation, which shrink lifetimes up to deinit barriers.
Author
Committer
Parents
Loading