Rat's Register Allocator
home blog show lab fav res ideas tools rat's register allocator October 7th, 2026 rat is my smallish compiler backend (with a semi-working C99 frontend). Its x86-64 code generator translates the intermediate representation (IR) into x86-64 instructions. These use an unlimited number of virtual registers (vregs). The register allocator maps each vreg to a physical register: a general-purpose register (12 can be used) or an xmm register (14 on Linux1). When no register is free, it maps the vreg to
Read full article →