Making context-sensitive points-to analysis with heap cloning practical for the real world
Authors:
Open Access
- 10 June 2007
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 42 (6) , 278-289
Abstract
Context-sensitive pointer analysis algorithms with full "heapcloning" are powerful but are widely considered to be too expensive to include in production compilers. This paper shows, for the first time, that a context-sensitive, field-sensitive algorithm with fullheap cloning (by acyclic call paths) can indeed be both scalable and extremely fast in practice. Overall, the algorithm is able to analyze programs in the range of 100K-200K lines of C code in 1-3 seconds,takes less than 5% of the time it takes for GCC to compile the code (which includes no whole-program analysis), and scales well across five orders of magnitude of code size. It is also able to analyze the Linux kernel (about 355K linesof code) in 3.1 seconds. The paper describes the major algorithmic and engineering design choices that are required to achieve these results, including (a) using flow-insensitive and unification-basedanalysis, which are essential to avoid exponential behavior in practice;(b) sacrificing context-sensitivity within strongly connected components of the call graph; and (c) carefully eliminating several kinds of O( N 2 ) behaviors (largely without affecting precision). The techniques used for (b) and (c) eliminated several major bottlenecks to scalability, and both are generalizable to other context-sensitive algorithms. We show that the engineering choices collectively reduce analysis time by factors of up to 10x-15xin our larger programs, and have found that the savings grow strongly with program size. Finally, we briefly summarize results demonstrating the precision of the analysis.Keywords
This publication has 26 references indexed in Scilit:
- SAFECode2006
- Automatic pool allocation2005
- Transparent pointer compression for linked data structures2005
- Memory safety without garbage collection for embedded applicationsACM Transactions on Embedded Computing Systems, 2005
- Cloning-based context-sensitive pointer alias analysis using binary decision diagrams2004
- Bottom-Up and Top-Down Context-Sensitive Summary-Based Pointer AnalysisLecture Notes in Computer Science, 2004
- Static Analysis of Accessed Regions in Recursive Data StructuresLecture Notes in Computer Science, 2003
- Solving shape-analysis problems in languages with destructive updatingACM Transactions on Programming Languages and Systems, 1998
- Context-sensitive interprocedural points-to analysis in the presence of function pointers1994
- Efficiency of a Good But Not Linear Set Union AlgorithmJournal of the ACM, 1975