[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article

The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code

Published: 10 June 2007 Publication History

Abstract

Pointer information is a prerequisite for most program analyses, and the quality of this information can greatly affect their precision and performance. Inclusion-based (i.e. Andersen-style) pointer analysis is an important point in the space of pointer analyses, offering a potential sweet-spot in the trade-off between precision and performance. However, current techniques for inclusion-based pointer analysis can have difficulties delivering on this potential.
We introduce and evaluate two novel techniques for inclusion-based pointer analysis---one lazy, one eager1---that significantly improve upon the current state-of-the-art without impacting precision. These techniques focus on the problem of online cycle detection, a critical optimization for scaling such analyses. Using a suite of six open-source C programs, which range in size from 169K to 2.17M LOC, we compare our techniques against the three best inclusion-based analyses--described by Heintze and Tardieu [11], by Pearce et al. [21], and by Berndl et al. [4]. The combination of our two techniques results in an algorithm which is on average 3.2 xfaster than Heintze and Tardieu's algorithm, 6.4 xfaster than Pearce et al.'s algorithm, and 20.6 faster than Berndl et al.'s algorithm.
We also investigate the use of different data structures to represent points-to sets, examining the impact on both performance and memory consumption. We compare a sparse-bitmap implementation used in the GCC compiler with a BDD-based implementation, and we find that the BDD implementation is on average 2x slower than using sparse bitmaps but uses 5.5x less memory.

References

[1]
Aesop. The Ant and the Grasshopper, rm from Aesop's Fables. Greece, 6th century BC.
[2]
Lars Ole Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, May 1994.
[3]
Dzintars Avots, Michael Dalton, VBenjamin Livshits, and Monica S. Lam. Improving software security with a C pointer analysis. In 27th International Conference on Software Engineering (ICSE), pages 332--341, 2005.
[4]
Marc Berndl, Ondrej Lhotak, Feng Qian, Laurie Hendren, and Navindra Umanee. Points-to analysis using BDDs. In Programming Language Design and Implementation (PLDI), pages 103--114, 2003.
[5]
Randal E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, C-35(8):677--691, August 1986.
[6]
Jong-Deok Choi, Michael Burke, and Paul Carini. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In Principles of Programming Languages (POPL), pages 232--245, 1993.
[7]
Manuvir Das. Unification-based pointer analysis with directional assignments. In Programming Language Design and Implementation (PLDI), pages 35--46, 2000.
[8]
Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Programming Language Design and Implementation (PLDI), pages 242--256, 1994.
[9]
Manuel Faehndrich, Jeffrey S. Foster, Zhendong Su, and Alexander Aiken. Partial online cycle elimination in inclusion constraint graphs. In Programming Language Design and Implementation (PLDI), pages 85--96, 1998.
[10]
Samuel Z. Guyer and Calvin Lin. Error checking with client-driven pointer analysis. Science of Computer Programming, 58(1-2):83--114, 2005.
[11]
Nevin Heintze and Olivier Tardieu. Ultra-fast aliasing analysis using CLA: A million lines of C code in a second. In Programming Language Design and Implementation (PLDI), pages 24--34, 2001.
[12]
Michael Hind. Pointer analysis: haven't we solved this problem yet? In Workshop on Program Analysis for Software Tools and Engineering (PASTE), pages 54--61, 2001.
[13]
Michael Hind, Michael Burke, Paul Carini, and Jong-Deok Choi. Interprocedural pointer alias analysis. ACM Transactions on Programming Languages and Systems, 21(4):848--894, 1999.
[14]
William Landi and Barbara G. Ryder. Pointer-induced aliasing: a problem taxonomy. In Symposium on Principles of Programming Languages (POPL), pages 93--103, 1991.
[15]
William Landi and Barbara G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In Programming Language Design and Implementation (PLDI), pages 235--248, 1992.
[16]
J. Lind-Nielson. BuDDy, a binary decision package. http://www.itu.dk/research/buddy/.
[17]
George C. Necula, Scott McPeak, Shree Prakash Rahul, and Westley Weimer. CIL: Intermediate language and tools for analysis and transformation of C programs. In Computational Complexity, pages 213--228, 2002.
[18]
F. Nielson, H. R. Nielson, and C. L. Hankin. Principles of Program Analysis. Springer-Verlag, 1999.
[19]
Esko Nuutila and Eljas Soisalon-Soininen. On finding the strong components in a directed graph. Technical Report TKO-B94, Helsinki University of Technology, Laboratory of Information Processing Science, 1995.
[20]
Erik M. Nystrom, Hong-Seok Kim, and Wen mei WHwu. Bottom-up and top-down context-sensitive summary-based pointer analysis. In International Symposium on Static Analysis, pages 165--180, 2004.
[21]
David Pearce, Paul Kelly, and Chris Hankin. Efficient field-sensitive pointer analysis for C. In ACM workshop on Program Analysis for Software Tools and Engineering (PASTE), pages 37--42, 2004.
[22]
David J. Pearce, Paul H. J. Kelly, and Chris Hankin. Online cycle detection and difference propagation for pointer analysis. In 3rd International IEEE Workshop on Source Code Analysis and Manipulation (SCAM), pages 3--12, 2003.
[23]
Atanas Rountev and Satish Chandra. Off-line variable substitution for scaling points-to analysis. In Programming Language Design and Implementation (PLDI), pages 47--56, 2000.
[24]
M. Shapiro and S. Horwitz. The effects of the precision of pointer analysis. Lecture Notes in Computer Science, 1302:16--34, 1997.
[25]
Bjarne Steensgaard. Points-to analysis in almost linear time. In Symposium on Principles of Programming Languages (POPL), pages 32--41, 1996.
[26]
Robert Tarjan. Depth-first search and linear graph algorithms. SIAM J. Comput., 1(2):146--160, June 1972.
[27]
Teck Bok Tok, Samuel Z. Guyer, and Calvin Lin. Efficient flow-sensitive interprocedural data-flow analysis in the presence of pointers. In 15th International Conference on Compiler Construction (CC), pages 17--31, 2006.
[28]
John Whaley and Monica S. Lam. Cloning-based context-sensitive pointer alias analysis. In Programming Language Design and Implementation (PLDI), pages 131--144, 2004.
[29]
Robert P. Wilson and Monica S. Lam. Efficient context-sensitive pointer analysis for c programs. In Programming Language Design and Implementation (PLDI), pages 1--12, 1995.
[30]
Jianwen Zhu and Silvian Calman. Symbolic pointer analysis revisited. In Programming Language Design and Implementation (PLDI), pages 145--157, 2004.

Cited By

View all
  • (2024)Iterative-Epoch Online Cycle Elimination for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/36498628:OOPSLA1(1437-1462)Online publication date: 29-Apr-2024
  • (2023)Recursive State Machine Guided Graph Folding for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/35912337:PLDI(318-342)Online publication date: 6-Jun-2023
  • (2023)Automatic Permission Check Analysis for Linux KernelIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2022.316536820:3(1849-1866)Online publication date: 1-May-2023
  • Show More Cited By

Index Terms

  1. The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 42, Issue 6
      Proceedings of the 2007 PLDI conference
      June 2007
      491 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1273442
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2007
        508 pages
        ISBN:9781595936332
        DOI:10.1145/1250734
      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: 10 June 2007
      Published in SIGPLAN Volume 42, Issue 6

      Check for updates

      Author Tag

      1. pointer analysis

      Qualifiers

      • Article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)68
      • Downloads (Last 6 weeks)13
      Reflects downloads up to 15 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)Iterative-Epoch Online Cycle Elimination for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/36498628:OOPSLA1(1437-1462)Online publication date: 29-Apr-2024
      • (2023)Recursive State Machine Guided Graph Folding for Context-Free Language ReachabilityProceedings of the ACM on Programming Languages10.1145/35912337:PLDI(318-342)Online publication date: 6-Jun-2023
      • (2023)Automatic Permission Check Analysis for Linux KernelIEEE Transactions on Dependable and Secure Computing10.1109/TDSC.2022.316536820:3(1849-1866)Online publication date: 1-May-2023
      • (2023)A Novel Approach to Pointer Analysis2022 OPJU International Technology Conference on Emerging Technologies for Sustainable Development (OTCON)10.1109/OTCON56053.2023.10113963(1-5)Online publication date: 8-Feb-2023
      • (2022)Taming transitive redundancy for context-free language reachabilityProceedings of the ACM on Programming Languages10.1145/35633436:OOPSLA2(1556-1582)Online publication date: 31-Oct-2022
      • (2021)A Modern Look at GRIN, an Optimizing Functional Language Back EndActa Cybernetica10.14232/actacyb.28296925:4(847-876)Online publication date: 3-Feb-2021
      • (2021)The fine-grained and parallel complexity of andersen’s pointer analysisProceedings of the ACM on Programming Languages10.1145/34343155:POPL(1-29)Online publication date: 4-Jan-2021
      • (2021)Thread-aware area-efficient high-level synthesis compiler for embedded devicesProceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization10.1109/CGO51591.2021.9370341(327-339)Online publication date: 27-Feb-2021
      • (2021)Towards parallelism detection of sequential programs with graph neural networkFuture Generation Computer Systems10.1016/j.future.2021.07.001125:C(515-525)Online publication date: 1-Dec-2021
      • (2021)Accelerating Program Analyses in Datalog by Merging Library FactsStatic Analysis10.1007/978-3-030-88806-0_4(77-101)Online publication date: 13-Oct-2021
      • Show More Cited By

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media