|
ABSTRACT
We show that register allocation can be viewed as solving a collection of puzzles. We model the register file as a puzzle board and the program variables as puzzle pieces; pre-coloring and register aliasing fit in naturally. For architectures such as PowerPC, x86, and StrongARM, we can solve the puzzles in polynomial time, and we have augmented the puzzle solver with a simple heuristic for spilling. For SPEC CPU2000, the compilation time of our implementation is as fast as that of the extended version of linear scan used by LLVM, which is the JIT compiler in the openGL stack of Mac OS 10.5. Our implementation produces x86 code that is of similar quality to the code produced by the slower, state-of-the-art iterated register coalescing of George and Appel with the extensions proposed by Smith, Ramsey, and Holloway in 2004.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Scott Ananian. The static single information form. Master's thesis, MIT, September 1999.
|
 |
2
|
|
| |
3
|
L. Belady. A study of the replacement of algorithms of a virtual storage computer. IBM System Journal, 5:78--101, 1966.
|
| |
4
|
|
 |
5
|
Rastislav Bodík , Rajiv Gupta , Vivek Sarkar, ABCD: eliminating array bounds checks on demand, Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation, p.321-333, June 18-21, 2000, Vancouver, British Columbia, Canada
|
| |
6
|
Florent Bouchez. Allocation de registres et vidage en mémoire. Master's thesis, ENS Lyon, 2005.
|
| |
7
|
Florent Bouchez, Alain Darte, Christophe Guillon, and Fabrice Rastello. Register allocation: What does the NP-completeness proof of chaitin et al. really prove? Or revisiting register allocation: Why and how. In LCPC, pages 283--298. Springer, 2006.
|
| |
8
|
|
| |
9
|
Philip Brisk, Foad Dabiri, Jamie Macbeth, and Majid Sarrafzadeh. Polynomial-time graph coloring register allocation. In IWLS, pages 447--454. 2005.
|
 |
10
|
|
 |
11
|
Zoran Budimlic , Keith D. Cooper , Timothy J. Harvey , Ken Kennedy , Timothy S. Oberg , Steven W. Reeves, Fast copy coalescing and live-range identification, Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, June 17-19, 2002, Berlin, Germany
|
| |
12
|
Gregory J. Chaitin, Mark A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, 1981.
|
 |
13
|
|
| |
14
|
Alkis Evlogimenos. Improvements to linear scan register allocation. Technical report, University of Illinois, Urbana-Champaign, 2004.
|
| |
15
|
|
| |
16
|
Fanica Gavril. The intersection graphs of subtrees of a tree are exactly the chordal graphs. Journal of Combinatorial Theory, Series B, 16(1):47 -- 56, 1974.
|
 |
17
|
|
| |
18
|
Martin Charles Golumbic. Trivially perfect graphs. Discrete Mathematics, 24:105 -- 107, 1978.
|
| |
19
|
Daniel Grund and Sebastian Hack. A fast cutting-plane algorithm for optimal coalescing. In CC, volume 4420, pages 111--115. Springer, 2007.
|
| |
20
|
Sebastian Hack, Daniel Grund, and Gerhard Goos. Register allocation for programs in SSA-form. In CC, pages 247--262. Springer, 2006.
|
| |
21
|
Lang Hames and Bernhard Scholz. Nearly optimal register allocation with PBQP. In JMLC, pages 346--361. Springer, 2006.
|
| |
22
|
Corporate SPARC International Inc. The SPARC Architecture Manual, Version 8. Prentice Hall, 1st edition, 1992.
|
 |
23
|
|
| |
24
|
Richard M Karp. Reducibility among combinatorial problems. In Complexity of Computer Computations, pages 85--103. Plenum, 1972.
|
 |
25
|
|
| |
26
|
|
| |
27
|
Jonathan K. Lee, Jens Palsberg, and Fernando M. Q. Pereira. Aliased register allocation for straight-line programs is NP-complete. In ICALP, pages 680--691. Springer, 2007.
|
| |
28
|
|
| |
29
|
|
| |
30
|
Fernando Magno Quintao Pereira and Jens Palsberg. Register allocation via coloring of chordal graphs. In APLAS, pages 315--329. Springer, 2005.
|
| |
31
|
Fernando Magno Quintao Pereira and Jens Palsberg. Register allocation after classic SSA elimination is NP-complete. In FOSSACS, pages 79--93. Springer, 2006.
|
| |
32
|
Fernando Magno Quintao Pereira and Jens Palsberg. Register allocation by puzzle solving, 2008. http://compilers.cs.ucla.edu/ fernando/projects/puzzles/.
|
 |
33
|
|
| |
34
|
Vivek Sarkar and Rajkishore Barik. Extended linear scan: an alternate foundation for global register allocation. In CC, pages 141--155. Springer, 2007.
|
 |
35
|
|
 |
36
|
|
| |
37
|
|
 |
38
|
Omri Traub , Glenn Holloway , Michael D. Smith, Quality and speed in linear-scan register allocation, Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation, p.142-151, June 17-19, 1998, Montreal, Quebec, Canada
|
| |
39
|
|
 |
40
|
|
| |
41
|
|
|