ReportFlow-Sensitive Type Analysis for C + +

LIMITED DISTRIBUTION NOTICE This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and speciic requests. After outside publication, requests should be lled only by reprints or legally obtained copies of the article (e.g., payment of royalties). Abstract Static determination of run-time types is a key analysis step for compile-time optimizations of object-oriented languages with dynamic dispatch of functions. Type information is fundamental for determining the virtual functions that can be invoked and enables a number of interprocedural analyses and transformations. For example, knowledge of the types of objects at virtual function call sites opens opportunities for inlining, which in turn facilitates a number of intraprocedural compiler optimizations. The results of type analysis may also aid function cloning based on the types of function parameters. In this paper, we show how an existing ow-sensitive pointer alias analysis that uses a compact representation can be adapted to provide a type analysis algorithm which computes type information in a lazy fashion, thereby incurring minimal additional overhead. We show that use of the type information as soon as it becomes available can, in turn, improve the precision of the pointer alias analysis. We demonstrate that incorporating knowledge of the class hierarchy into our algorithm improves its precision, and show that our ow-sensitive method is more precise than ow-insensitive methods.

[1]  James R. Larus,et al.  Detecting conflicts between structure accesses , 1988, PLDI '88.

[2]  Craig Chambers,et al.  Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language , 1989, PLDI '89.

[3]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

[4]  Barbara G. Ryder,et al.  Static Type Determination and Aliasing for C , 1990 .

[5]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[6]  Jong-Deok Choi,et al.  Automatic construction of sparse data flow evaluation graphs , 1991, POPL '91.

[7]  Craig Chambers,et al.  Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches , 1991, ECOOP.

[8]  Barbara G. Ryder,et al.  Pointer-induced aliasing: a problem classification , 1991, POPL '91.

[9]  M. Burke,et al.  Eecient Flow-sensitive Interprocedural Computation of Pointer-induced Aliases and Side Eeects , 1993 .

[10]  Jong-Deok Choi,et al.  Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects , 1993, POPL '93.

[11]  Dirk Grunwald,et al.  Quantifying Behavioral Differences Between C and C++ Programs , 1994 .

[12]  Jong-Deok Choi,et al.  Flow-Insensitive Interprocedural Alias Analysis in the Presence of Pointers , 1994, LCPC.

[13]  Dirk Grunwald,et al.  Reducing indirect function call overhead in C++ programs , 1994, POPL '94.

[14]  Barbara G. Ryder,et al.  Static Type Determination for C++ , 1994, C++ Conference.

[15]  Jens Palsberg,et al.  Object-oriented type systems , 1994, Wiley professional computing.

[16]  Urs Hölzle,et al.  Optimizing dynamically-dispatched calls with run-time type feedback , 1994, PLDI '94.

[17]  David Grove,et al.  Selective specialization for object-oriented languages , 1995, PLDI '95.

[18]  Mary F. Fernández,et al.  Simple and effective link-time optimization of Modula-3 programs , 1995, PLDI '95.

[19]  Dharma P. Agrawal,et al.  An Improved Type-Inference Algorithm to Expose Parallelism in Object-Oriented Programs , 1996 .

[20]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[21]  David W. Binkley,et al.  An enabling optimization for C++ virtual functions , 1996, SAC '96.