diff options
| author | Ben Kimock <kimockb@gmail.com> | 2022-07-02 14:38:23 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2022-07-12 21:01:33 -0400 |
| commit | afa1dddcf97cf6008cfb447739b4b61e04f86660 (patch) | |
| tree | 43ec8b926f1cf0078e3a9e40030c6d556febb5ac /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff | |
| parent | 6e106617f10b2431aeb0fdb84d50cbdcb0d4dad8 (diff) | |
| download | rust-afa1dddcf97cf6008cfb447739b4b61e04f86660.tar.gz rust-afa1dddcf97cf6008cfb447739b4b61e04f86660.zip | |
Store protectors outside Item, pack Tag and Perm
Previously, Item was a struct of a NonZeroU64, an Option which was usually unset or irrelevant, and a 4-variant enum. So collectively, the size of an Item was 24 bytes, but only 8 bytes were used for the most part. So this takes advantage of the fact that it is probably impossible to exhaust the total space of SbTags, and steals 3 bits from it to pack the whole struct into a single u64. This bit-packing means that we reduce peak memory usage when Miri goes memory-bound by ~3x. We also get CPU performance improvements of varying size, because not only are we simply accessing less memory, we can now compare a Vec<Item> using a memcmp because it does not have any padding.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions
