Tech News
← Home  ·  All topics

Register Allocator

1 GoKawiil brief on this topic

Developer replaces rat compiler's linear-scan allocator with a 584-line priority bin-packing design

The creator of the rat compiler backend rewrote its x86-64 register allocator, discarding a 1392-line linear scan implementation that had grown incrementally over time. The replacement is a priority bin-packing allocator of 584 lines that assigns virtual registers to physical registers or stack slots by visiting live ranges in order of importance rather than program order, similar in approach to LLVM's greedy allocator.