An Experimental Evaluation of the Sufficiency of Scalar Replacement Algorithms

Scalar replacement is a transformation that replaces references to arrays with sequences of scalar temporaries to effect register allocation of array values. Scalar replacement algori thms with varying degrees of power have been proposed [1, 2, 3]. However, no study has been done to show what degree of power is necessary in practice. Are simple algorithms enough? Moreover, with the emergence of aggressive scheduling techniques like software pipelining, sensitivity to high register demands may cause scalar replacement to degrade performance rather than help it [4, 5, 6, 7]. How much scalar replacement is too much? Finally, each algorithm may be applied using any number of dependence tests. More powerful tests should yield larger subsets of references that can be scalar replaced. Is this true? This paper addresses these three questions. Our experiments show that nearly all opportunities for scalar replacement that exist in scientific benchmark code can be handled by simple algorithms. Additionally, the increased register demands of software pipelining make aggressive scalar replacement a detrimental transformation for many loops. Finally, powerful dependence analysis is not needed. Our results show that scalar replacement is an effective transformation that can be cheap to implement.

[1]  Ken Kennedy,et al.  Software prefetching , 1991, ASPLOS IV.

[2]  Ken Kennedy,et al.  Improving register allocation for subscripted variables , 1990, SIGP.

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

[4]  Ken Kennedy,et al.  Practical dependence testing , 1991, PLDI '91.

[5]  Ken Kennedy,et al.  Estimating Interlock and Improving Balance for Pipelined Architectures , 1988, J. Parallel Distributed Comput..

[6]  David L. Kuck,et al.  The Structure of Computers and Computations , 1978 .

[7]  Steven Mark Carr,et al.  Memory-hierarchy management , 1993 .

[8]  Ken Kennedy,et al.  Automatic translation of FORTRAN programs to vector form , 1987, TOPL.

[9]  Zhiyuan Li,et al.  Data dependence analysis on multi-dimensional array references , 1989, ICS '89.

[10]  William Pugh,et al.  Eliminating false data dependences using the Omega test , 1992, PLDI '92.

[11]  Manfred P. Stadel,et al.  A solution to a problem with Morel and Renvoise's “Global optimization by suppression of partial redundancies” , 1988, TOPL.

[12]  Leslie Lamport,et al.  The parallel execution of DO loops , 1974, CACM.

[13]  Rajiv Gupta,et al.  A practical data flow framework for array reference analysis and its use in optimizations , 1993, PLDI '93.

[14]  Rajiv Gupta,et al.  Array Data Flow Analysis for Load-Store Optimizations in Superscalar Architectures , 1995, LCPC.

[15]  Scott A. Mahlke,et al.  Reverse If-Conversion , 1993, PLDI '93.

[16]  Etienne Morel,et al.  Global optimization by suppression of partial redundancies , 1979, CACM.

[17]  Ken Kennedy,et al.  Parascope:a Parallel Programming Environment , 1988 .

[18]  Josep Llosa,et al.  Heuristics for register-constrained software pipelining , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[19]  Monica S. Lam,et al.  RETROSPECTIVE : Software Pipelining : An Effective Scheduling Technique for VLIW Machines , 1998 .

[20]  Michael A. Malcolm,et al.  Computer methods for mathematical computations , 1977 .

[21]  Krishna Subramanian,et al.  Enhanced modulo scheduling for loops with conditional branches , 1992, MICRO 1992.

[22]  Grant E. Haab,et al.  Enhanced Modulo Scheduling For Loops With Conditional Branches , 1992, [1992] Proceedings the 25th Annual International Symposium on Microarchitecture MICRO 25.

[23]  Jens Palsberg,et al.  Register Allocation via Coloring of Chordal Graphs , 2005, APLAS.

[24]  Vicki H. Allan,et al.  Software pipelining , 1995, CSUR.

[25]  Richard A. Huff,et al.  Lifetime-sensitive modulo scheduling , 1993, PLDI '93.

[26]  Utpal Banerjee,et al.  Dependence analysis for supercomputing , 1988, The Kluwer international series in engineering and computer science.

[27]  Ken Kennedy,et al.  Scalar replacement in the presence of conditional control flow , 1994, Softw. Pract. Exp..