Register allocation after classical SSA elimination is NP-Complete

  • Authors:
  • Fernando Magno Quintão Pereira;Jens Palsberg

  • Affiliations:
  • UCLA, University of California, Los Angeles;UCLA, University of California, Los Angeles

  • Venue:
  • FOSSACS'06 Proceedings of the 9th European joint conference on Foundations of Software Science and Computation Structures
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Chaitin proved that register allocation is equivalent to graph coloring and hence NP-complete. Recently, Bouchez, Brisk, and Hack have proved independently that the interference graph of a program in static single assignment (SSA) form is chordal and therefore colorable in linear time. Can we use the result of Bouchez et al. to do register allocation in polynomial time by first transforming the program to SSA form, then performing register allocation, and finally doing the classical SSA elimination that replaces φ-functions with copy instructions? In this paper we show that the answer is no, unless P = NP: register allocation after classical SSA elimination is NP-complete. Chaitin's proof technique does not work for programs after classical SSA elimination; instead we use a reduction from the graph coloring problem for circular arc graphs.