Spill code minimization by spill code motion

We aim at minimizing the spill costs. Spill cost minimization heuristics that have been researched sometimes work in unexpected ways due to the lack of precise knowledge of registers availability, which can be obtained only after register allocation is all finished. Different from previous techniques, our approach, called spill code motion, tries to eliminate redundancy among spill code. This works as a variation of commonly used code motion techniques. After Chaitin-style graph coloring with naive live range splitting, spill-in instructions are first hoisted as long as registers are available and until they reach spill-out instructions. Unnecessarily hoisted spill-in instructions are then sunk. The experimental results show our approach yields up to a 10% performance increase compared to the latest spill code minimization technique in the case of using small number of registers.

[1]  Toshio Nakatani,et al.  Preference-directed graph coloring , 2002, PLDI '02.

[2]  David Callahan,et al.  Register allocation via hierarchical graph coloring , 1991, PLDI '91.

[3]  Dhananjay M. Dhamdhere A Usually Linear Algorithm for Register Assignment Using Edge Placement of Load and Store Instructions , 1990, Comput. Lang..

[4]  Ravi Sethi,et al.  Complete register allocation problems , 1973, SIAM J. Comput..

[5]  Rumi Zahir,et al.  OS and Compiler Considerations in the Design of the IA-64 Architecture , 2000, ASPLOS.

[6]  Steven R. Vegdahl,et al.  Using node merging to enhance graph coloring , 1999, PLDI '99.

[7]  Dhananjay M. Dhamdhere Register Assignment Using Code Placement Techniques , 1988, Comput. Lang..

[8]  Thomas R. Gross,et al.  Call-cost directed register allocation , 1997, PLDI '97.

[9]  Ken Kennedy,et al.  RETROSPECTIVE: Coloring Heuristics for Register Allocation , 2022 .

[10]  Mary Jean Harrold,et al.  Load/store range analysis for global register allocation , 1993, PLDI '93.

[11]  Rajiv Gupta,et al.  Complete removal of redundant expressions , 1998, PLDI 1998.

[12]  Matthew T. O'Keefe,et al.  Spill code minimization via interference region spilling , 1997, PLDI '97.

[13]  Thomas R. Gross,et al.  Global Register Allocation Based on Graph Fusion , 1996, LCPC.

[14]  Charles N. Fischer,et al.  Probabilistic register allocation , 1992, PLDI '92.

[15]  Thomas R. Gross,et al.  Fusion-based register allocation , 2000, TOPL.

[16]  Rajiv Gupta,et al.  Register Pressure Sensitive Redundancy Elimination , 1999, CC.

[17]  Gregory J. Chaitin,et al.  Register allocation and spilling via graph coloring , 2004, SIGP.

[18]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[19]  Toshiaki Yasue,et al.  Overview of the IBM Java Just-in-Time Compiler , 2000, IBM Syst. J..

[20]  John Cocke,et al.  A methodology for the real world , 1981 .

[21]  Roy Dz-Ching Ju,et al.  A new algorithm for scalar register promotion based on SSA form , 1998, PLDI '98.

[22]  PracticeJENS,et al.  Optimal Code Motion : Theory & , 1994 .

[23]  John Cocke,et al.  Register Allocation Via Coloring , 1981, Comput. Lang..

[24]  Toshiaki Yasue,et al.  Effectiveness of cross-platform optimizations for a java just-in-time compiler , 2003, OOPSLA '03.

[25]  Soo-Mook Moon,et al.  Optimistic register coalescing , 2004, TOPL.

[26]  Rajiv Gupta,et al.  Load-reuse analysis: design and evaluation , 1999, PLDI '99.

[27]  Charles N. Fischer,et al.  Zero-cost range splitting , 1994, PLDI '94.

[28]  Raymond Lo,et al.  Register promotion by sparse partial redundancy elimination of loads and stores , 1998, PLDI.

[29]  Bernhard Steffen,et al.  Optimal code motion: theory and practice , 1994, TOPL.

[30]  John L. Hennessy,et al.  The priority-based coloring approach to register allocation , 1990, TOPL.

[31]  Andrew W. Appel,et al.  Iterated register coalescing , 1996, POPL '96.

[32]  Keith D. Cooper,et al.  Register promotion in C programs , 1997, PLDI '97.

[33]  Keith D. Cooper,et al.  Live Range Splitting in a Graph Coloring Register Allocator , 1998, International Conference on Compiler Construction.

[34]  Ron Y. Pinter,et al.  Spill code minimization techniques for optimizing compliers , 1989, PLDI '89.