Demand-driven pointer analysis
Authors:
Open Access
- 1 May 2001
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 36 (5) , 24-34
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.Keywords
This publication has 11 references indexed in Scilit:
- Ultra-fast aliasing analysis using CLA2001
- Off-line variable substitution for scaling points-to analysis2000
- Unification-based pointer analysis with directional assignments2000
- Projection merging2000
- Partial online cycle elimination in inclusion constraint graphs1998
- Points-to analysis in almost linear time1996
- Context-insensitive alias analysis reconsidered1995
- Demand-driven computation of interprocedural data flow1995
- Interprocedural may-alias analysis for pointers1994
- Context-sensitive interprocedural points-to analysis in the presence of function pointers1994