## Fast copy coalescing and live-range identification (2002)

### Cached

### Download Links

- [www.cs.rice.edu]
- [www.cs.rice.edu]
- [www.cs.rice.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | In Proceedings of the ACM Sigplan Conference on Programming Language Design and Implementation (PLDI’02 |

Citations: | 28 - 1 self |

### BibTeX

@INPROCEEDINGS{Budimlić02fastcopy,

author = {Zoran Budimlić and Keith D. Cooper and Timothy J. Harvey and Ken Kennedy and Timothy S. Oberg and Steven W. Reeves},

title = {Fast copy coalescing and live-range identification},

booktitle = {In Proceedings of the ACM Sigplan Conference on Programming Language Design and Implementation (PLDI’02},

year = {2002},

pages = {25--32},

publisher = {ACM Press}

}

### Years of Citing Articles

### OpenURL

### Abstract

This paper presents a fast new algorithm for modeling and reasoning about interferences for variables in a program without constructing an interference graph. It then describes how to use this information to minimize copy insertion for φ-node instantiation during the conversion of the static single assignment (SSA) form into the control-flow graph (CFG), effectively yielding a new, very fast copy coalescing and live-range identification algorithm. This paper proves some properties of the SSA form that enable construction of data structures to compute interference information for variables that are considered for folding. The asymptotic complexity of our SSA-to-CFG conversion algorithm is O(nα(n)), where n is the number of instructions in the program. Performing copy folding during the SSA-to-CFG conversion eliminates the need for a separate coalescing phase while simplifying the intermediate code. This may make graph-coloring register allocation more practical in just in time (JIT) and other time-critical compilers For example, Sun’s Hotspot Server Compiler already employs a graph-coloring register allocator[10]. This paper also presents an improvement to the classical interference-graph based coalescing optimization that shows a decrease in memory usage of up to three orders of magnitude and a decrease of a factor of two in compilation time, while providing the exact same results. We present experimental results that demonstrate that our algorithm is almost as precise (within one percent on average) as the improved interference-graph-based coalescing algorithm, while requiring three times less compilation time.

### Citations

8597 |
Algorithms
- Cormen, Leiserson, et al.
- 1990
(Show Context)
Citation Context ...e of the join set. It starts with a depth-first traversal of the dominator tree, which is linear in size of the dominator tree, but it is done only once for the whole SSA. It then uses the radix sort =-=[7]-=- to sort the variables in the set, which is linear as well since the number of variables in the join set cannot be greater than the number of basic blocks in the CFG. Each of the variables in the set ... |

848 | Efficiently computing static single assignment form and the control dependence graph
- Cytron, Ferrante, et al.
- 1991
(Show Context)
Citation Context ... we want to remove and all of the other members of the set. At the end, all SSA names that are in the same set do not interfere, and, therefore, can share the same name. Note that we build pruned SSA =-=[8]-=- to make the reasoning simpler and because parts of the analysis necessary for pruned SSA, such as liveness analysis, are assumed. The algorithm we present should work for minimal or semi-pruned SSA a... |

422 |
Register allocation and spilling via graph coloring
- Chaitin
- 2004
(Show Context)
Citation Context ...es is much higher than the number of copies in theoriginal code. Classically, to solve this problem one would coalesce SSA namesinto a single name using an interference graph, as described by Chaitin =-=[5, 4]-=-. The interference graph models names as nodes, andedges between the nodes represent an interference -- there is at least one point in the code where the two name are simultaneouslylive. The intuition... |

193 |
Register allocation via coloring
- Chaitin, Auslander, et al.
- 1981
(Show Context)
Citation Context ... is much higher than the number of copies in the original code. Classically, to solve this problem one would coalesce SSA names into a single name using an interference graph, as described by Chaitin =-=[5, 4]-=-. The interference graph models names as nodes, and edges between the nodes represent an interference — there is at least one point in the code where the two name are simultaneously live. The intuitio... |

136 | Register allocation via graph coloring
- Briggs
- 1992
(Show Context)
Citation Context ... φ-node actually takes place along the incoming edge to bphi, and this edge is dominated by bv. 2 do not interfere. Indeed, this is precisely the algorithm used by a Chaitin/Briggs register allocator =-=[5, 4, 1]-=- to identify live ranges. The allocator joins all φ-node names into a single set and then builds the aforementioned interference graph. It then coalesces live ranges joined at a copy but that do not o... |

109 |
Computer Methods for Mathematical Computations
- Forsythe, Malcolm, et al.
- 1977
(Show Context)
Citation Context ...h, that is significantly faster than the original, but equally precise. The test suite we used in our experiments is made up of 169 routines that come from Forsythe, et al.’s book on numerical methods=-=[9]-=-, as well as the Spec and Spec ’95 libraries. We ran these codes on a minimally loaded 300 MHz Sparc Ultra 10 with 256 megabytes of memory. Due to space constraints, we only report on the ten largest ... |

61 | Practical improvements to the construction and destruction of static single assignment form
- Briggs, Cooper, et al.
- 1998
(Show Context)
Citation Context ...LDI’02, June 17-19, 2002, Berlin, Germany Copyright 2002 ACM 1-58113-463-0/02/0006 ...$5.00. 1 1. INTRODUCTION It has long been known that copies can be folded during the construction of the SSA form =-=[2]-=-. Essentially, each variable that is defined by a copy is replaced in subsequent operations by the source of that copy. The implementation of this strategy has a couple of subtle problems but is other... |

41 |
Register allocation via coloring”, Computer Languages 6
- Chaitin, Auslander, et al.
- 1981
(Show Context)
Citation Context ...es is much higher than the number of copies in theoriginal code. Classically, to solve this problem one would coalesce SSA namesinto a single name using an interference graph, as described by Chaitin =-=[5, 4]-=-. The interference graph models names as nodes, andedges between the nodes represent an interference -- there is at least one point in the code where the two name are simultaneouslylive. The intuition... |

7 |
Endre Tarjan. Testing flow graph reducibility
- Robert
- 1974
(Show Context)
Citation Context ... maximum preorder number of the descendants for eachnode. This number allows the algorithm to identify the antecedentdescendent information from the dominator tree in constant timeand is due to Tarjan=-=[11]-=-. This preorder-numbering process is done only once for the whole SSA.The algorithm iterates over the variables in order of increasing preorder number, or pn. Within the loop, a variable named Current... |

7 | How to build an interference graph
- Cooper, Harvey, et al.
- 1998
(Show Context)
Citation Context ...y interfere, the copy is necessary and cannot be coalesced. Unfortunately, this conceptually simple method requires a data structure that is quadratic in the number of names. As Cooper, et al. showed =-=[6]-=-, the cost of building an interference graph is significant, and for JIT compilers or other systems where compile time is crucial, this cost may be prohibitive. This paper presents a new algorithm tha... |

6 | Compiling Java for High Performance and the Internet
- Budimlić
- 2001
(Show Context)
Citation Context ...ction presents a brief description of the SSA properties that we use to construct our algorithm. A full formal description, along with the proofs of all the lemmas and theorems is presented elsewhere =-=[3]-=-. The preliminary step in our algorithm is to ensure that the code is in regular form, which we shall define with the following construction. We start with a standard CFG, (N,E,b0), made up of a set o... |

1 |
Register Allocation via Graph Coloring.PhD thesis
- Briggs
- 1992
(Show Context)
Citation Context ...he OE-node actually takes place along the incoming edge to bphi, and this edge is dominatedby b v. do not interfere. Indeed, this is precisely the algorithm used by aChaitin/Briggs register allocator =-=[5, 4, 1]-=- to identify live ranges. The allocator joins all OE-node names into a single set and thenbuilds the aforementioned interference graph. It then coalesces live ranges joined at a copy but that do not o... |

1 |
Practical improvements to the construction and destruction of static single assignmentform. Software - Practice and Experience
- Simpson
- 1998
(Show Context)
Citation Context ...e. PLDI'02, June 17-19, 2002, Berlin, GermanyCopyright 2002 ACM 1-58113-463-0/02/0006 ...$5.00. 1. INTRODUCTION It has long been known that copies can be folded during theconstruction of the SSA form =-=[2]-=-. Essentially, each variable that is defined by a copy is replaced in subsequent operations by thesource of that copy. The implementation of this strategy has a couple of subtle problems but is otherw... |

1 |
Torczon.How to build an interference graph. Software - Practice and Experience
- Cooper, Harvey, et al.
- 1998
(Show Context)
Citation Context ...opy interfere, the copy is necessary and cannot be coalesced.Unfortunately, this conceptually simple method requires a data structure that is quadratic in the number of names. As Cooper, etal. showed =-=[6]-=-, the cost of building an interference graph is significant, and for JIT compilers or other systems where compile time iscrucial, this cost may be prohibitive. This paper presents a new algorithm that... |