| ▲ | leonidasrup 4 hours ago | |
No compiler does optimal register allocation, because optimal register allocation is an NP-complete problem. Chaitin et al.: "Register allocation via coloring". | ||
| ▲ | hansvm an hour ago | parent [-] | |
Yes? And stochastic methods are one way to approximate optimal NP solutions. In the context of register allocation, you'd be most likely to see that when modeling actual runtime optimality rather than minimizing spill or whatever. Mainstream compilers don't do that, but mainstream compilers don't incorporate many SOTA techniques. | ||