Files
rust/compiler/rustc_mir_transform
bors 69bccf03c4 Auto merge of #163915 - joshtriplett:mir-shrink-to-fit, r=nnethercote
Shrink MIR basic-block statement vectors to fit before caching them

Every MIR basic block allocates a vector for its statements. These statement vectors grow via the usual heuristics, and never get re-shrunk to the correct size for their contents. This holds on to a fair bit of memory.

Shrink them to fit right before we cache them.

For an aws-sdk-ec2 check, this saves ~80 MiB of peak max-RSS (~1.45%), at the cost of 0.3% in instructions.

r? nnethercote
2026-10-09 13:17:24 +00:00
..