Skip to main content

Connection analysis: A practical interprocedural heap analysis for C

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1033))

Abstract

This paper presents a practical heap analysis technique, connection analysis, that can be used to disambiguate heap accesses in C programs. The technique is designed for analysing programs that allocate many disjoint objects in the heap such as dynamically-allocated arrays in scientific programs.

The method statically estimates connection matrices which encode the connection relationships between all heap-directed pointers at each program point. The results of the analysis can be used by parallelizing compilers to determine when two heap-allocated objects are guaranteed to be disjoint, and thus can be used to improve array dependence and interference analysis.

The method has been implemented as a context-sensitive interprocedural analysis in the McCAT optimizing/parallelizing C compiler. Experimental results are given to compare the accuracy of connection analysis versus a conservative estimate based on points-to analysis.

This work supported by NSERC, FCAR, and the EPPP project (financed by Industry Canada, Alex Parallel Computers, Digital Equipment Canada, IBM Canada and the Centre de recherche informatique de Montréal).

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. J. Choi, M. Burke, and P. Carini. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side-effects. In Conf. Rec. of the Twentieth Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, pages 232–245, Charleston, South Carolina, Jan. 1993.

    Google Scholar 

  2. David R. Chase, Mark Wegman, and F. Kenneth Zadeck. Analysis of pointers and structures. In Proc. of the SIGPLAN '90 Conf. on Programming Language Design and Implementation, pages 296–310, White Plains, N. Y., Jun. 1990.

    Google Scholar 

  3. Alain Deutsch. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In Proc. of the 1992 Intl. Conf. on Computer Languages, pages 2–13, Oakland, Calif., Apr. 1992.

    Google Scholar 

  4. Alain Deutsch. Interprocedural may-alias analysis for pointers: Beyond k-limiting. In Proc. of the ACM SIGPLAN '94 Conf. on Programming Language Design and Implementation, pages 230–241, Orlando, Flor., Jun. 1994.

    Google Scholar 

  5. Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Proc. of the ACM SIGPLAN '94 Conf. on Programming Language Design and Implementation, pages 242–256, Orlando, Flor., Jun. 1994.

    Google Scholar 

  6. Ana M. Erosa and Laurie J. Hendren. Taming control flow: A structured approach to eliminating goto statements. In Proc. of the 1994 Intl. Conf. on Computer Languages, pages 229–240, Toulouse, France, May 1994.

    Google Scholar 

  7. Maryam Emami. A practical interprocedural alias analysis for an optimizing/parallelizing C compiler. Master's thesis, McGill U., Montréal, Qué., Jul. 1993.

    Google Scholar 

  8. Rakesh Ghiya. Practical techniques for interprocedural heap analysis. Master's thesis, School of Computer Science, McGill University, May 1995.

    Google Scholar 

  9. Vincent A. Guarna, Jr. A technique for analyzing pointer and structure references in parallel restructuring compilers. In Proc. of the 1988 Intl. Conf. on Parallel Processing, volume II, pages 212–220, St. Charles, Ill., Aug. 1988.

    Google Scholar 

  10. W. Ludwell Harrison III. The interprocedural analysis and automatic parallelization of Scheme programs. Lisp and Symbolic Computation, 2(3/4):179–396, 1989.

    Article  Google Scholar 

  11. L. Hendren, C. Donawa, M. Emami, G. Gao, Justiani, and B. Sridharan. Designing the McCAT compiler based on a family of structured intermediate representations. In Proc. of the 5th Intl. Work. on Languages and Compilers for Parallel Computing, number 757 in Lec. Notes in Comp. Sci., pages 406–420, New Haven, Conn., Aug. 1992. Springer-Verlag. Publ. in 1993.

    Google Scholar 

  12. Laurie J. Hendren and Alexandru Nicolau. Parallelizing programs with recursive data structures. IEEE Trans. on Parallel and Distrib. Systems, 1(1):35–47, Jan. 1990.

    Article  Google Scholar 

  13. Susan Horwitz, Phil Pfeiffer, and Thomas Reps. Dependence analysis for pointer variables. In Proc. of the SIGPLAN '89 Conf. on Programming Language Design and Implementation, pages 28–40, Portland, Ore., Jun. 1989.

    Google Scholar 

  14. N. D. Jones and S. S. Muchnick. Program Flow Analysis, Theory and Applications, chapter 4, Flow Analysis and Optimization of LISP-like Structures, pages 102–131. Prentice-Hall, 1981.

    Google Scholar 

  15. Neil D. Jones and Steven S. Muchnick. A flexible approach to interprocedural data flow analysis and programs with recursive data structures. In Conf. Rec. of the Ninth Ann. ACM Symp. on Principles of Programming Languages, pages 66–74, Albuquerque, N. Mex., Jan. 1982.

    Google Scholar 

  16. William A. Landi. Interprocedural aliasing in the presence of pointers. PhD thesis, Rutgers U., 1992.

    Google Scholar 

  17. J. R. Larus. Compiling Lisp programs for parallel execution. Lisp and Symbolic Computation, 4:29–99, 1991.

    Article  Google Scholar 

  18. James R. Larus and Paul N. Hilfinger. Detecting conflicts between structure accesses. In Proc. of the SIGPLAN '88 Conf. on Programming Language Design and Implementation, pages 21–34, Atlanta, Georgia, Jun. 1988.

    Google Scholar 

  19. William Landi and Barbara G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In Proc. of the ACM SIGPLAN '92 Conf. on Programming Language Design and Implementation, pages 235–248, San Francisco, Calif., Jun. 1992.

    Google Scholar 

  20. J. Plevyak, A. Chien, and V. Karamcheti. Analysis of dynamic structures for efficient parallel execution. In Proc. of the 6th Intl. Work. on Languages and Compilers for Parallel Computing, number 768 in Lec. Notes in Comp. Sci., pages 37–56, Portland, Ore., Aug. 1993. Springer-Verlag. Publ. in 1994.

    Google Scholar 

  21. Erik Ruf. Context-insensitive alias analysis reconsidered. In Proc. of the ACM SIGPLAN '95 Conf. on Programming Language Design and Implementation, pages 13–22, La Jolla, Calif., Jun. 1995.

    Google Scholar 

  22. Bhama Sridharan. An analysis framework for the McCAT compiler. Master's thesis, McGill U., Montréal, Qué., Sep. 1992.

    Google Scholar 

  23. Robert P. Wilson and Monica S. Lam. Efficient context-sensitive pointer analysis for C programs. In Proc. of the ACM SIGPLAN '95 Conf. on Programming Language Design and Implementation, pages 1–12, La Jolla, Calif., Jun. 1995.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Chua-Huang Huang Ponnuswamy Sadayappan Utpal Banerjee David Gelernter Alex Nicolau David Padua

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ghiya, R., Hendren, L.J. (1996). Connection analysis: A practical interprocedural heap analysis for C. In: Huang, CH., Sadayappan, P., Banerjee, U., Gelernter, D., Nicolau, A., Padua, D. (eds) Languages and Compilers for Parallel Computing. LCPC 1995. Lecture Notes in Computer Science, vol 1033. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0014221

Download citation

  • DOI: https://doi.org/10.1007/BFb0014221

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-60765-6

  • Online ISBN: 978-3-540-49446-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics