skip to main content
research-article
Open access

Register allocation for software pipelined multidimensional loops

Published: 01 August 2008 Publication History

Abstract

This article investigates register allocation for software pipelined multidimensional loops where the execution of successive iterations from an n-dimensional loop is overlapped. For single loop software pipelining, the lifetimes of a loop variable in successive iterations of the loop form a repetitive pattern. An effective register allocation method is to represent the pattern as a vector of lifetimes (or a vector lifetime using Rau's terminology [Rau 1992]) and map it to rotating registers. Unfortunately, the software pipelined schedule of a multidimensional loop is considerably more complex and so are the vector lifetimes in it.
In this article, we develop a way to normalize and represent the vector lifetimes, which captures their complexity, while exposing their regularity that enables a simple solution. The problem is formulated as bin-packing of the multidimensional vector lifetimes on the surface of a space-time cylinder. A metric, called distance, is calculated either conservatively or aggressively to guide the bin-packing process, so that there is no overlapping between any two vector lifetimes, and the register requirement is minimized. This approach subsumes the classical register allocation for software pipelined single loops as a special case. The method has been implemented in the ORC compiler and produced code for the IA-64 architecture. Experimental results show the effectiveness. Several strategies for register allocation are compared and analyzed.

References

[1]
Aiken, A., Nicolau, A., and Novack, S. 1995. Resource-constrained software pipelining. IEEE Trans. Parall. Distrib. Syst. 6, 12, 1248--1270.]]
[2]
Allan, V. H., Jones, R. B., Lee, R. M., and Allan, S. J. 1995. Software pipelining. ACM Comput. Surv. 27, 3, 367--432.]]
[3]
Allen, J. R., Kennedy, K., Porterfield, C., and Warren, J. 1983. Conversion of control dependence to data dependence. In Proceedings of the 10th Annual ACM Symposium on Principles of Programming Languages. 177--189.]]
[4]
Auslander, M. and Hopkins, M. 2004. An overview of the pl.8 compiler. SIGPLAN Notices 39, 4, 38--48.]]
[5]
Callahan, D. and Koblenz, B. 1991. Register allocation via hierarchical graph coloring. In Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation (PLDI'91). ACM Press, 192--203.]]
[6]
Carr, S., Ding, C., and Sweany, P. 1996. Improving software pipelining with unroll-and-jam. In Proceedings of the 29th Hawaii International Conference on System Sciences (HICSS'96), Software Technology and Architecture, vol. 1. IEEE Computer Society, 183.]]
[7]
Chaitin, G. 2004. Register allocation and spilling via graph coloring. SIGPLAN Notices 39, 4, 66--74.]]
[8]
Cheng, W.-K. and Lin, Y.-L. 1999. Code generation of nested loops for dsp processors with heterogeneous registers and structural pipelining. ACM Trans. Des. Autom. Electro. Syst. 4, 3, 231--256.]]
[9]
Cytron, R., Ferrante, J., Rosen, B. K., Wegman, M. N., and Zadeck, F. K. 1991. Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13, 4, 451--490.]]
[10]
Darte, A. and Robert, Y. 1994. Constructive methods for scheduling uniform loop nests. IEEE Trans. Parall. Distrib. Syst. 5, 8, 814--822.]]
[11]
Dehnert, J. C. and Towle, R. A. 1993. Compiling for the cydra 5. J. Supercomput. 7, 1-2, 181--227.]]
[12]
Douillet, A. and Gao, G. R. 2005. Register pressure in software-pipelined loop nests: Fast computation and impact on architecture design. In The 18th International Workshop on Languages and Compilers for Parallel Computing (LCPC'05). Hawthorne, NY, 17--31.]]
[13]
Douillet, A. and Gao, G. R. 2007. Software-pipelining on multi-core architectures. In Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007). IEEE Computer Society, 39--48.]]
[14]
Ebcioglu, K. and Nakatani, T. 1990. A new compilation technique for parallelizing loops with unpredictable branches on a vliw architecture. In Selected Papers of the Second Workshop on Languages and Compilers for Parallel Computing. Pitman Publishing, London, UK, 213--229.]]
[15]
Gao, G. R., Ning, Q., and Dongen, V. V. 1993. Software pipelining for nested loops. ACAPS Tech Memo 53, School of Computer Science, McGill Univ., Montréal, Québec.]]
[16]
Hendren, L. J., Gao, G. R., Altman, E. R., and Mukerji, C. 1992. A register allocation framework based on hierarchical cyclic interval graphs. In Proceedings of the 4th International Conference on Compiler Construction (CC '92). Springer-Verlag, 176--191.]]
[17]
Huff, R. A. 1993. Lifetime-sensitive modulo scheduling. In Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation (PLDI'93). Albuquerque, 258--267.]]
[18]
Intel. 2001. Intel IA-64 Architecture Software Developer's Manual. Vol. 1: IA-64 Application Architecture. Intel Corporation, Santa Clara, CA.]]
[19]
Lam, M. 1988. Software pipelining: An effective scheduling technique for VLIW machines. In Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation (PLDI'88). 318--328.]]
[20]
Lamport, L. 1974. The parallel execution of DO loops. Comm. ACM 17, 2, 83--93.]]
[21]
Lawler, E. L., Lenstra, J. K., Khan, A. H. G. R., and Shmoys, D. B. 1985. The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization. John Wiley & Sons.]]
[22]
Moon, S.-M. and Ebcioğlu, K. 1997. Parallelizing nonnumerical code with selective scheduling and software pipelining. ACM Trans. Program. Lang. Syst. 19, 6, 853--898.]]
[23]
Muthukumar, K. and Doshi, G. 2001. Software pipelining of nested loops. Lecture Notes in Computer Science, Vol. 2027, 165--181.]]
[24]
Ramanujam, J. 1994. Optimal software pipelining of nested loops. In Proceedings of the 8th International Parallel Processing Symposium. IEEE, 335--342.]]
[25]
Rau, B. R. 1994. Iterative modulo scheduling: An algorithm for software pipelining loops. In Proceedings of the 27th Annual International Symposium on Microarchitecture. San Jose, CA, 63--74.]]
[26]
Rau, B. R. and Fisher, J. A. 1993. Instruction-level parallel processing: History, overview and perspective. J. Supercomput. 7, 9--50.]]
[27]
Rau, B. R., Lee, M., Tirumalai, P. P., and Schlansker, M. S. 1992. Register allocation for modulo scheduled loops: Strategies, algorithms and heuristics. HP Labs Tech. rep. HPL-92-48, Hewlett-Packard Laboratories, Palo Alto, CA.]]
[28]
Rong, H., Douillet, A., Govindarajan, R., and Gao, G. R. 2004. Code generation for single-dimension software pipelining of multi-dimensional loops. In Proceedings of the International Symposium on Code Generation and Optimization (CGO'04). IEEE Computer Society, 175--186.]]
[29]
Rong, H. and Govindarajan, R. 2007. Advances in software piplining. In The Compiler Design Handbook: Optimization and Machine Code Generation, 2nd Ed. Y. N. Srikant and P. Shankar, Eds. CRC, Chapter 20.]]
[30]
Rong, H., Tang, Z., Govindarajan, R., Douillet, A., and Gao, G. R. 2007a. Single-dimension software pipelining for multi-dimensional loops. CAPSL Technical Memo, Department of Electrical and Computer Engineering, University of Delaware, Newark, DE. In ftp://ftp.capsl.udel.edu/pub/doc/memos/memo049.ps.gz.]]
[31]
Rong, H., Tang, Z., Govindarajan, R., Douillet, A., and Gao, G. R. 2007b. Single-dimension software pipelining for multidimensional loops. ACM Trans. Architec. Code Optim. 4, 1, 7.]]
[32]
Turkington, K., Masselos, K., Constantinides, G. A., and Leong, P. 2006. FPGA based acceleration of the linpack benchmark: A high level code transformation approach. In Proceedings of the International Conference on Field Programmable Logic and Applications (FPL). Madrid, Spain. IEEE, 1--6.]]
[33]
Wang, J. and Gao, G. R. 1996. Pipelining-dovetailing: A transformation to enhance software pipelining for nested loops. In Proceedings of the 6th International Conference on Compiler Construction (CC '96). Springer-Verlag, London, UK, 1--17.]]

Cited By

View all
  • (2014)BibliographyAdvanced Backend Code Optimization10.1002/9781118625446.biblio(327-343)Online publication date: 3-Jun-2014
  • (2012)Minimal Unroll Factor for Code Generation of Software PipeliningInternational Journal of Parallel Programming10.1007/s10766-012-0203-z41:1(1-58)Online publication date: 17-Jul-2012

Index Terms

  1. Register allocation for software pipelined multidimensional loops

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Programming Languages and Systems
    ACM Transactions on Programming Languages and Systems  Volume 30, Issue 4
    July 2008
    358 pages
    ISSN:0164-0925
    EISSN:1558-4593
    DOI:10.1145/1377492
    Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 August 2008
    Accepted: 01 August 2007
    Revised: 01 May 2007
    Received: 01 September 2006
    Published in TOPLAS Volume 30, Issue 4

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Software pipelining
    2. register allocation

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)73
    • Downloads (Last 6 weeks)10
    Reflects downloads up to 02 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2014)BibliographyAdvanced Backend Code Optimization10.1002/9781118625446.biblio(327-343)Online publication date: 3-Jun-2014
    • (2012)Minimal Unroll Factor for Code Generation of Software PipeliningInternational Journal of Parallel Programming10.1007/s10766-012-0203-z41:1(1-58)Online publication date: 17-Jul-2012

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Full Access

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media