Skip to main content
Log in

Connection Analysis: A Practical Interprocedural Heap Analysis for C

  • Published:
International Journal of Parallel Programming Aims and scope Submit manuscript

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 analyzing 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 is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

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

    Google Scholar 

  2. N. D. Jones and S. S. Muchnick, A Flexible Approach to Interprocedural Data Flow Analysis and Programs with Recursive Data Structures, Conf. Ree. of the Ninth Ann. ACM Symp. on Principles of Programming Languages, Albuquerque, N. Mex., pp. 66–74 (January 1982).

    Google Scholar 

  3. J. R. Larus and P. N. Hilfinger, Detecting Conflicts Between Structure Accesses, Proc. of the SIGPLAN ’88 Conf. on Programming Language Design and Implementation, Atlanta, Georgia, pp. 21–34 (June 1988).

    Google Scholar 

  4. J. R. Larus, Compiling Lisp Programs for Parallel Execution, Lisp and Symbolic Computation, 4:29–99 (1991).

    Article  Google Scholar 

  5. V. A. Guarna, Jr., A Technique for Analyzing Pointer and Structure References in Parallel Restructuring Compilers, Proc. of the 1988 Intl. Conf. on Parallel Processing, Vol. II, St. Charles, Illinois, pp. 212–220 (August 1988).

    Google Scholar 

  6. S. Horwitz, P. Pfeiffer, and T. Reps, Dependence Analysis for Pointer Variables, Proc. of the SIGPLAN ’89 Conf. on PLDI, Portland, Oregon, pp. 28–40 (June 1989).

    Google Scholar 

  7. W. L. Harrison III, The Interprocedural Analysis and Automatic Parallelization of Scheme Programs, Lisp and Symbolic Computation, 2(3/4): 179–396 (1989).

    Article  Google Scholar 

  8. D. R. Chase, M. Wegman, and F. K. Zadeck, Analysis of Pointers and Structures, Proc. of the SIGPLAN ’90 Conf. on PLDI, White Plains, New York, pp. 296–310 (June 1990).

    Google Scholar 

  9. L. J. Hendren and A. Nicolau, Parallelizing Programs with Recursive Data Structures, IEEE Trans. on Parallel and Distrib. Syst. 1:35–47 (January 1990).

    Article  Google Scholar 

  10. W. Landi and B. G. Ryder, A Safe Approximate Algorithm for Interprocedural Pointer Aliasing, Proc. of the ACM SIGPLAN ’92 Conf. on PLDI, San Francisco, California, pp. 235–248 (June 1992).

    Google Scholar 

  11. J.-D. Choi, M. Burke, and P. Carini, Efficient Flow-Sensitive Interprocedural Computation of Pointer-Induced Aliases and Side Effects, Conf. Rec. of the 20th Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, Charleston, South Carolina, pp. 232–245 (January 1993).

    Google Scholar 

  12. A. Deutsch, A Storeless Model of Aliasing and Its Abstractions Using Finite Representations of Right-Regular Equivalence Relations, Proc. of the 1992 Intl. Conf. on Computer Languages, Oakland, California, pp. 2–13 (April 1992).

    Chapter  Google Scholar 

  13. A. Deutsch, Interprocedural May-Alias Analysis for Pointers: Beyond k-limiting, Proc. of the ACM SIGPLAN ’94 Conf. on PLDI, Orlando, Florida, pp. 230–241 (June 1994).

    Google Scholar 

  14. J. Plevyak, A. Chien, and V. Karamcheti, Analysis of Dynamic Structures for Efficient Parallel Execution, Proc. of the Sixth Intl. Workshop on Languages and Compilers for Parallel Computing, Portland, Oregon, Springer-Verlag, Lec. Notes in Comp. Sci., 768:37–56 (August 1993).

    Chapter  Google Scholar 

  15. M. Emami, R. Ghiya, and L. J. Hendren, Context-Sensitive Interprocedural Points-to-Analysis in the Presence of Function Pointers, Proc. of the ACM SIGPLAN ’94 Conf. on PLDI, Orlando, Florida, pp. 242–256 (June 1994).

    Google Scholar 

  16. R. P. Wilson and M. S. Lam, Efficient Context-Sensitive Pointer Analysis for C Programs, Proc. of the ACM SIGPLAN ’95 Conf. on PLDI, La Jolla, California, pp. 1–12 (June 1995).

    Google Scholar 

  17. E. Ruf, Context-Insensitive Alias Analysis Reconsidered, Proc. of the ACM SIGPLAN ’95 Conf. on PLDI, La Jolla, California, pp. 13–22 (June 1995).

    Google Scholar 

  18. R. Ghiya, Practical Techniques for Interprocedural Heap Analysis, Master’s Thesis, School of Computer Science, McGill University (May 1995).

    Google Scholar 

  19. M. Emami, A Practical Interprocedural Alias Analysis for an Optimizing/Parallelizing C Compiler, Master’s Thesis, McGill University, Montreal, Québec (July 1993).

    Google Scholar 

  20. B. Sridharan, An Analysis Framework for the McCAT Compiler, Master’s Thesis, McGill University, Montréal, Québec (September 1992).

    Google Scholar 

  21. L. Hendren, C. Donawa, M. Emami, G. Gao, Justiani, and B. Sridharan, Designing the McCAT Compiler Based on a Family of Structured Intermediate Representations, Proc. of the 5th Intl. Workshop on Languages and Compilers for Parallel Computing, New Haven, Connecticut, Springer-Verlag, Lec. Notes in Comp. Sci., 757:406–420 (August 1992).

    Chapter  Google Scholar 

  22. A. M. Erosa and L. J. Hendren, Taming Control Flow: A Structured Approach to Eliminating goto Statements, Proc. of the 1994 Intl. Conf. on Computer Languages, Toulouse, France, pp. 229–240 (May 1994).

    Google Scholar 

  23. J. P. Singh, W.-D. Weber, and A. Gupta, SPLASH: Stanford Parallel Applications for Shared-Memory, Computer Arch. News, 20:5–44 (March 1992).

    Article  Google Scholar 

  24. S. C. Woo, M. Ohara, E. Torrie, J. P. Singh, and A. Gupta, The SPLASH-2 Programs: Characterization and Methodological Considerations, Proc. of the 22nd Ann. Intl. Symp. on Computer Architecture, Santa Margherita Ligure, Italy, pp. 24–36 (June 1995).

    Google Scholar 

  25. M. Sagiv, T. Reps, and R. Wilhelm, Solving Shape-Analysis Problems in Languages with Destructive Updating, Conf. Rec. of the 23rd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, St. Petersburg, Florida, pp. 16–31 (January 1996).

    Google Scholar 

  26. R. Ghiya and L. J. Hendren, Is it a Tree, a DAG, or a Cyclic Graph? A Shape Analysis for Heap-Directed Pointers in C, Conf. Rec. of the 23rd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, St. Petersburg, Florida, pp. 1–15 (January 1996).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rakesh Ghiya.

Additional information

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).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Ghiya, R., Hendren, L.J. Connection Analysis: A Practical Interprocedural Heap Analysis for C. Int J Parallel Prog 24, 547–578 (1996). https://doi.org/10.1007/BF03356759

Download citation

  • Published:

  • Issue Date:

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

Key Words

Navigation