## Structured Programs have Small Tree-Width and Good Register Allocation (1995)

Venue: | Information and Computation |

Citations: | 53 - 1 self |

### BibTeX

@ARTICLE{Thorup95structuredprograms,

author = {Mikkel Thorup},

title = {Structured Programs have Small Tree-Width and Good Register Allocation},

journal = {Information and Computation},

year = {1995},

volume = {142},

pages = {318--332}

}

### Years of Citing Articles

### OpenURL

### Abstract

The register allocation problem for an imperative program is often modelled as the coloring problem of the interference graph of the control-flow graph of the program. The interference graph of a flow graph G is the intersection graph of some connected subgraphs of G. These connected subgraphs represent the lives, or life times, of variables, so the coloring problem models that two variables with overlapping life times should be in different registers. For general programs with unrestricted gotos, the interference graph can be any graph, and hence we cannot in general color within a factor O(n " ) from optimality unless NP=P. It is shown that if a graph has tree-width k, we can efficiently color any intersection graph of connected subgraphs within a factor (bk=2c + 1) from optimality. Moreover, it is shown that structured (j goto-free) programs, including, for example, short circuit evaluations and multiple exits from loops, have tree-width at most 6. Thus, for every structured progr...