diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-07-10 15:27:33 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-07-10 15:38:13 -0700 |
| commit | 40764650afd47f2ca2d191ed4d910f680702e014 (patch) | |
| tree | 0dd5d4a704d74b4d6515f18bfd070aeadf50b4e9 /src/stage1/error.cpp | |
| parent | b9e896d7b076e59d6f6dd9b0bad9697875d1f6e4 (diff) | |
| download | zig-40764650afd47f2ca2d191ed4d910f680702e014.tar.gz zig-40764650afd47f2ca2d191ed4d910f680702e014.zip | |
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.
Diffstat (limited to 'src/stage1/error.cpp')
0 files changed, 0 insertions, 0 deletions
