Interprocedural Dataflow Analysis via Graph Reachability

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 confluence 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 variables. In addition, the class of problems that our techniques handle includes many non-separable problems, including trulylive 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 interproceduralanalysis problems: interprocedural flow-sensitive side-effect problems (as studied by Callahan) and interprocedural program slicing (as studied by Horwitz, Reps, and Binkley).

[1]  Lawrence T. Kou,et al.  On Live-Dead Analysis for Global Data Flow Problems , 1977, JACM.

[2]  Mark A. Linton,et al.  Implementing relational views of programs , 1984, SDE 1.

[3]  Thomas W. Reps,et al.  Solving Demand Versions of Interprocedural Analysis Problems , 1994, CC.

[4]  Linda Torczon,et al.  Interprocedural constant propagation: a study of jump function implementation , 1993, PLDI '93.

[5]  Susan Horwitz,et al.  Generating editing environments based on relations and attributes , 1986, TOPL.

[6]  Daniel M. Yellin Speeding up dynamic transitive closure for bounded degree graphs , 2005, Acta Informatica.

[7]  Ken Kennedy,et al.  Fast interprocedual alias analysis , 1989, POPL '89.

[8]  Mark N. Wegman,et al.  A Fast and Usually Linear Algorithm for Global Flow Analysis , 1976, J. ACM.

[9]  J. Cocke Global common subexpression elimination , 1970, Symposium on Compiler Optimization.

[10]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[11]  V. Rich Personal communication , 1989, Nature.

[12]  Catriel Beeri,et al.  On the power of magic , 1987, J. Log. Program..

[13]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[14]  Jean Rohmer,et al.  The Alexander Method — A technique for the processing of recursive axioms in deductive databases , 1986, New Generation Computing.

[15]  Barbara G. Ryder,et al.  Pointer-induced aliasing: a problem classification , 1991, POPL '91.

[16]  Mehdi Jazayeri,et al.  The method of attributes for data flow analysis , 2004, Acta Informatica.

[17]  David Callahan,et al.  The program summary graph and flow-sensitive interprocedual data flow analysis , 1988, PLDI '88.

[18]  F. Kenneth Zadeck,et al.  Incremental data flow analysis in a structured program editor , 1984, SIGPLAN '84.

[19]  Robert Giegerich,et al.  Invariance of Approximate Semantics with Respect to Program Transformations , 1981, GI Jahrestagung.

[20]  Robert Paige,et al.  Program Derivation by Fixed Point Computation , 1989, Sci. Comput. Program..

[21]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

[22]  Ken Kennedy,et al.  Interprocedural constant propagation , 1986, SIGP.

[23]  Larry Melvin Masinter,et al.  Global program analysis in an interactive environment , 1979 .

[24]  Ken Kennedy,et al.  Interprocedural side-effect analysis in linear time , 1988, PLDI '88.

[25]  David W. Binkley,et al.  Interprocedural slicing using dependence graphs , 1990, TOPL.

[26]  Bernhard Steffen,et al.  The Interprocedural Coincidence Theorem , 1992, CC.

[27]  Raghu Ramakrishnan,et al.  Review - Magic Sets and Other Strange Ways to Implement Logic Programs , 1999, ACM SIGMOD Digit. Rev..