ABSTRACT
Known algorithms for pointer analysis are “global” in the sense that they perform an exhaustive analysis of a program or program component. In this paper we introduce a demand-driven approach for pointer analysis. Specifically, we describe a demand-driven flow-insensitive, subset-based, con text-insensitive points-to analysis. Given a list of pointer variables (a query), our analysis performs just enough computation to determine the points-to sets for these query variables. Using deductive reachability formulations of both the exhaustive and the demand-driven analyses, we prove that our algorithm is correct. We also show that our analysis is optimal in the sense that it does not do more work than necessary. We illustrate the feasibility and efficiency of our analysis with an implementation of demand-driven points-to analysis for computing the call-graphs of C programs with function pointers. The performance of our system varies substantially across benchmarks - the main factor is how much of the points-to graph must be computed to determine the call-graph. For some benchmarks, only a small part of the points-to graph is needed (e.g pouray emacs and gcc), and here we see more than a 10x speedup. For other benchmarks (e.g. burlap and gimp), we need to compute most (> 95%) of the points-to graph, and here the demand-driven algorithm is considerably slower, because using the demand-driven algorithm is a slow method of computing the full points-to graph.
- 1.A. Deutsch, "Interprocedural May-Alias Analysis for Pointers: Beyond-k limiting", PLDI 1994. Google ScholarDigital Library
- 2.M. Emami, R. Ghiya and L. Hendren, "Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers", PLDI 1994. Google ScholarDigital Library
- 3.M. Fahndrich, J. Foster, Z. Su and A. Aiken, "Partial Online Cycle Elimination in Inclusion Constraint Graphs", PLDI 1998. Google ScholarDigital Library
- 4.A. Rountev and S. Chandra, "Off-line Variable Substitution for Scaling Points-to Analysis", PLDI 2000. Google ScholarDigital Library
- 5.Z.Su, M. Fahndrich and A. Aiken, "Projection Merging: Reducing Redundancies in Inclusion Constraint Graphs", POPL 2000. Google ScholarDigital Library
- 6.L. Andersen, "Program Analysis and Specialization for the C Programming Language", PhD. thesis, DIKU, University of Copenhagen, May 1994, DIKU report 94/19.Google Scholar
- 7.B. Steensgaard, "Points-to Analysis in Almost Linear Time", POPL 1996. Google ScholarDigital Library
- 8.M. Shapiro and S. Horwitz, "Fast and Accurate Flow-Insensitive Points-To Analysis", POPL 1997. Google ScholarDigital Library
- 9.M. Das, "Unification-Based Pointer Analysis with Directional Assignments", PLDI 2000. Google ScholarDigital Library
- 10.E. Ruf, "Context-insensitive alias analysis reconsidered", PLDI 1995. Google ScholarDigital Library
- 11.J. Foster, M. Fahndrich and A. Aiken, "Polymorphic versus Monomorphic Flow-insensitive Points-to Analysis for C", SAS 2000. Google ScholarDigital Library
- 12.E. Duesterwald, R. Gupta and M. Soffa, "Demand-driven Computation of Interprocedural Data flow", POPL 1995. Google ScholarDigital Library
- 13.S. Chandra, N. Heintze, D. MacQueen, D. Oliva and M. Siff, "ckit: an extensible C frontend in ML", available as an SML/NJ library.Google Scholar
- 14."Programming Languages - C", ISO/IEC 9899:1990, Internation Standard, 1990.Google Scholar
- 15.N. Heintze, "Analysis of Large Code Bases: The Compile-Link-Analyze Model", unpublished report, November 1999.Google Scholar
- 16.N. Heintze, O. Tardieu, "Ultra-fast Pointer Analysis using CLA: A Million Lines of C Code in a Second", PLDI 2001 (this volume). Google ScholarDigital Library
Index Terms
- Demand-driven pointer analysis
Recommendations
Demand-driven pointer analysis
Known algorithms for pointer analysis are “global” in the sense that they perform an exhaustive analysis of a program or program component. In this paper we introduce a demand-driven approach for pointer analysis. Specifically, we describe a demand-...
Interprocedural pointer alias analysis
We present practical approximation methods for computing and representing interprocedural aliases for a program written in a language that includes pointers, reference parameters, and recursion. We present the following contributions: (1) a framework ...
Comments