Linear-time subtransitive control flow analysis

We present a linear-time algorithm for bounded-type programs that builds a directed graph whose transitive closure gives exactly the results of the standard (cubic-time) Control-Flow Analysis (CFA) algorithm. Our algorithm can be used to list all functions calls from all call sites in (optimal) quadratic time. More importantly, it can be used to give linear-time algorithms for CFA-consuming applications such as:• effects analysis: find the side-effecting expressions in a program.• k-limited CFA: for each call-site, list the functions if there are only a few of them (≤ k) and otherwise output "many".• called-once analysis: identify all functions called from only one call-site.

[1]  Alfred V. Aho,et al.  Time and Tape Complexity of Pushdown Automaton Languages , 1968, Inf. Control..

[2]  Neil D. Jones,et al.  Flow Analysis of Lambda Expressions (Preliminary Version) , 1981, ICALP.

[3]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[4]  Radford M. Neal The Computational Complexity of Taxonomic Inference a Taxonomic Inference System , 1989 .

[5]  Robin Milner,et al.  Definition of standard ML , 1990 .

[6]  Anders Bondorf,et al.  Efficient Analysis for Realistic Off-Line Partial Evaluation , 1993, J. Funct. Program..

[7]  Fritz Henglein,et al.  Type inference with polymorphic recursion , 1993, TOPL.

[8]  Nevin Heintze,et al.  Set-based analysis of ML programs , 1994, LFP '94.

[9]  Jens Palsberg,et al.  A type system equivalent to flow analysis , 1995, TOPL.

[10]  Jens Palsberg,et al.  Safety Analysis versus Type Inference , 1992, Inf. Comput..

[11]  Nevin Heintze Control-Flow Analysis and Type Systems , 1995, SAS.

[12]  David A. McAllester,et al.  Inferring Recursive Data Types , 1996 .

[13]  David Melski Interconvertibility of Set Constraints and Context-free Language Reachability 1 , 1996 .

[14]  David A. McAllester,et al.  On the cubic bottleneck in subtyping and flow analysis , 1997, Proceedings of Twelfth Annual IEEE Symposium on Logic in Computer Science.

[15]  Saumya K. Debray,et al.  Interprocedural control flow analysis of first-order programs with tail-call optimization , 1997, TOPL.