Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: In-place update of tuples/records
Starting with Erlang version 26, all tuples are updated using the update_record instruction. Updating tuples in-place, when safe to do so, can lead to performance improvements, both due to less copying but also due to less garbage. This optimization is implemented in the beam_ssa_destructive_update-pass. During the scanning phase, we look for update_record instructions where the source tuple dies with the update and the source is unique as detected by the alias analysis pass. During the patching phase of beam_ssa_destructive_update, the detected update_record instructions are given the `inplace` hint. During initial-value-search, literal tuples are detected and during the patching phase rewritten to be created using put_tuple as literals cannot be updated in-place.
- Loading branch information