|
|
|
|
|
by aseipp
1477 days ago
|
|
No. First, most compilers actually abandon SSA by the time they begin register allocation through phi elimination, and once you do this you have given up that property. Beyond that, coloring a perfect graph (an SSA graph) can be done in quadratic time, but coloring is not the most interesting part of the process, since you almost always have to insert spills which modifies the interference graph. Register allocation is more than just coloring. On top of that, most ISAs have complications like specific registers needing to be pinned for specific operations, or register aliasing on x86-64, that make things hairier. In practice, theoretical optimality matters far less than the actual heuristics you use (e.g. avoid spills inside of a loop.) |
|
It would seem like there is still ample space to study the application of neural networks to register allocation. [2] They already gave pretty good results to branch prediction. [3]
What are your thoughts on the application of NN for RA and how would you structure the training set?
[1] http://incompleteideas.net/IncIdeas/BitterLesson.html
[2] https://www.semanticscholar.org/paper/Real-time-physical-reg... I haven't read the paper, just found in a quick search.
[3] https://cseweb.ucsd.edu/~atsmith/rnn_branch.pdf