Register allocation via clique separators

  • Authors:
  • R. Gupta;M. L. Soffa;T. Steele

  • Affiliations:
  • Philips Laboratories, 345 Scarborough Road, Briarcliff Manor, NY;Dept. of Computer Science, University of Pittsburgh, Pittsburgh, PA 15260;AT&T Bell Laboratories, 75 Foundation Avenue, Ward Hill, MA

  • Venue:
  • PLDI '89 Proceedings of the ACM SIGPLAN 1989 Conference on Programming language design and implementation
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

Although graph coloring is widely recognized as an effective technique for global register allocation, the overhead can be quite high, not only in execution time but also in memory, as the size of the interference graph needed in coloring can become quite large. In this paper, we present an algorithm based upon a result by R. Tarjan regarding the colorability of graphs which are decomposable using clique separators, that improves on the overhead of coloring. The algorithm first partitions program code into code segments using the notion of clique separators. The interference graphs for the code partitions are next constructed one at a time and colored independently. The colorings for the partitions are combined to obtain a register allocation for the program code. The technique presented is both efficient in space and time because the graph for only a single code segment needs to be constructed and colored at any given point in time. The partitioning of a graph using clique separators increases the likelihood of obtaining a coloring without spilling and hence an efficient allocation of registers for the program. For straight line code an optimal allocation for the entire program code can be obtained from optimal allocations for individual code segments. In the presence of branches, optimal allocation along one execution path and a near optimal allocation along alternative paths can be potentially obtained. Since the algorithm is highly efficient, it eliminates the need for a local register allocation phase.