Evaluation of algorithms for local register allocation

Vincenzo Liberatore, Martin Farach-Colton, Ulrich Kremer

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

    Abstract

    Local register allocation (LRA) assigns pseudo-registers to actual registers in a basic block so as to minimize the spill cost. In this paper, four different LRA algorithms are compared with respect to the quality of their generated allocations and the execution times of the algorithms themselves. The evaluation is based on a framework that views register allocation as the combination of boundary conditions, LRA, and register assignment. Our study does not address the problem of instruction scheduling in conjunction with register allocation, and we assume that the spill cost depends only on the number and type of load and store operations, but not on their positions within the instruction stream. The paper discusses the first optimum algorithm based on integer linear programming as one of the LRA algorithms. The optimal algorithm also serves as the base line for the quality assessment of generated allocations. In addition, two known heuristics, namely Furthest-First (FF) and Clean-First (CF), and a new heuristic(M IX) are discussed and evaluated. The evaluation is based on thirteen Fortran programs from the fmm, Spec, and Spec95X benchmark suites. An advanced compiler infrastructure (ILOC) was used to generated aggressively optimized, intermediate pseudo-register code for each benchmark program. Each local register allocation method was implemented, and evaluated by simulating the execution of the generated code on a machine with N registers and an instruction set where loads and stores are C times as expensive as any other instruction. Experiments were performed for different values of N and C. The results show that only for large basic blocks the allocation quality gap between the different algorithms is significant. When basic blocks are large, the difference was up to 23%. Overall, the new heuristic (MIX) performed best as compared to the other heuristics, producing allocations within 1% of optimum. All heuristics had running times comparable to live variable analysis, or lower, i.e., were very reasonable. More work will be needed to evaluate the LRA algorithms in the context of more sophisticated global register allocators and source level transformations that potentially increase basic block sizes, including loop unrolling, inlining, and speculative execution (superblocks).

    Original languageEnglish (US)
    Title of host publicationCompiler Construction - 8th International Conference, CC 1999 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 1999, Proceedings
    EditorsStefan Jahnichen
    PublisherSpringer Verlag
    Pages137-153
    Number of pages17
    ISBN (Print)3540657177, 9783540657170
    DOIs
    StatePublished - 1999
    Event8th International Conference on Compiler Construction, CC 1999 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 1999 - Amsterdam, Netherlands
    Duration: Mar 22 1999Mar 28 1999

    Publication series

    NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
    Volume1575
    ISSN (Print)0302-9743
    ISSN (Electronic)1611-3349

    Conference

    Conference8th International Conference on Compiler Construction, CC 1999 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 1999
    Country/TerritoryNetherlands
    CityAmsterdam
    Period3/22/993/28/99

    ASJC Scopus subject areas

    • Theoretical Computer Science
    • General Computer Science

    Fingerprint

    Dive into the research topics of 'Evaluation of algorithms for local register allocation'. Together they form a unique fingerprint.

    Cite this