Abstract

Pointer analysis is one of the fundamental problems in static program analysis. Given a set of pointers, the task is to produce a useful over-approximation of the memory locations that each pointer may point-to at runtime. The most common formulation is Andersen’s Pointer Analysis (APA), defined as an inclusion-based set of m pointer constraints over a set of n pointers. Scalability is extremely important, as points-to information is a prerequisite to many other components in the static-analysis pipeline. Existing algorithms solve APA in O ( n 2 · m ) time, while it has been conjectured that the problem has no truly sub-cubic algorithm, with a proof so far having remained elusive. It is also well-known that APA can be solved in O ( n 2 ) time under certain sparsity conditions that hold naturally in some settings. Besides these simple bounds, the complexity of the problem has remained poorly understood. In this work we draw a rich fine-grained and parallel complexity landscape of APA, and present upper and lower bounds. First, we establish an O ( n 3 ) upper-bound for general APA, improving over O ( n 2 · m ) as n = O ( m ). Second, we show that even on-demand APA (“may a specific pointer a point to a specific location b ?”) has an Ω( n 3 ) (combinatorial) lower bound under standard complexity-theoretic hypotheses. This formally establishes the long-conjectured “cubic bottleneck” of APA, and shows that our O ( n 3 )-time algorithm is optimal. Third, we show that under mild restrictions, APA is solvable in Õ( n ω ) time, where ω<2.373 is the matrix-multiplication exponent. It is believed that ω=2+ o (1), in which case this bound becomes quadratic. Fourth, we show that even under such restrictions, even the on-demand problem has an Ω( n 2 ) lower bound under standard complexity-theoretic hypotheses, and hence our algorithm is optimal when ω=2+ o (1). Fifth, we study the parallelizability of APA and establish lower and upper bounds: (i) in general, the problem is P-complete and hence unlikely parallelizable, whereas (ii) under mild restrictions, the problem is parallelizable. Our theoretical treatment formalizes several insights that can lead to practical improvements in the future.

Highlights

  • Programs execute by allocating memory for storing data and manipulating pointers to that memory

  • 4 A BASELINE ALGORITHM FOR ANDERSEN’S POINTER ANALYSIS we present a baseline algorithm for APA

  • We introduce some additional statements between all di and between all ci such that c1 is D-reachable from d1 in G iff there exists some k such that ck →−ε dk in G

Read more

Summary

INTRODUCTION

Programs execute by allocating memory for storing data and manipulating pointers to that memory. We want to decide whether a may point to b for a given pointer a and memory location b, rather than the exhaustive case that computes the points-to set of every pointer Under this restriction, many techniques devise analysis algorithms that aim to solve on-demand APA faster [Chatterjee et al 2018; Heintze and Tardieu 2001a; Lu et al 2013; Sridharan et al 2005; Sui and Xue 2016; Vedurada and Nandivada 2019; Zhang et al 2013; Zheng and Rugina 2008]. (4) It is believed that ω = 2 + o (1), in which case our previous bound becomes nearly quadratic We complement this result by showing that even On-demand APA with witnesses that are logarithmically bounded (i.e., a simpler problem than that in Item 3) does not have a subquadratic algorithm (i.e., with complexity O (n2−ε ) for some fixed ε > 0) under the Orthogonal Vectors hypothesis [Williams 2019]. Our work makes some of the first steps in this direction

PRELIMINARIES
SUMMARY OF MAIN RESULTS
THE CUBIC HARDNESS OF ANDERSEN’S POINTER ANALYSIS
A SUB-CUBIC ALGORITHM FOR BOUNDED ANDERSEN’S POINTER ANALYSIS
A Sub-cubic Algorithm for D1-Reachability
Solve D1-Reachability in Gi using
THE QUADRATIC HARDNESS OF BOUNDED ANDERSEN’S POINTER ANALYSIS
THE PARALLELIZABILITY OF ANDERSEN’S POINTER ANALYSIS
Andersen’s Pointer Analysis Is Not Parallelizable
Bounded Andersen’s Pointer Analysis Is Parallelizable
CONCLUSION

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.