skip to main content
10.1145/143095.143143acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free access

Rematerialization

Published: 01 July 1992 Publication History

Abstract

This paper examines a problem that arises during global register allocation – rematerialization. If a value cannot be kept in a register, the allocator should recognize when it is cheaper to recompute the value (rematerialize it) than to store and reload it. Chaitin's original graph-coloring allocator handled simple instance of this problem correctly. This paper details a general solution to the problem and presents experimental evidence that shows its importance.
Our approach is to tag individual values in the procedure's SSA graph with information specifying how it should be spilled. We use a variant of Wegman and Zadeck's sparse simple constant algorithm to propagate tags throughout the graph. The allocator then splits live ranges into values with different tags. This isolates those values that can be easily rematerialized from values that require general spilling. We modify the base allocator to use this information when estimating spill costs and introducing spill code.
Our presentation focuses on rematerialization in the context of Chaitin's allocator; however, the problem arises in any global allocator. We believe that our approach will work in other allocators–while the details of implementation will vary, the key insights should carry over directly.

References

[1]
David Bernstein, Dins Q. Goldin, Martin C. Golumbic, Hugo Krawczyk, Yishay Mansour, Itai Nahshon, and Ron Y. Pinter. Spill code minimization techniques for optimizing compilers. SIG- PLAN Notices, 24(7):258-263, July 1989. Proceedings of the A CM SIGPLAN '89 Conference on Programming Language Design and Implementation.
[2]
Preston Briggs. Register Allocation via Graph Coloring. PhD thesis, Rice University, April 1992.
[3]
Preston Briggs, Keith D. Cooper, Ken Kennedy, and Linda Torczon. Coloring heuristics for register allocation. $IGPLAN Notices, 24(7):275-284, July 1989. Proceedings of the A CM SIGPLAN '89 Conference on Programming Language Design and Implementation.
[4]
David Callahan and Brian Koblenz. Register allocation via hierarchical graph coloring. $IGPLAN Notices, 26(6):192-203, June 1991. Proceedings of the A CM $IGPLAN '91 Conference on Programming Language Design and Implementation.
[5]
Gregory J. Chaitin. Register allocation and spilling via graph coloring. $IGPLAN Notices, 17(6):98- 105, June 1982. Proceedings of the A CM $IGPLAN '82 Symposium on Compiler Construction.
[6]
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 1981.
[7]
Jong-Deok Choi, Ron Cytron, and Jeanne Ferrante. Automatic construction of sparse data flow evaluation graphs. In Conference Record of lhe Eighteenth Annual A CM Symposium on Principles of Programming Languages, pages 55-66, January 1991.
[8]
Fred C. Chow and john L. Hennessy. The priority-based coloring approach to register allocation. A CM Transactions on Programming Languages and Systems, 12(4):501-536, October 1990.
[9]
Keith D. Cooper, Ken Kennedy, and Linda Torczon. The impact of interprocedural analysis and optimization on the IRn programming environment. A CM Transactions on Programming Languages and Systems, 8(4):491-523, October 1986.
[10]
Ron Cytron and Jeanne Ferrante. What's in a name? The value of renaming for parallelism detection and storage allocation. In Proceedings of the 1987 International Conference on Parallel Processing, pages 19-27, August 1987.
[11]
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. A CM Trans. actions on Programming Languages and Systems, 13(4):451-490, October 1991.
[12]
Janet Fabri. Automatic storage optimization. SIG- PLAN Notices, 14(8):83-91, August 1979. Proceedings of the A CM $IGPLAN '79 Symposium on Compiler Construction.
[13]
George E. Forsythe, Michael A. Malcolm, and Cleve B. Moler. Computer Methods for Mathematical Computations. Prentice-Hall, Englewood Cliffs, New Jersey, 1977.
[14]
Christopher W. Fraser and David R. Hanson. A retargetable compiler for ANSI C. $IGPLAN Notices, 26(10):29-43, October 1991.
[15]
Christopher W. Fraser and David R. Hanson. Simple register spilling in a retargetable compiler. Software - Practice and Experience, 22(1):85-99, January 1992.
[16]
Rajiv Gupta, Mary Lou Sofia, and Tim Steele. Register allocation via clique separators. $IG- PLAN Notices, 24(7):264-274, July 1989. Proceedings of the A CM $IGPLAN '89 Conference on Programming Language Design and Implementation.
[17]
James R. Lotus and Paul N. Hilfinger. Register allocation in the SPUR Lisp compiler. $IGPLAN Notices, 21(7):255-263, July 1986. Proceedings of the A CM SIGPLAN '86 Symposium on Compiler Construction.
[18]
S. S. Lavrov. Store economy in closed operator schemes. Zhurnal Vychislitel'noi Matematiki i Matematicheskoi Fiziki, 1(4):687-701, 1961. English translation in U.S.S.R. Computational Mathematics and Mathematical Physics 3, 1962.
[19]
Ravi Sethi. Complete register allocation problems. SIAM journal on Computing, 4(3):226-248, 1975.
[20]
SPEC release 1.2, September 1990. Standards Performance Evaluation Corporation.
[21]
Mark N. Wegman and F. Kenneth Zadeck. Constant propagation with conditional branches. A CM Transactions on Programming Languages and Systems, 13(2):181-210, April 1991.

Cited By

View all
  • (2024)UNIFICO: Thread Migration in Heterogeneous-ISA CPUs without State TransformationProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641565(86-99)Online publication date: 17-Feb-2024
  • (2023)Architecture-Aware CurryingProceedings of the 32nd International Conference on Parallel Architectures and Compilation Techniques10.1109/PACT58117.2023.00029(250-264)Online publication date: 21-Oct-2023
  • (2023)Data Recomputation for Multithreaded Applications2023 IEEE/ACM International Conference on Computer Aided Design (ICCAD)10.1109/ICCAD57390.2023.10323776(01-09)Online publication date: 28-Oct-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '92: Proceedings of the ACM SIGPLAN 1992 conference on Programming language design and implementation
July 1992
352 pages
ISBN:0897914759
DOI:10.1145/143095
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 1992

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

PLDI92
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)307
  • Downloads (Last 6 weeks)39
Reflects downloads up to 16 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)UNIFICO: Thread Migration in Heterogeneous-ISA CPUs without State TransformationProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641565(86-99)Online publication date: 17-Feb-2024
  • (2023)Architecture-Aware CurryingProceedings of the 32nd International Conference on Parallel Architectures and Compilation Techniques10.1109/PACT58117.2023.00029(250-264)Online publication date: 21-Oct-2023
  • (2023)Data Recomputation for Multithreaded Applications2023 IEEE/ACM International Conference on Computer Aided Design (ICCAD)10.1109/ICCAD57390.2023.10323776(01-09)Online publication date: 28-Oct-2023
  • (2019)Efficient rematerialization for deep networksProceedings of the 33rd International Conference on Neural Information Processing Systems10.5555/3454287.3455646(15172-15181)Online publication date: 8-Dec-2019
  • (2019)Combinatorial Register Allocation and Instruction SchedulingACM Transactions on Programming Languages and Systems10.1145/333237341:3(1-53)Online publication date: 2-Jul-2019
  • (2018)Register optimizations for stencils on GPUsACM SIGPLAN Notices10.1145/3200691.317850053:1(168-182)Online publication date: 10-Feb-2018
  • (2018)Register optimizations for stencils on GPUsProceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming10.1145/3178487.3178500(168-182)Online publication date: 10-Feb-2018
  • (2018)Research of Register Pressure Aware Loop Unrolling Optimizations for CompilerMATEC Web of Conferences10.1051/matecconf/201822803008228(03008)Online publication date: 14-Nov-2018
  • (2016)Register allocation and spilling using the expected distance heuristicSoftware—Practice & Experience10.1002/spe.239346:11(1499-1523)Online publication date: 1-Nov-2016
  • (2015)Minimization of Instructions to Access Memory by Color Flipping in the Interference GraphProceedings of the annual conference on Brazilian Symposium on Information Systems: Information Systems: A Computer Socio-Technical Perspective - Volume 110.5555/2814058.2814136(483-486)Online publication date: 26-May-2015
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media