2880_c000.pdf
Data Flow Analysis: Theory and Practice
Preface
Contents
Appendix A: An Introduction to GCC
References
2880_c001.pdf
Table of Contents
Chapter 1: An Introduction to Data Flow Analysis
1.1 A Motivating Example
1.1.1 Optimizing for Heap Memory
1.1.2 Computing Liveness
Modelling Interprocedural Effects
Simple Intraprocedural Liveness Analysis
Intraprocedural Analysis with Interprocedural Approximation
Interprocedural Analysis
A Comparison of Liveness Computed by Three Methods
1.1.3 Computing Aliases
1.1.4 Performing Optimization
1.1.5 General Observations
1.2 Program Analysis: The Larger Perspective
Applications of Analysis
Approaches to Program Analysis
Time of Performing Analysis
Scope of Analysis
Flow Sensitivity of Analysis
Context Sensitivity of Analysis
Granularity of Performing Analysis
Program Representations Used for Analysis
Representations of Information
1.3 Characteristics of Data Flow Analysis
1.4 Summary and Concluding Remarks
1.5 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c002.pdf
Table of Contents
Part I: Intraprocedural Data Flow Analysis
Chapter 2: Classical Bit Vector Data Flow Analysis
2.1 Basic Concepts and Notations
2.2 Discovering Local Data Flow Information
2.3 Discovering Global Properties of Variables
2.3.1 Live Variables Analysis
2.3.2 Dead Variables Analysis
2.3.3 Reaching Definitions Analysis
2.3.4 Reaching Definitions for Copy Propagation
2.4 Discovering Global Properties of Expressions
2.4.1 Available Expressions Analysis
2.4.2 Partially Available Expressions Analysis
2.4.3 Anticipable Expressions Analysis
2.4.4 Classical Partial Redundancy Elimination
Hoisting Path of an Expression
Transformation Using Hoisting Path
Limitations of Partial Redundancy Elimination
Handling Critical Edges
Handling Critical Nodes
2.4.5 Lazy Code Motion
2.5 Combined May-Must Analyses
2.6 Summary and Concluding Remarks
2.7 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c003.pdf
Table of Contents
Chapter 3: Theoretical Abstractions in Data Flow Analysis
3.1 Graph Properties Relevant to Data Flow Analysis
3.2 Data Flow Framework
3.2.1 Modeling Data Flow Values Using Lattices
Partially Ordered Sets
Lattices and Complete Lattices
Meet Semilattices
3.2.2 Modeling Flow Functions
3.2.3 Data Flow Frameworks
3.3 Data Flow Assignments
3.3.1 Meet Over Paths Assignment
3.3.2 Fixed Point Assignment
3.3.3 Existence of Fixed Point Assignment
3.4 Computing Data Flow Assignments
3.4.1 Computing MFP Assignment
3.4.2 Comparing MFP and MOP Assignments
3.4.3 Undecidability of MOP Assignment Computation
3.5 Complexity of Data Flow Analysis for Rapid Frameworks
3.5.1 Properties of Data Flow Frameworks
3.5.2 Complexity for General CFGs
3.5.3 Complexity in Special Cases
3.6 Summary and Concluding Remarks
3.7 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c004.pdf
Table of Contents
Chapter 4: General Data Flow Frameworks
4.1 Non-Separable Flow Functions
4.2 Discovering Properties of Variables
4.2.1 Faint Variables Analysis
4.2.2 Possibly Uninitialized Variables Analysis
4.2.3 Constant Propagation
Classical Constant Propagation Using Def-Use Chains
Data Flow Analysis for Constant Propagation
Properties of Constant Propagation Data Flow Framework
4.2.4 Variants of Constant Propagation
Conditional Constant Propagation
Copy Constant Propagation
Linear Constant Propagation
4.3 Discovering Properties of Pointers
4.3.1 Points-To Analysis of Stack and Static Data
Points-To Analysis with Degree of Certainty
4.3.2 Alias Analysis of Stack and Static Data
A Comparison of Points-to and Alias Relations
4.3.3 Formulating Data Flow Equations for Alias Analysis
4.4 Liveness Analysis of Heap Data
4.4.1 Access Expressions and Access Paths
4.4.2 Liveness of Access Paths
4.4.3 Representing Sets of Access Paths by Access Graphs
Summarization
Operations on Access Graphs
Safety of Access Graph Operations
4.4.4 Data Flow Analysis for Explicit Liveness
Convergence of Explicit Liveness Analysis
Efficiency of Explicit Liveness Analysis
4.4.5 The Motivating Example Revisited
Intraprocedural Analysis by Ignoring the Interprocedural Effects
Intraprocedural Analysis with Conservative Interprocedural Approximation
4.5 Modeling Entity Dependence
4.5.1 Primitive Entity Functions
4.5.2 Composite Entity Functions
4.6 Summary and Concluding Remarks
4.7 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c005.pdf
Table of Contents
Chapter 5: Complexity of Iterative Data Flow Analysis
5.1 Generic Flow Functions and Data Flow Equations
5.2 Generic Round-Robin Iterative Algorithm
5.3 Complexity of Round-Robin Iterative Algorithm
5.3.1 Identifying the Core Work Using Work List
5.3.2 Information Flow Paths in Bit Vector Frameworks
Information Flow Paths and the Work List Algorithm
5.3.3 Defining Complexity Using Information Flow Paths
5.3.4 Information Flow Paths in Fast Frameworks
5.3.5 Information Flow Paths in Non-separable Frameworks
5.4 Summary and Concluding Remarks
5.5 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c006.pdf
Table of Contents
Chapter 6: Single Static Assignment Form as Intermediate Representation
6.1 Introduction
6.1.1 An Overview of SSA
6.1.2 Benefits of SSA Representation
6.2 Construction of SSA Form Programs
6.2.1 Dominance Frontier
6.2.2 Placement of phi-instructions
6.2.3 Renaming of Variables
6.2.4 Correctness of the Algorithm
6.3 Destruction of SSA
6.3.1 An Algorithm for SSA Destruction
6.3.2 SSA Destruction and Register Allocation
Overview
Spilling
The Spilling Algorithm
Coloring
Coalescing by Recoloring
SSA coalescing
Register Copies
6.4 Summary and Concluding Remarks
6.5 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c007.pdf
Table of Contents
Part II: Interprocedural Data Flow Analysis
Chapter 7: Introduction to Interprocedural Data Flow Analysis
7.1 A Motivating Example
7.2 Program Representations for Interprocedural Analysis
7.3 Modeling Interprocedural Data Flow Analysis
7.3.1 Summary Flow Functions
7.3.2 Inherited and Synthesized Data Flow Information
7.3.3 Approaches to Interprocedural Data Flow Analysis
7.4 Compromising Precision for Scalability
7.4.1 Flow and Context Insensitivity
Flow insensitivity
Context insensitivity
7.4.2 Side Effects Analysis
7.5 Language Features Influencing Interprocedural Analysis
7.6 Common Variants of Interprocedural Data Flow Analysis
7.6.1 Intraprocedural Analysis with Conservative Interprocedural Approximation
7.6.2 Intraprocedural Analysis with Side Effects Computation
Flow insensitive side effects
Flow sensitive side effects
7.6.3 Whole Program Analysis
Context insensitive whole program analysis
Context sensitive whole program analysis
7.7 An Aside on Interprocedural Optimizations
7.8 Summary and Concluding Remarks
7.9 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c008.pdf
Table of Contents
Chapter 8: Functional Approach to Interprocedural Data Flow Analysis
8.1 Side Effects Analysis of Procedure Calls
8.1.1 Computing Flow Sensitive Side Effects
8.1.2 Computing Flow Insensitive Side Effects
8.2 Handling the Effects of Parameters
8.2.1 Defining Aliasing of Parameters
8.2.2 Formulating Alias Analysis of Parameters
8.2.3 Augmenting Data Flow Analyses Using Parameter Aliases
8.2.4 Efficient Parameter Alias Analysis
8.3 Whole Program Analysis
8.3.1 Lattice of Flow Functions
8.3.2 Reducing Function Compositions and Confluences
Function compositions and confluences for bit vector frameworks
Function compositions and confluences for general frameworks
8.3.3 Constructing Summary Flow Functions
8.3.4 Computing Data Flow Information
8.3.5 Enumerating Summary Flow Functions
8.4 Summary and Concluding Remarks
8.5 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c009.pdf
Table of Contents
Chapter 9: Value-Based Approach to Interprocedural Data Flow Analysis
9.1 Program Model for Value-Based Approaches to Interprocedural Data Flow Analysis
9.2 Interprocedural Analysis Using Restricted Contexts
9.3 Interprocedural Analysis Using Unrestricted Contexts
9.3.1 Using Call Strings to Represent Unrestricted Contexts
9.3.2 Issues in Termination of Call String Construction
9.4 Bounding Unrestricted Contexts Using Data Flow Values
9.4.1 Call String Invariants
An aside on flow function with periodic points
9.4.2 Value-Based Termination of Call String Construction
9.5 The Motivating Example Revisited
9.6 Summary and Concluding Remarks
9.7 Bibliographic Notes
Appendix A: An Introduction to GCC
References
2880_c010.pdf
Table of Contents
Part III: Implementing Data Flow Analysis
Chapter 10: Implementing Data Flow Analysis in GCC
10.1 Specifying a Data Flow Analysis
10.1.1 Registering a Pass With the Pass Manager in GCC
10.1.2 Specifying Available Expressions Analysis
10.1.3 Specifying Other Bit Vector Data Flow Analyses
10.2 An Example of Data Flow Analysis
10.2.1 Executing the Data Flow Analyzer
10.2.2 Examining the Gimple Version of CFG
10.2.3 Examining the Result of Data Flow Analysis
10.3 Implementing the Generic Data Flow Analyzer gdfa
10.3.1 Specification Primitives
10.3.2 Interface with GCC
Traversal Over CFG and Basic Blocks
Discovering the Entities in a Statement
Constructing and Manipulating Data Flow Values
Facilities for Printing Entities
10.3.3 The Preparatory Pass
10.3.4 Local Data Flow Analysis
10.3.5 Global Data Flow Analysis
10.4 Extending the Generic Data Flow Analyzer gdfa
Appendix A: An Introduction to GCC
References
2880_a001.pdf
Table of Contents
Appendix A: An Introduction to GCC
A.1 About GCC
A.2 Building GCC
Configuring GCC
Compiling GCC
Installing GCC
Downloading and Installing gdfa
A.3 Further Readings in GCC
References
2880_references.pdf
Table of Contents
References
Appendix A: An Introduction to GCC