Abstract. We present a simple algorithm for register allocation which is competitive with the iterated register coalescing algorithm of George and Appel. We base our algorithm on the observation that 95% of the methods in the Java 1.5 library have chordal interference graphs when compiled with the JoeQ compiler. A greedy algorithm can optimally color a chordal graph in time linear in the number of edges, and we can easily add powerful heuristics for spilling and coalescing. Our experiments show that the new algorithm produces better results than iterated register coalescing for settings with few registers and comparable results for settings with many registers.
Following Andersson's work, Pereira and Palsberg REF tested the interference graphs of the Java standard library compiled with the JoeQ compiler for chordality and found that 95% of them were chordal.
Register allocation via coloring of chordal graphs
In Proceedings of APLAS’05, Asian Symposium on Programming Languages and Systems
Computer Science