Abstract

The design and implementation of an interference graph is critical to the performance of a graph-coloring register allocator. The cost of constructing and manipulating the interference graph dominates the overall cost of allocation. The literature on graph-coloring register allocation suggests the use of a bit matrix coupled with lists of edges to represent the graph.1–3 Recently, George and Appel4 claimed that their tests show better results using a hash table. This paper examines the trade-offs between these two approaches. Our experiments were conducted with an optimistic, Chaitin-style register allocator.5 We believe, however, that the lessons learned in the experiment are applicable to any program that needs to build and manipulate large graphs. For most graphs, we obtained our best results, in terms of both time and space, using a modification of the data structures suggested by both Chaitin and Briggs that we call the split bit-matrix method. On a few large graphs, we found that a closed hash-table with the universal hash function suggested by Cormen et al.6 ran faster than the split bit-matrix method. We found one case where it used less space. This suggests that the split bit-matrix technique should be the method of choice, unless the compiler regularly encounters large interference graphs. In that case, the best strategy might be to implement both data structures behind a common interface, and switch between them based on graph size. © 1998 John Wiley & Sons, Ltd.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call