Book contents
- Frontmatter
- Contents
- Preface
- Part I Fundamentals of Compilation
- Part II Advanced Topics
- 13 Garbage Collection
- 14 Object-Oriented Languages
- 15 Functional Programming Languages
- 16 Polymorphic Types
- 17 Dataflow Analysis
- 18 Loop Optimizations
- 19 Static Single-Assignment Form
- 20 Pipelining and Scheduling
- 21 The Memory Hierarchy
- Appendix: Tiger Language Reference Manual
- Bibliography
- Index
19 - Static Single-Assignment Form
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Part I Fundamentals of Compilation
- Part II Advanced Topics
- 13 Garbage Collection
- 14 Object-Oriented Languages
- 15 Functional Programming Languages
- 16 Polymorphic Types
- 17 Dataflow Analysis
- 18 Loop Optimizations
- 19 Static Single-Assignment Form
- 20 Pipelining and Scheduling
- 21 The Memory Hierarchy
- Appendix: Tiger Language Reference Manual
- Bibliography
- Index
Summary
dom-i-nate: to exert the supreme determining or guiding influence on
Webster's DictionaryMany dataflow analyses need to find the use-sites of each defined variable or the definition-sites of each variable used in an expression. The def-use chain is a data structure that makes this efficient: for each statement in the flow graph, the compiler can keep a list of pointers to all the use sites of variables defined there, and a list of pointers to all definition sites of the variables used there. In this way the compiler can hop quickly from use to definition to use to definition.
An improvement on the idea of def-use chains is static single-assignment form, or SSA form, an intermediate representation in which each variable has only one definition in the program text. The one (static) definition-site may be in a loop that is executed many (dynamic) times, thus the name static singleassignment form instead of single-assignment form (in which variables are never redefined at all).
The SSA form is useful for several reasons:
Dataflow analysis and optimization algorithms can be made simpler when each variable has only one definition.
If a variable has N uses and M definitions (which occupy about N + M instructions in a program), it takes space (and time) proportional to N · M to represent def-use chains – a quadratic blowup (see Exercise 19.8). For almost all realistic programs, the size of the SSA form is linear in the size of the original program (but see Exercise 19.9).
[…]
- Type
- Chapter
- Information
- Modern Compiler Implementation in C , pp. 433 - 473Publisher: Cambridge University PressPrint publication year: 1997