Context-dependent flow-sensitive interprocedural dataflow analysis

Interprocedural dataflow analysis is useful in compiler optimization, automatic vectorization and parallelization, dataflow anomaly detection, and software maintenance applications such as program revalidation, and software tools that make a program more understandable by showing data dependencies. These applications require the solution of dataflow problems such as reaching definitions, live variables, available expressions, and definition-use chains. When solving these problems interprocedurally, the context of each call must be taken into account. In this paper, a method to solve this kind of dataflow problem is presented. This method consists of special dataflow equations that are solved for a program flowgraph. In deference to calling context, separate sets, called entry and body sets, are maintained at each node in the flowgraph. The entry set contains calling-context effects that enter a procedure. The body set contains effects that result from statements in the procedure. By isolating calling-context effects in the entry set, a call's nonkilled calling context is preserved by means of a simple intersection operation done at the return node for that call. The main advantages of this method are its precision and low complexity, and the fact that the presence of recursion does not affect the accuracy of the result.