ABSTRACT
This paper proposes an efficient technique for context-sensitive pointer analysis that is applicable to real C programs. For efficiency, we summarize the effects of procedures using partial transfer functions. A partial transfer function (PTF) describes the behavior of a procedure assuming that certain alias relationships hold when it is called. We can reuse a PTF in many calling contexts as long as the aliases among the inputs to the procedure are the same. Our empirical results demonstrate that this technique is successful—a single PTF per procedure is usually sufficient to obtain completely context-sensitive results. Because many C programs use features such as type casts and pointer arithmetic to circumvent the high-level type system, our algorithm is based on a low-level representation of memory locations that safely handles all the features of C. We have implemented our algorithm in the SUIF compiler system and we show that it runs efficiently for a set of C benchmarks.
- 1.D. R. Chase, M. Wegman, and F. K. Zadeck. Analysis of Pointers and Structures. In Proceedings of the ACM SIGPLAN'90 Conference on Programming Language Design andlmplementation, pages 296-310, June 1990. Google ScholarDigital Library
- 2.J.-D. Choi, M. Burke, and P. Carini. Efficient Flow- Sensitive Interprocedural Computation of Pointer- Induced Aliases and Side Effects. In Proceedings of the 20thAnnual ACM Symposium on Principles of Programming Languages, pages 232-245, Jan. 1993. Google ScholarDigital Library
- 3.R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. An Efficient Method of Computing Static Single Assignment Form. In Proceedings of the 16th Annual ACM Symposium on Principles of Programming Languages, pages 25-35, Jan. 1989. Google ScholarDigital Library
- 4.A. Deutsch. Interprocedural May-Alias Analysis for Pointers: Beyond k-limiting. In Proceedings of the ACM SIGPLAN'94 Conference on Programming Language Design and implementation, pages 230-241, June 1994. Google ScholarDigital Library
- 5.M. Emami. A Practical interprocedural Alias Analysis for an Optimizing/Parallelizing C Compiler. Master's thesis, School of Computer Science, McGill University, Aug. 1993.Google Scholar
- 6.M. Emami, R. Ghiya, and L. J. Hendren. Context- Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers. In Proceedings of the ACM SIGPLAN'94 Conference on Programming Language Design andlmplementation,pages 242-256, June 1994. Google ScholarDigital Library
- 7.M.W. Hall, S. P. Amarasinghe, B. R. Murphy, and M. S. Lam. Interprocedural Analysis for Parallelization: Preliminary Results. Technical Report CSL-TR-95-665, Computer Systems Lab, Stanford University, Stanford, CA 94305-4055, Apr. 1995. Google ScholarDigital Library
- 8.W. L. Harrison III. The Interprocedural Analysis and Automatic Parallelization of Scheme Programs. Lisp and Symbolic Computation, 2(3): 176-396, Oct. 1989.Google Scholar
- 9.L. J. Hendren. Parallelizing Programs with Recursive Data Structures. IEEE ;l)'ansactions on Parallel and Distributed Systems, 1 (1):35-47, jan. 1990. Google ScholarDigital Library
- 10.F. Irigoin, P. Jouvelot, and R. Triolet. Semantical interprocedural Parallelization: An Overview of the PIPS Project. In Proceedings of the 1991 ACM International Conference on Supercomputing, pages 254-251, June 1991. Google ScholarDigital Library
- 11.N. Jones and S. Muchnick. Flow Analysis and Optimization of Lisp-like Structures. In S. Muchnick and N. Jones, editors, Program Flow Analysis: Theory and Applications, pages 102-131. Prentice Hall, 1979.Google Scholar
- 12.W. Landi and B. G. Ryder. A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. In Proceedings of the ACM SIGPLAN'92 Conference on Programming Language Design and Implementation, pages 235-248, June 1992. Google ScholarDigital Library
- 13.J. R. Larus and P. N. Hilfinger. Detecting Conflicts Between Structure Accesses. In Proceedings of the ACM SIGPLAN'88 Conference on Programming Language Design and implementation, pages 21-34, June 1988. Google ScholarDigital Library
- 14.T. J. Marlowe, W. A. Landi, B. G. Ryder, J. D. Choi, M. G. Burke, and P. Carini. Pointer-Induced Aliasing: A Clarification. ACM SiGPLAN Notices, 28(9):67-70, Sept. 1993. Google ScholarDigital Library
- 15.E. Ruf. Personal communication, Oct. 1994.Google Scholar
- 16.R.P. Wilson et al. SUIF: An Infrastructure for Research on Parallelizing and Optimizing Compilers. ACM SiG- PLAN Notices, 29(12):31-37, Dec. 1994. Google ScholarDigital Library
Index Terms
- Efficient context-sensitive pointer analysis for C programs
Recommendations
Efficient context-sensitive pointer analysis for C programs
This paper proposes an efficient technique for context-sensitive pointer analysis that is applicable to real C programs. For efficiency, we summarize the effects of procedures using partial transfer functions. A partial transfer function (PTF) describes ...
Semi-sparse flow-sensitive pointer analysis
POPL '09Pointer analysis is a prerequisite for many program analyses, and the effectiveness of these analyses depends on the precision of the pointer information they receive. Two major axes of pointer analysis precision are flow-sensitivity and context-...
Comments