## A Generalized Algorithm for Graph-Coloring Register Allocation (2004)

### Cached

### Download Links

- [www.eecs.harvard.edu]
- [perso.ens-lyon.fr]
- [www.iro.umontreal.ca]
- [www.eecs.harvard.edu]
- [www.cs.virginia.edu]
- [www.cs.tufts.edu]
- DBLP

### Other Repositories/Bibliography

Citations: | 30 - 5 self |

### BibTeX

@MISC{Smith04ageneralized,

author = {Michael D. Smith and Norman Ramsey and Glenn Holloway},

title = {A Generalized Algorithm for Graph-Coloring Register Allocation},

year = {2004}

}

### Years of Citing Articles

### OpenURL

### Abstract

Graph-coloring register allocation is an elegant and extremely popular optimization for modern machines. But as currently formulated, it does not handle two characteristics commonly found in commercial architectures. First, a single register name may appear in multiple register classes, where a class is a set of register names that are interchangeable in a particular role. Second, multiple register names may be aliases for a single hardware register. We present a generalization of graph-coloring register allocation that handles these problematic characteristics while preserving the elegance and practicality of traditional graph coloring. Our generalization adapts easily to a new target machine, requiring only the sets of names in the register classes and a map of the register aliases. It also drops easily into a well-known graph-coloring allocator, is efficient at compile time, and produces high-quality code.

### Citations

834 | MediaBench: A tool for evaluating and synthesizing multimedia and communications systems - Lee, Potkonjak, et al. - 1997 |

425 |
allocation and spilling via graph coloring
- CHAITIN
- 1982
(Show Context)
Citation Context ...ssignment. Although k-coloring is NP-complete, Chaitin developed a simple approach that does well in practice for interference graphs containing nodes of a single register class [Chaitin et al. 1981; =-=Chaitin 1982-=-]. Chaitin’s approach is based on the observation that when node n has fewer than k neighbors, i.e., degree n <k,itistrivially colorable. No matter how colors are assigned to its neighbor nodes, there... |

197 | Register allocation via coloring - Chaitin, Auslander, et al. - 1981 |

181 | Improvements to graph coloring register allocation - Briggs, Cooper, et al. - 1994 |

170 |
Modern compiler implementation in Java
- Appel
- 2002
(Show Context)
Citation Context ...ng, register allocation 1 Introduction The reduction of register allocation to a graph-coloring problem is elegant, effective, and practical. It is warmly endorsed by modern textbooks [Muchnick 1997; =-=Appel and Palsberg 2002-=-; Cooper and Torczon 2003] and widely used in modern compilers. But two assumptions at the heart of the algorithm are invalid for most commercial instruction sets: registers are expected to be interch... |

142 | Iterated register coalescing
- George, Appel
- 1996
(Show Context)
Citation Context ...= squeezeChange(n, vertex(t.class), -worst1(n.class, t.class)); 5 Generalizing a Representative Allocator The iterated-coalescing algorithm is a textbook example of graphcoloring register allocation [=-=George and Appel 1996-=-; Appel andsint squeezeChange(IgNode n, Vertex v, int delta) { int alpha = n.rawSqueeze[v]; } n.rawSqueeze[v] += delta; int filteredChange = Delta(alpha, delta, bound(n.class, v)); if (filteredChange ... |

139 | Register Allocation via Graph Coloring
- Briggs
- 1992
(Show Context)
Citation Context ...ve (i.e., holds a value that may be used before it is overwritten). The candidate’s class is chosen by intersecting the register-class requirements of all operand locations occupied by the candidate [=-=Briggs 1992-=-]. The set of live points is obtained by running live-variable analysis [Muchnick 1997]. With this information, the construction of an interference graph is straightforward. Each node represents a reg... |

77 | Engineering a Compiler
- Cooper, Torczon
- 2004
(Show Context)
Citation Context ... Introduction The reduction of register allocation to a graph-coloring problem is elegant, effective, and practical. It is warmly endorsed by modern textbooks [Muchnick 1997; Appel and Palsberg 2002; =-=Cooper and Torczon 2003-=-] and widely used in modern compilers. But two assumptions at the heart of the algorithm are invalid for most commercial instruction sets: registers are expected to be interchangeable and independent.... |

64 | Optimal spilling for cisc machines with few registers
- Appel, George
- 2001
(Show Context)
Citation Context ...hich registers alias. A number of researchers have cast register allocation as a mathematical-programming problem, rather than a graph-coloring problem [Goodwin and Wilken 1996; Kong and Wilken 1998; =-=Appel and George 2001-=-; Fu and Wilken 2002; Scholz and Eckstein 2002; Hirnschrott, Krall, and Scholz 2003]. These approaches can handle a wide variety of architectural irregularities, but these benefits come at the cost of... |

60 |
Optimal and near-optimal global register allocation using 0-1 integer programming
- Goodwin, Wilken
- 1996
(Show Context)
Citation Context ...thm does not seem to support architectures in which registers alias. A number of researchers have cast register allocation as a mathematical-programming problem, rather than a graph-coloring problem [=-=Goodwin and Wilken 1996-=-; Kong and Wilken 1998; Appel and George 2001; Fu and Wilken 2002; Scholz and Eckstein 2002; Hirnschrott, Krall, and Scholz 2003]. These approaches can handle a wide variety of architectural irregular... |

41 |
Register allocation via coloring”, Computer Languages 6
- Chaitin, Auslander, et al.
- 1981
(Show Context)
Citation Context ...er receive the same assignment. Although k-coloring is NP-complete, Chaitin developed a simple approach that does well in practice for interference graphs containing nodes of a single register class [=-=Chaitin et al. 1981-=-; Chaitin 1982]. Chaitin’s approach is based on the observation that when node n has fewer than k neighbors, i.e., degree n <k,itistrivially colorable. No matter how colors are assigned to its neighbo... |

25 | Precise register allocation for irregular architectures
- Kong, Wilken
- 1998
(Show Context)
Citation Context ...ort architectures in which registers alias. A number of researchers have cast register allocation as a mathematical-programming problem, rather than a graph-coloring problem [Goodwin and Wilken 1996; =-=Kong and Wilken 1998-=-; Appel and George 2001; Fu and Wilken 2002; Scholz and Eckstein 2002; Hirnschrott, Krall, and Scholz 2003]. These approaches can handle a wide variety of architectural irregularities, but these benef... |

24 |
A faster optimal register allocator
- Fu, Wilken
- 2002
(Show Context)
Citation Context ... number of researchers have cast register allocation as a mathematical-programming problem, rather than a graph-coloring problem [Goodwin and Wilken 1996; Kong and Wilken 1998; Appel and George 2001; =-=Fu and Wilken 2002-=-; Scholz and Eckstein 2002; Hirnschrott, Krall, and Scholz 2003]. These approaches can handle a wide variety of architectural irregularities, but these benefits come at the cost of significant increas... |

20 | Coloring register pairs - Briggs, Cooper, et al. - 1992 |

17 | Graph coloring register allocation for processors with multi-register operands - NICKERSON - 1990 |

10 | Graph coloring vs. optimal register allocation for optimizing compilers - Hirnschrott, Krall, et al. - 2003 |

6 | Preference-Directed Graph Coloring - Koseki, Komatsu, et al. |

5 | Retargetable Graph-Coloring Register Allocation for Irregular Architectures - Runeson, Nystrom - 2003 |

3 | Design and implementation of the graph coloring register allocator for GCC - Matz |

1 | A new MLRISC register allocator. Standard ML of New Jersey compiler implementation notes - Leung, George - 1998 |