## Combining Analyses, Combining Optimizations (1995)

### Cached

### Download Links

- [www.brics.dk]
- [www.cs.rice.edu]
- [www.daimi.aau.dk]
- [www.brics.dk]
- [www.cs.berkeley.edu]
- [www.eecs.harvard.edu]
- CiteULike
- DBLP

### Other Repositories/Bibliography

Citations: | 78 - 4 self |

### BibTeX

@MISC{Click95combininganalyses,,

author = {Clifford Noel Click and Jr.},

title = {Combining Analyses, Combining Optimizations},

year = {1995}

}

### Years of Citing Articles

### OpenURL

### Abstract

This thesis presents a framework for describing optimizations. It shows how to combine two such frameworks and how to reason about the properties of the resulting framework. The structure of the framework provides insight into when a combination yields better results. Also presented is a simple iterative algorithm for solving these frameworks. A framework is shown that combines Constant Propagation, Unreachable Code Elimination, Global Congruence Finding and Global Value Numbering. For these optimizations, the iterative algorithm runs in O(n^2) time. This thesis then presents an O(n log n) algorithm for combining the same optimizations. This technique also finds many of the common subexpressions found by Partial Redundancy Elimination. However, it requires a global code motion pass to make the optimized code correct, also presented. The global code motion algorithm removes some Partially Dead Code as a side-effect. An implementation demonstrates that the algorithm has shorter compile times than repeated passes of the separate optimizations while producing run-time speedups of 4%–7%. While global analyses are stronger, peephole analyses can be unexpectedly powerful. This thesis demonstrates parse-time peephole optimizations that find more than 95% of the constants and common subexpressions found by the best combined analysis. Finding constants and common subexpressions while parsing reduces peak intermediate representation size. This speeds up the later global analyses, reducing total compilation time by 10%. In conjunction with global code motion, these peephole optimizations generate excellent code very quickly, a useful feature for compilers that stress compilation speed over code quality.

### Citations

881 | The program dependence graph and its use in optimization
- Ferrante, Ottenstein, et al.
- 1987
(Show Context)
Citation Context ...tational liberty by defining the mapping from only OP to F. We correct this in our implementation by using an operator-level (instead of basic-block level) Program Dependence Graph (PDG) in SSA form. =-=[4, 7]-=- Such a representation does not have a CFG or any basic blocks. Control information is encoded as inputs to functions like any other program variable. 2spaths (MOP) solution like that described by Kam... |

697 | Systematic Design of Program Analysis Frameworks
- Cousot, Cousot
- 1979
(Show Context)
Citation Context ...lly linear or nearly linear in the size of the original code. 2.2 Monotone Analysis Frameworks In order to combine several optimizations we first describe them in a common monotone analysis framework =-=[2, 6, 8]. Briefly,-=- a monotone analysis framework is: • A set of inferences we make about the program, described as a complete lattice L = {A, ⊤, ⊥, ⊓} with height d,where: – A is an arbitrary set of inference... |

668 | A Mathematical Introduction to Logic - Enderton - 1972 |

613 |
A Lattice-theoretical Fix-point Theorem and its Applications
- Tarski
- 1955
(Show Context)
Citation Context ...e equations over the approximation functions. (In effect, analysis “runs” an approximate version of the program.) By design, the equations have a minimal solution called the Greatest Fixed Point (=-=gfp)[2,9]-=-. 3 Functions in F represent complete programs via composition. Monotonicity gives us some special properties: the composition of monotonic functions is also monotonic. Also the composition is a funct... |

444 | Register allocation & spilling via graph coloring - Chaitin - 1982 |

402 | Analysis of pointers and structures - Chase, Wegman, et al. - 1990 |

330 | Constant propagation with conditional branches
- Wegman, Zadeck
- 1991
(Show Context)
Citation Context ...opportunities for optimization. Thishasbeenshowninanad hoc way in previous work — for example Wegman and Zadeck presented an algorithm to combine constant propagation and unreachable code eliminatio=-=n [10]-=-. This paper provides a more formal basis for describing combinations and shows when and why these combinations yield better results. We present a proof that the simple iterative technique efficiently... |

330 | A unified approach to global program optimization - Kildall - 1973 |

309 | An nlogn algorithm for minimizing states in a finite automaton - Hopcroft - 1971 |

293 |
Flow Analysis of Computer Programs
- Hecht
- 1977
(Show Context)
Citation Context ...nt technique based on evaluating the single variable formulation (fi rather than � f). To provide efficient solutions, we solve these equations �y = � f(�x) with a simple worklist iterative te=-=chnique [5]. -=-The sparseness of the equations makes the algorithm efficient. 1. Initialize all equation variables xi to ⊤. 2. Place all equations on a worklist w. 3. While w is not do empty do: (a) Remove an equa... |

281 | Efficiency of a good but not linear set union algorithm - Tarjan - 1975 |

231 |
Detecting equality of variables in programs
- Alpern, Wegman, et al.
- 1988
(Show Context)
Citation Context ...iciently solves these combined optimizations. Finally, we combine Conditional Constant Propagation (CCP) and Global Value Numbering (GVN) to get an optimization that is more than the sum of its parts =-=[10, 1]-=-. 2 Overview 2.1 Intermediate Representations Before we describe our algorithms, we need to describe our programs. A program is represented by a ControlFlowGraph(CFG), where the edges denote flow of c... |

223 |
An Efficient Method for Computing Static Single Assignment Form
- Cytron, Ferrante, et al.
- 1989
(Show Context)
Citation Context ... the algorithm over a low-level compiler intermediate representation, with k ≤ 3. We call the set of op functions OP. We assume the program has been converted into Static Single Assignment (SSA) for=-=m [3]-=-. In the original program, names are assigned values at multiple definition points. In the SSA form, each name corresponds to a single definition point. By convention, we generate the new names of SSA... |

187 | Global optimization by suppression of partial redundancies - Morel, Renvoise |

182 | Global Value Numbers and Redundant Computations - Rosen, Wegman, et al. - 1988 |

163 | A fast algorithm for finding dominators in a flowgraph - Lengauer, Tarjan - 1979 |

159 | Monotone data flow analysis frameworks
- Kam, Ullman
- 1977
(Show Context)
Citation Context ...lly linear or nearly linear in the size of the original code. 2.2 Monotone Analysis Frameworks In order to combine several optimizations we first describe them in a common monotone analysis framework =-=[2, 6, 8]. Briefly,-=- a monotone analysis framework is: • A set of inferences we make about the program, described as a complete lattice L = {A, ⊤, ⊥, ⊓} with height d,where: – A is an arbitrary set of inference... |

147 | Register allocation via graph coloring - Briggs - 1992 |

142 | The program dependence web: a representation supporting control-,data-, and demand-driven interpretation of imperative languages - Ballance, Maccabe, et al. |

129 | Global data flow analysis and iterative algorithms - Kam, Ullman - 1976 |

95 | Beyond induction variables - Wolfe |

94 | Partial dead code elimination - Knoop, Ruthing, et al. - 1994 |

86 | Effective partial redundancy elimination - Briggs, Cooper - 1994 |

83 | Testing flow graph reducibility - TARJAN - 1972 |

73 |
A uni approach to path problems
- Tarjan
(Show Context)
Citation Context ...lly linear or nearly linear in the size of the original code. 2.2 Monotone Analysis Frameworks In order to combine several optimizations we first describe them in a common monotone analysis framework =-=[2, 6, 8]. Briefly,-=- a monotone analysis framework is: • A set of inferences we make about the program, described as a complete lattice L = {A, ⊤, ⊥, ⊓} with height d,where: – A is an arbitrary set of inference... |

72 | Code selection through object code optimization - Davidson, Fraser - 1984 |

67 | Global Common Subexpression Elimination - Cocke - 1970 |

64 | The semantics of program dependence - Cartwright, Felleisen - 1989 |

59 | A survey of data flow analysis techniques - Kennedy - 1981 |

54 | Fast allocation and deallocation of memory based on object lifetimes - Hanson - 1990 |

48 | Programming languages and their compilers - Cocke, Schwartz - 1970 |

48 | Interprocedural Symbolic Analysis - Havlak - 1994 |

46 | Dependence flow graphs: An algebraic approach to program dependencies
- Pingali, Beck, et al.
- 1991
(Show Context)
Citation Context ...tational liberty by defining the mapping from only OP to F. We correct this in our implementation by using an operator-level (instead of basic-block level) Program Dependence Graph (PDG) in SSA form. =-=[4, 7]-=- Such a representation does not have a CFG or any basic blocks. Control information is encoded as inputs to functions like any other program variable. 2spaths (MOP) solution like that described by Kam... |

41 | The history of Fortran - Backus - 1981 |

37 | A solution to a problem with Morel and Renvoise's "global optimization by suppression of partial redundancies - Drechsler, Stadel - 1988 |

32 | Value dependence graphs: Representation without taxation - Weise, Crew, et al. - 1994 |

31 | A simple rewriting semantics for realistic imperative programs and its application to program analysis - Field - 1992 |

26 | Using peephole optimization on intermediate code - Tanenbaum, Staveren, et al. - 1982 |

18 | Integrating Code Generation and Optimization - Fraser, Wendt - 1986 |

16 | Automatic generation of fast optimizing code generators - Fraser, Wendt - 1988 |

9 | Use-definition chains with applications - Kennedy - 1978 |

9 | An efficient algorithm for constructing a control flow graph for parallel code - Simons, Ferrante - 1993 |

5 | A Semantic Framework for Program Dependence - Selke - 1992 |

2 | Flow Analysts of Computer Programs - HECHT - 1977 |

2 | The Massively Scalar Compiler Project. Unpublished report. Preliminary version available via ftp://cs.rice.edu/public/preston/optimizer/shared.ps - Briggs - 1994 |

2 | Iloc '93 - Briggs, Harvey - 1993 |

2 | Computer Methods for Mathematical Computations - Forstyhe, Malcom, et al. - 1977 |

1 | Dependence flow graphfi; An algebraic approach to program dependencies - JOHNSON, MOUDGILL, et al. - 1990 |

1 | Implementation of a retargetable peephole analyser - Davidson, Fraser - 1980 |

1 | Global Value Numbering. Unpublished report. Available from ftp://cs.rice.edu/public/preston/optimizer/gval.ps - Simpson - 1994 |