3 ms·
Register allocation is not that hard, especially if you don't do it via graph coloring and have more than 2 general-purpose registers available. Build SSA form,
by Joker_vD 5y ago
Register allocation is not that hard, especially if you don't do it via graph coloring and have more than 2 general-purpose registers available. Build SSA form, remove critical edges, spill temporaries until the number of simultaneously live temporaries is strictly less than the number of available registers, assign registers in a straightforward manner, move out of SSA (that's where that one unused register may come in handy). See [0] and its bibliography for more details.
[0] https://hal-lara.archives-ouvertes.fr/hal-02102286/file/RR2006-13.pdf https://hal-lara.archives-ouvertes.fr/hal-02102286/file/RR20...