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 where-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 adecrease 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.
- Preston Briggs. Register Allocation via Graph Coloring. PhD thesis, Rice University, April 1992 Google Scholar
Digital Library
- Preston Briggs, Keith D. Cooper, Timothy J. Harvey, and L. Taylor Simpson. Practical improvements to the construction and destruction of static single assignment form. Software -- Practice and Experience, 28(8):859--881, July 1998 Google Scholar
Digital Library
- Zoran Budimli. Compiling Java for High Performance and the Internet. PhD thesis, Rice University, January 2001 Google Scholar
Digital Library
- Gregory J. Chaitin. Register allocation and spilling via graph coloring. SIGPLAN Notices, 17(6):98--105, June 1982. Proceedings of the ACM SIGPLAN '82 Symposium on Compiler Construction Google Scholar
Digital Library
- Gregory J. Chaitin, Marc A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Computer Languages, 6:47--57, January 1981Google Scholar
Digital Library
- Keith D. Cooper, Timothy J. Harvey, and Linda Torczon. How to build an interference graph. Software -- Practice and Experience, 28(4):425--444, April 1998 Google Scholar
Digital Library
- Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. M.I.T. Press, Cambridge, Massachusetts, U.S.A., 1990 Google Scholar
Digital Library
- Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark N. Wegman, and F. Kenneth Zadeck. Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, October 1991 Google Scholar
Digital Library
- George E. Forsythe, Michael A. Malcolm, and Cleve B. Moler. Computer Methods for Mathematical Computations. Prentice-Hall, Englewood Cliffs, New Jersey, 1977 Google Scholar
Digital Library
- The Java Hotspot Virtual Machine, Technical White Paper, April 2001Google Scholar
- Robert Endre Tarjan. Testing flow graph reducibility. Journal of Computer and System Sciences, 9:355--365, 1974Google Scholar
Digital Library
Index Terms
Fast copy coalescing and live-range identification
Recommendations
Fast copy coalescing and live-range identification
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 ...
Optimistic register coalescing
Graph-coloring register allocators eliminate copies by coalescing the source and target nodes of a copy if they do not interfere in the interference graph. Coalescing, however, can be harmful to the colorability of the graph because it tends to yield a ...
Register coalescing techniques for heterogeneous register architecture with copy sifting
Optimistic coalescing has been proven as an elegant and effective technique that provides better chances of safely coloring more registers in register allocation than other coalescing techniques. Its algorithm originally assumes homogeneous registers, ...







Comments