Precise interprocedural dataflow analysis with applications to constant propagation
Abstract
This paper shows how a large class of interprocedural dataflow-analysis problems can be solved precisely in polynomial time. The only restrictions are that the set of dataflow facts is a finite set, and that the dataflow functions distribute over the conflu-ence operator (either union or intersection). This class of problems includes—but is not limited to—the classical separable problems (also known as “gen/kill ” or “bit-vector ” problems)—e.g., reaching definitions, available expressions, and live vari-ables. In addition, the class of problems that our techniques handle includes many non-separable problems, including truly-live variables, copy constant propagation, and possibly-uninitialized variables. A novel aspect of our approach is that an interprocedural dataflow-analysis problem is transformed into a special kind of graph-reachability problem (reachability along interprocedurally realizable paths). The paper presents three polynomial-time algorithms for the realizable-path reachability problem: an exhaustive version, a second exhaustive version that may be more appropriate in the incremental and/or interactive context, and a demand version. The first and third of these algorithms are asymptotically faster than the best previously known realizable-path reachability algorithm. An additional benefit of our techniques is that they lead to improved algorithms for two other kinds of interprocedural-analysis problems: interprocedural flow-sensitive side-effect problems (as studied by Callahan) and interprocedural progra- text
- CR Categories and Subject Descriptors
- D.3.4 [Programming Languages
- Processors − compilers
- optimization
- E.1 [Data Structures] − graphs
- F.2.2 [Analysis of Algorithms and Problem Complexity
- Complexity of Algorithms
- Nonnumerical Algorithms and Problems − computations on discrete structures
- G.2.2 [Discrete Mathematics
- Graph Theory − graph algo- rithms General Terms
- Algorithms
- Theory Additional Key Words and Phrases
- demand dataflow analysis
- distributive dataflow framework
- flow-sensitive side-effect analysis
- function representation
- graph reachability
- interprocedural dataflow analysis
- interprocedural program slicing
- inter- procedurally realizable path
- interprocedurally valid path
- meet-over-all-valid-paths solution