Advertisement

Unified Analysis of Array and Object References in Strongly Typed Languages

  • Stephen Fink
  • Kathleen Knobe
  • Vivek Sarkar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1824)

Abstract

We present a simple, unified approach for the analysis and optimization of object field and array element accesses in strongly typed languages, that works in the presence of object references/pointers. This approach builds on Array SSA form [14], a uniform representation for capturing control and data flow properties at the level of array elements. The techniques presented here extend previous analyses at the array element level [15] to handle both array element and object field accesses uniformly.

In the first part of this paper, we show how SSA-based program analyses developed for scalars and arrays can be extended to operate on object references in a strongly typed language like Java. The extension uses Array SSA form as its foundation by modeling object references as indices into hypothetical heap arrays. In the second part of this paper, we present two new sparse analysis algorithms using the heap array representation; one identifies redundant loads, and the other identifies dead stores. Using strong typing to help disambiguation, these algorithms are more efficient than equivalent analyses for weakly typed languages. Using the results of these algorithms, we can perform scalar replacement transformations to change operations on object fields and array elements into operations on scalar variables.

We present preliminary experimental results using the Jalapeño optimizing compiler infrastructure. These results illustrate the benefits obtained by performing redundant load and dead store elimination on Java programs. Our results show that the (dynamic) number of memory operations arising from array-element and object-field accesses can be reduced by up to 28%, resulting in execution time speedups of up to 1.1×.

Keywords

static single assignment (SSA) form Array SSA form load elimination store elimination scalar replacement Java object references 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting Equality of Variables in Programs. In: Fifteenth ACM Principles of Programming Languages Symposium, San Diego, CA, pp. 1–11 (January 1988)Google Scholar
  2. 2.
    Bodik, R., Gupta, R.: Array Data-Flow Analysis for Load-Store Optimizations in Superscalar Architectures. In: Huang, C.-H., Sadayappan, P., Banerjee, U., Gelernter, D., Nicolau, A., Padua, D.A. (eds.) LCPC 1995. LNCS, vol. 1033, pp. 1–15. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  3. 3.
    Burke, M.G., Choi, J.-D., Fink, S., Grove, D., Hind, M., Sarkar, V., Serrano, M.J., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The Jalapeño Dynamic Optimizing Compiler for Java. In: ACM Java Grande Conference (June 1999)Google Scholar
  4. 4.
    Callahan, D., Carr, S., Kennedy, K.: Improving Register Allocation for Subscripted Variables. In: Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation, pp. 53–65. White Plains, New York (1990)Google Scholar
  5. 5.
    Carr, S., Kennedy, K.: Scalar Replacement in the Presence of Conditional Control Flow. Software—Practice and Experience (1), 51–77 (1994)Google Scholar
  6. 6.
    Chase, D.R., Wegman, M., Zadeck, F.K.: Analysis of Pointers and Structures. In: Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation, vol. 25(6), pp. 296–310. White Plains, New York, (1990)Google Scholar
  7. 7.
    Choi, J.-D., Burke, M., Carini, P.: Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In: 20th Annual ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages, pp. 232–245 (January 1993)Google Scholar
  8. 8.
    Choi, J.-D., Cytron, R., Ferrante, J.: Automatic Construction of Sparse Data Flow Evaluation Graphs. In: Conference Record of the Eighteenth Annual ACM Symposium on Principles of Programming Languages (January 1991)Google Scholar
  9. 9.
    The Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks (1998), http://www.spec.org/osg/jvm98/
  10. 10.
    Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently Computing Static Single Assignment Form and the Control Dependence Graph. ACM Transactions on Programming Languages and Systems 13(4), 451–490 (1991)CrossRefGoogle Scholar
  11. 11.
    Diwan, A., McKinley, K.S., Moss, J.E.B.: Type-based alias analysis. In: SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 106–117 (May 1998)Google Scholar
  12. 12.
    Ghiya, R., Hendren, L.J.: Puttingp ointer analysis to work. In: 25th Annual ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages, pp. 121–133 (January 1998)Google Scholar
  13. 13.
    Hendren, L.J., Hummel, J., Nicolau, A.: Abstractions for recursive pointer data structures: Improvingthe analysis of imperative programs. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, pp. 249–260 (June 1992)Google Scholar
  14. 14.
    Knobe, K., Sarkar, V.: Array SSA form and its use in Parallelization. In: 25th Annual ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages (January 1998)Google Scholar
  15. 15.
    Knobe, K., Sarkar, V.: Conditional constant propagation of scalar and array references using array SSA form. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 33–56. Springer, Heidelberg (1998)Google Scholar
  16. 16.
    Landi, W., Ryder, B.G., Zhang, S.: Interprocedural side effect analysis with pointer aliasing. In: Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation, pp. 56–67 (May 1993)Google Scholar
  17. 17.
    Larus, J.R., Hilfinger, P.N.: Detecting conflicts between structure accesses. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, vol. 23(7), pp. 21–34 (1988)Google Scholar
  18. 18.
    Muchnick, S.S.: Advanced Compiler Design & Implementation. Morgan Kaufmann Publishers, Inc., San Francisco (1997)Google Scholar
  19. 19.
    Pugh, W.: A new memory model for Java. Note sent to the Java Memory Model mailinglist (October 22,1999), http://www.cs.umd.edu/pugh/java/memoryModel
  20. 20.
    Pugh, W.: Fixing the Java Memory Model. In: ACM Java Grande Conference (June 1999)Google Scholar
  21. 21.
    Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global Value Numbers and Redundant Computations. In: Fifteenth ACM Principles of Programming Languages Symposium, San Diego, CA, pp. 12–27 (January 1988)Google Scholar
  22. 22.
    Wolfe, M.J.: Optimizing Supercompilers for Supercomputers. In The series, Research Monographs in Parallel and Distributed Computing, Pitman, London and The MIT Press, Cambridge, Massachusetts (1989)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Stephen Fink
    • 1
  • Kathleen Knobe
    • 2
  • Vivek Sarkar
    • 1
  1. 1.IBM Thomas J. Watson Research CenterYorktown HeightsUSA
  2. 2.Compaq Cambridge Research Laboratory One Cambridge CenterCambridgeUSA

Personalised recommendations