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).
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
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.
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.
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.
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.
Maryam Emami. A practical interprocedural alias analysis for an optimizing/parallelizing C compiler. Master's thesis, McGill U., Montréal, Qué., Jul. 1993.
Rakesh Ghiya. Practical techniques for interprocedural heap analysis. Master's thesis, School of Computer Science, McGill University, May 1995.
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.
W. Ludwell Harrison III. The interprocedural analysis and automatic parallelization of Scheme programs. Lisp and Symbolic Computation, 2(3/4):179–396, 1989.
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.
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.
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.
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.
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.
William A. Landi. Interprocedural aliasing in the presence of pointers. PhD thesis, Rutgers U., 1992.
J. R. Larus. Compiling Lisp programs for parallel execution. Lisp and Symbolic Computation, 4:29–99, 1991.
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.
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.
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.
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.
Bhama Sridharan. An analysis framework for the McCAT compiler. Master's thesis, McGill U., Montréal, Qué., Sep. 1992.
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.
Author information
Authors and Affiliations
Editor information
Rights 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