mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
stage1: avoid wasting padding with IR instruction tag
For stage1 ZIR instructions and stage1 AIR instructions, the instruction op code was taking up 8 bytes due to padding even though it only needed 1 byte. This commit reduces the ref_count field from uint32_t to uint16_t because the code only really cares if instructions are referenced at all, not how many times they are referenced. With the ref_count field reduced to uint16_t the uint8_t op code is now placed in the freed up space. Empirically, this saves 382 MiB of peak RAM usage when building the self-hosted compiler, which is a reduction of 5%. Consequently this resulted in a 3% reduction of cache-misses when building the self-hosted compiler. This was @SpexGuy's idea, committed by me because we tested it on my computer.
This commit is contained in:
parent
b9e896d7b0
commit
40764650af
1 changed files with 5 additions and 6 deletions
Loading…
Add table
Add a link
Reference in a new issue