skip to main content
10.5555/3049832.3049848acmconferencesArticle/Chapter ViewAbstractPublication PagescgoConference Proceedingsconference-collections
Article

Pointer disambiguation via strict inequalities

Published: 04 February 2017 Publication History

Abstract

The design and implementation of static analyses that disambiguate pointers has been a focus of research since the early days of compiler construction. One of the challenges that arise in this context is the analysis of languages that support pointer arithmetics, such as C, C++ and assembly dialects. This paper contributes to solve this challenge. We start from an obvious, yet unexplored, observation: if a pointer is strictly less than another, they cannot alias. Motivated by this remark, we use abstract interpretation to build strict less-than relations between pointers. We construct a program representation that bestows the Static Single Information (SSI) property onto our dataflow analysis. SSI gives us a sparse algorithm, whose correctness is easy to ensure. We have implemented our static analysis in LLVM. It runs in time linear on the number of program variables, and, depending on the benchmark, it can be as much as six times more precise than the pointer disambiguation techniques already in place in that compiler.

References

[1]
A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools (2nd Edition). Addison Wesley, 2006.
[2]
P. Alves, F. Gruber, J. Doerfert, A. Lamprineas, T. Grosser, F. Rastello, and F. M. Q. a. Pereira. Runtime pointer disambiguation. In OOPSLA, pages 589–606. ACM, 2015.
[3]
L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen, 1994.
[4]
G. Balakrishnan and T. Reps. Analyzing memory accesses in x86 executables. In CC, pages 5–23. Springer, 2004.
[5]
G. Balatsouras and Y. Smaragdakis. Structure-sensitive points-to analysis for C and C++. In SAS, pages 84–104. Springer, 2016.
[6]
J. P. Banning. An efficient way to find the side effects of procedure calls and the aliases of variables. In POPL, pages 29–41. ACM, 1979.
[7]
R. Bodik, R. Gupta, and V. Sarkar. ABCD: eliminating array bounds checks on demand. In PLDI, pages 321–333. ACM, 2000.
[8]
Z. Budimlic, K. D. Cooper, T. J. Harvey, K. Kennedy, T. S. Oberg, and S. W. Reeves. Fast copy coalescing and live-range identification. In PLDI, pages 25–32. ACM, 2002.
[9]
J. Chen. CFL alias analysis, 2016. Google’s Summer of Code Report.
[10]
P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In POPL, pages 238–252. ACM, 1977.
[11]
P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In POPL, pages 84– 96. ACM, 1978.
[12]
R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently computing static single assignment form and the control dependence graph. TOPLAS, 13(4):451–490, 1991.
[13]
J. Ferrante, J. Ottenstein, and D. Warren. The program dependence graph and its use in optimization. TOPLAS, 9(3): 319–349, 1987.
[14]
S. Hack, D. Grund, and G. Goos. Register allocation for programs in SSA-form. In CC, pages 247–262. Springer-Verlag, 2006.
[15]
B. Hardekopf and C. Lin. The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code. In PLDI, pages 290–299. ACM, 2007.
[16]
B. Hardekopf and C. Lin. Flow-sensitive pointer analysis for millions of lines of code. In CGO, pages 265–280, 2011.
[17]
M. Hind. Pointer analysis: Haven’t we solved this problem yet? In PASTE, pages 54–61. ACM, 2001.
[18]
ISO-Standard. 9899 - The C programming language, 2011.
[19]
C. Lattner and V. S. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. In CGO, pages 75–88. IEEE, 2004.
[20]
F. Logozzo and M. Fahndrich. Pentagons: a weakly relational abstract domain for the efficient validation of array accesses. In SAC, pages 184–188. ACM, 2008.
[21]
F. Logozzo and M. Fähndrich. Pentagons: A weakly relational abstract domain for the efficient validation of array accesses. Sci. Comput. Program., 75(9):796–807, 2010.
[22]
K. Memarian, J. Matthiesen, J. Lingard, K. Nienhuis, D. Chisnall, R. N. M. Watson, and P. Sewell. Into the depths of C: Elaborating the de facto standards. In PLDI, pages 1–15. ACM, 2016.
[23]
A. Miné. The octagon abstract domain. Higher Order Symbol. Comput., 19:31–100, 2006.
[24]
H. Nazaré, I. Maffra, W. Santos, L. Barbosa, L. Gonnord, and F. M. Q. Pereira. Validation of memory accesses through symbolic analyses. In OOPSLA, pages 791–809. ACM, 2014.
[25]
E. Nuutila. Efficient transitive closure computation in large digraphs. Acta Polytechnica Scandinavia: Math. Comput. Eng., 74:1–124, 1995.
[26]
H. Oh, W. Lee, K. Heo, H. Yang, and K. Yi. Selective contextsensitivity guided by impact pre-analysis. In PLDI, pages 475–484. ACM, 2014.
[27]
V. Paisante, M. Maalej, L. Barbosa, L. Gonnord, and F. M. Quint˜ao Pereira. Symbolic range analysis of pointers. In CGO, pages 171–181. ACM, 2016.
[28]
F. M. Q. Pereira and D. Berlin. Wave propagation and deep propagation for pointer analysis. In CGO, pages 126–135. IEEE, 2009.
[29]
B. Rodrigues, F. M. Quint˜ao Pereira, and D. F. Aranha. Sparse representation of implicit flows with applications to sidechannel detection. In CC, pages 110–120. ACM, 2016.
[30]
R. E. Rodrigues, V. H. S. Campos, and F. M. Q. Pereira. A fast and low overhead technique to secure programs against integer overflows. In CGO. ACM, 2013.
[31]
R. Rugina and M. C. Rinard. Symbolic bounds analysis of pointers, array indices, and accessed memory regions. TOPLAS, 27(2):185–235, 2005.
[32]
S. Rus, L. Rauchwerger, and J. Hoeflinger. Hybrid analysis: Static and dynamic memory reference analysis. In ICS, pages 251–283. IEEE, 2002.
[33]
T. C. Spillman. Exposing side-effects in a PL/I optimizing compiler. In IFIP, pages 376–381. Springer, 1971.
[34]
B. Steensgaard. Points-to analysis in almost linear time. In POPL, pages 32–41. ACM, 1996.
[35]
Y. Sui and J. Xue. SVF: Interprocedural static value-flow analysis in llvm. In CC, pages 265–266. ACM, 2016.
[36]
Y. Sui, P. Di, and J. Xue. Sparse flow-sensitive pointer analysis for multithreaded programs. In CGO, pages 160–170. ACM, 2016.
[37]
Y. Sui, X. Fan, H. Zhou, and J. Xue. Loop-oriented array- and field-sensitive pointer analysis for automatic SIMD vectorization. In LCTES, pages 41–51. ACM, 2016.
[38]
A. L. C. Tavares, B. Boissinot, F. M. Q. Pereira, and F. Rastello. Parameterized construction of program representations for sparse dataflow analyses. In Compiler Construction, pages 2–21. Springer, 2014.
[39]
R. A. van Engelen, J. Birch, Y. Shou, B. Walsh, and K. A. Gallivan. A unified framework for nonlinear dependence testing and symbolic analysis. In ICS, pages 106–115. ACM, 2004.
[40]
J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In PLDI, pages 131–144. ACM, 2004.
[41]
R. P. Wilson and M. S. Lam. Efficient context-sensitive pointer analysis for c programs. In PLDI, pages 1–12. ACM, 1995.
[42]
M. Wolfe. High Performance Compilers for Parallel Computing. Adison-Wesley, 1st edition, 1996.
[43]
X. Yang, Y. Chen, E. Eide, and J. Regehr. Finding and understanding bugs in C compilers. In PLDI, pages 283–294. ACM, 2011.
[44]
S. H. Yong and S. Horwitz. Pointer-range analysis. In SAS, pages 133–148. Springer, 2004.
[45]
Q. Zhang, M. R. Lyu, H. Yuan, and Z. Su. Fast algorithms for Dyck-CFL-reachability with applications to alias analysis. In PLDI, pages 435–446. ACM, 2013.
[46]
J. Zhao, S. Nagarakatte, M. M. K. Martin, and S. Zdancewic. Formal verification of ssa-based optimizations for llvm. In PLDI, pages 175–186. ACM, 2013.
[47]
X. Zheng and R. Rugina. Demand-driven alias analysis for c. In POPL, pages 197–208. ACM, 2008.

Cited By

View all
  1. Pointer disambiguation via strict inequalities

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CGO '17: Proceedings of the 2017 International Symposium on Code Generation and Optimization
    February 2017
    317 pages
    ISBN:9781509049318

    Sponsors

    Publisher

    IEEE Press

    Publication History

    Published: 04 February 2017

    Check for updates

    Author Tags

    1. Alias analysis
    2. precision
    3. range analysis
    4. speed

    Qualifiers

    • Article

    Conference

    CGO '17
    Sponsor:

    Acceptance Rates

    CGO '17 Paper Acceptance Rate 26 of 116 submissions, 22%;
    Overall Acceptance Rate 312 of 1,061 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)3
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 14 Sep 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Get Access

    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