Lexicon Entry
Register Spilling
When the register allocator runs out of physical registers to hold active variables, it 'spills' a value to a stack slot in memory. This adds latency but allows the program to continue.
Related Knowledge & Cross-References
Guide
Register Allocation in Compilers: How Variables Fit into CPU Registers
Discover how compilers solve register allocation — mapping thousands of virtual registers to 16 (x86-64) or 31 (ARM64) physical ones. See graph coloring, spilling, and rematerialization with real Godbolt examples.