logoalt Hacker News

Rat's Register Allocator

57 points • by mpweiher • yesterday at 7:10 AM • 3 comments • view on HN

Comments

tonfa • today at 12:05 PM

> The best assignment is NP-hard to find, so all practical allocators use heuristics.

That said if you do the register allocation while the program is still in SSA form, it becomes polynomial (interference graph is a chordal graph).

https://compilers.cs.uni-saarland.de/projects/ssara/

➕ show 1 reply
ndesaulniers • today at 6:43 PM

This is a great high level overview of some the techniques and problems encountered with developing a register allocator!

LLVM 's FastRegAlloc also uses linear scan.