Incremental data flow analysis via dominator and attribute update

We present an algorithm for updating data flow information derived from a program, in response to program edits. Our algorithm, applicable to intraprocedural or interprocedural data flow problems, is more general than previous methods because it can update any monotone data flow problem defined on a reducible flow graph and can handle arbitrary program edits. Rather than design yet another special-purpose data flow update algorithm, we show how to reduce the class of data flow problems to another class of problems which already has a fast update algorithm. More specifically, we reduce a monotone data flow problem formulated for solution using Graham-Wegman elimination [12] to the problem of constructing and decorating an attributed tree structurally isomorphic to the dominator tree of the program flow graph. To update this dominator tree in response to program changes, we first show how to express domination in terms of two local properties of nodes and edges in the flow graph — niceness and deepness. Domination is then updated in response to an edge addition or deletion by repeatedly performing two local operations on the dominator tree, each operation restoring the local properties violated by the edge change. Second, we extend Reps' attributed tree update techniques [19,21,20] and his complexity analysis, to update attribute values in response to changes in this structure.

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

[2]  Barbara G. Ryder Incremental data flow analysis , 1983, POPL '83.

[3]  Barbara G. Ryder,et al.  Elimination algorithms for data flow analysis , 1986, CSUR.

[4]  R. Hoover Incremental graph evaluation (attribute grammar) , 1987 .

[5]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[6]  Shimon Even,et al.  Updating distances in dynamic graphs , 1985 .

[7]  Thomas W. Reps Optimal-time incremental semantic analysis for syntax-directed editors , 1982, POPL '82.

[8]  Roger Hoover Incremental Graph Evaluation , 1987 .

[9]  Lori Pollock An approach to incremental compilation of optimized code , 1986 .

[10]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[11]  Robert E. Tarjan,et al.  A Unified Approach to Path Problems , 1981, JACM.

[12]  Ken Kennedy,et al.  Efficient computation of flow insensitive interprocedural summary information , 1984, SIGPLAN '84.

[13]  Barbara G. Ryder,et al.  A Critical Analysis of Incremental Iterative Data Flow Analysis Algorithms , 1990, IEEE Trans. Software Eng..

[14]  Robert E. Tarjan,et al.  Fast Algorithms for Solving Path Problems , 1981, JACM.

[15]  Thomas W. Reps,et al.  Remote attribute updating for language-based editors , 1986, POPL '86.

[16]  Thomas W. Reps,et al.  Incremental Context-Dependent Analysis for Language-Based Editors , 1983, TOPL.

[17]  Mary Lou Soffa,et al.  An Incremental Version of Iterative Data Flow Analysis , 1989, IEEE Trans. Software Eng..

[18]  Keith Daniel Cooper Interprocedural data flow analysis in a programming environment , 1983 .

[19]  Barbara G. Ryder,et al.  An incremental algorithm for software analysis , 1987, SDE 2.

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

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

[22]  Barry K. Rosen Monoids for rapid data flow analysis , 1978, POPL '78.

[23]  Vida Ghodssi Incremental analysis of programs , 1983 .