skip to main content
10.1145/378795.378802acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Demand-driven pointer analysis

Published:01 May 2001Publication History

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.

References

  1. 1.A. Deutsch, "Interprocedural May-Alias Analysis for Pointers: Beyond-k limiting", PLDI 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.M. Emami, R. Ghiya and L. Hendren, "Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers", PLDI 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.M. Fahndrich, J. Foster, Z. Su and A. Aiken, "Partial Online Cycle Elimination in Inclusion Constraint Graphs", PLDI 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.A. Rountev and S. Chandra, "Off-line Variable Substitution for Scaling Points-to Analysis", PLDI 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Z.Su, M. Fahndrich and A. Aiken, "Projection Merging: Reducing Redundancies in Inclusion Constraint Graphs", POPL 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle Scholar
  7. 7.B. Steensgaard, "Points-to Analysis in Almost Linear Time", POPL 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.M. Shapiro and S. Horwitz, "Fast and Accurate Flow-Insensitive Points-To Analysis", POPL 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.M. Das, "Unification-Based Pointer Analysis with Directional Assignments", PLDI 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.E. Ruf, "Context-insensitive alias analysis reconsidered", PLDI 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.J. Foster, M. Fahndrich and A. Aiken, "Polymorphic versus Monomorphic Flow-insensitive Points-to Analysis for C", SAS 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.E. Duesterwald, R. Gupta and M. Soffa, "Demand-driven Computation of Interprocedural Data flow", POPL 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle Scholar
  14. 14."Programming Languages - C", ISO/IEC 9899:1990, Internation Standard, 1990.Google ScholarGoogle Scholar
  15. 15.N. Heintze, "Analysis of Large Code Bases: The Compile-Link-Analyze Model", unpublished report, November 1999.Google ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Demand-driven pointer analysis

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  PLDI '01: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
                  June 2001
                  331 pages
                  ISBN:1581134142
                  DOI:10.1145/378795

                  Copyright © 2001 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 1 May 2001

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • Article

                  Acceptance Rates

                  PLDI '01 Paper Acceptance Rate30of144submissions,21%Overall Acceptance Rate406of2,067submissions,20%

                  Upcoming Conference

                  PLDI '24

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader