The complexity of register allocation

  • Authors:
  • Philipp Klaus Krause

  • Affiliations:
  • -

  • Venue:
  • Discrete Applied Mathematics
  • Year:
  • 2014

Quantified Score

Hi-index 0.04

Visualization

Abstract

In compilers, register allocation is one of the most important stages with respect to optimization for typical goals, such as code size, code speed, or energy efficiency. Graph theoretically, optimal register allocation is the problem of finding a maximum weight r-colorable induced subgraph in the conflict graph of a given program. The parameter r is the number of registers. Large classes of programs are structured, i.e. their control-flow graphs have bounded tree-width (Thorup (1998) [17], Gustedt et al. (2002) [8] and Burgstaller et al. (2004) [3]). The decision problem of deciding if a conflict graph of a structured program is r-colorable is known to be fixed-parameter tractable (Bodlaender et al. (1998) [1]). Optimal register allocation for structured programs is known to be in XP (Krause (2013) [13]). We complement these results by showing that optimal register allocation parametrized by r is W[SAT]-hard. This even holds for programs using only if/else and while as control structures; these programs form are subclass of the structured programs.