Fast interprocedural class analysis

Greg DeFouw, David Grove, Craig Chambers
1998 Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '98  
Previous algorithms for interprocedural control flow analysis of higher-order and/or object-oriented languages have been described that perform propagation or constraint satisfaction and take O(N 3 ) time (such as Shivers's 0-CFA and Heintze's setbased analysis), or unification and take O(Nα(N,N)) time (such as Steensgaard's pointer analysis), or optimistic reachability analysis and take O(N) time (such as Bacon and Sweeney's Rapid Type Analysis). We describe a general parameterized analysis
more » ... mework that integrates propagation-based and unification-based analysis primitives and optimistic reachability analysis, whose instances mimic these existing algorithms as well as several new algorithms taking O(N), O(Nα(N,N)), O(N 2 ), and O(N 2 α(N,N)) time; our O(N) and O(Nα(N,N)) algorithms produce more precise results than the previous algorithms with these complexities. We implemented our algorithm framework in the Vortex optimizing compiler, and we measured the cost and benefit of these interprocedural analysis algorithms in practice on a collection of substantial Cecil and Java programs. * An abbreviated version of this technical report appeared in the proceedings of POPL '98 [DeFouw et al. 98]. call sites to callees. Instantiations of our framework include 0-CFA, Steensgaard-style analysis, and RTA, as well as interesting new algorithms with complexities of O(N 2 α(N,N)), O(N 2 ), O(Nα(N,N)) (which achieves better precision than Steensgaard-style analysis with the same worst-case cost), and O(N) (which achieves better precision than RTA with the same worst-case cost). Section 2 describes our general framework and defines and compares several algorithm instantiations. We have implemented our algorithm framework and several instantiations in the Vortex optimizing compiler [Dean et al. 96]. We analyzed several large Java [Gosling et al. 96] and Cecil [Chambers 93 ] programs using these instantiations. We measured both the abstract precision and cost of the different algorithms as well as the bottom-line execution speedup and executable space savings. We found that the hypothetical improvements in precision of the new algorithms over RTA and Steensgaard-style analysis did occur in practice; resulting in improvements in bottom-line application performance. Section 3 reports our experimental findings in detail. Section 4 identifies some areas of current and future work, section 5 discusses additional related work, and section 6 concludes. Analysis Framework This section describes the general interprocedural analysis algorithm that allows us to explore a range of fast interprocedural class analyses. The next subsection introduces the example language we use to illustrate our algorithm. Subsection 2.2 describes our dataflow graph representation, subsection 2.3 describes the parameterized analysis algorithm itself, and subsection 2.4 analyzes its complexity. Subsection 2.5 describes the analysis algorithms instantiable from our framework. Subsection 2.6 discusses extensions to make the analysis modular. Subsection 2.7 describes how clients can extract information from the analysis, and examines the complexity of extracting certain kinds of information. * We assume that the maximum number of actual parameters at a call site and the maximum number of formal parameters in a method declaration is a constant independent of program size.
doi:10.1145/268946.268965 dblp:conf/popl/DeFouwGC98 fatcat:kvznwfzz7nh2paq5j6c2osbjoe