Advertisement

Subregion Analysis and Bounds Check Elimination for High Level Arrays

  • Mackale Joyner
  • Zoran Budimlić
  • Vivek Sarkar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6601)

Abstract

For decades, the design and implementation of arrays in programming languages has reflected a natural tension between productivity and performance. Recently introduced HPCS languages (Chapel, Fortress and X10) advocate the use of high-level arrays for improved productivity. For example, high-level arrays in the X10 language support rank-independent specification of multidimensional loop and array computations using regions and points. Three aspects of X10 high-level arrays are important for productivity but pose significant performance challenges: high-level accesses are performed through point objects rather than integer indices, variables containing references to arrays are rank-independent, and all subscripts in a high-level array access must be checked for bounds violations.

The first two challenges have been addressed in past work. In this paper, we address the third challenge of optimizing the overhead of array bounds checks by developing a novel region-based interprocedural array bounds analysis to automatically identify redundant checks. Elimination of redundant checks reduces the runtime overhead of bounds checks, and also enables further optimization by removing constraints that arise from precise exception semantics. We have implemented an array bounds check elimination algorithm that inserts special annotations that are recognized by a modified JVM.

We also introduce array views, a high-level construct that improves productivity by allowing the programmer to access the underlying array through multiple views. We describe a technique for optimizing away the overhead of many common cases of array views in X10. Our experiments show that eliminating bounds checks using the results of the analysis described in this paper improves the performance of our benchmarks by up to 22% over JIT compilation.

Keywords

Code Fragment Array Access Runtime Check Array Operation Array Bound 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Aggarwal, A., Randall, K.H.: Related field analysis. In: PLDI 2001, pp. 214–220 (2001)Google Scholar
  2. 2.
    Almási, G., Padua, D.: MaJIC: compiling MATLAB for speed and responsiveness. In: PLDI 2002, pp. 294–303 (2002)Google Scholar
  3. 3.
    Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: POPL 1988, pp. 1–11. ACM Press, New York (1988)Google Scholar
  4. 4.
    Barik, R., Sarkar, V.: Enhanced bitwidth-aware register allocation. In: Mycroft, A., Zeller, A. (eds.) CC 2006. LNCS, vol. 3923, pp. 263–276. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Blanchet, B., Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Monniaux, D., Rival, X.: A static analyzer for large safety-critical software. In: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI 2003), San Diego, California, USA, June 7-14, pp. 196–207. ACM Press, New York (2003)CrossRefGoogle Scholar
  6. 6.
    Bodík, R., Gupta, R., Sarkar, V.: ABCD: Eliminating Array Bounds Checks on Demand. In: PLDI 2000, pp. 321–333. ACM Press, New York (2000)Google Scholar
  7. 7.
    Briggs, P., Cooper, K., Simpson, T.L.: Value numbering. Software Practice and Experience 27(6), 701–724 (1997)CrossRefGoogle Scholar
  8. 8.
    Charles, P., Donawa, C., Ebcioglu, K., Grothoff, C., Kielstra, A., von Praun, C., Saraswat, V., Sarkar, V.: X10: An object-oriented approach to non-uniform cluster computing. In: OOPSLA 2005 Onward! Track (2005)Google Scholar
  9. 9.
    Chauhan, A., McCosh, C., Kennedy, K., Hanson, R.: Automatic type-driven library generation for telescoping languages. In: Supsercomputing 2003, Washington, DC (2003)Google Scholar
  10. 10.
    Dillig, I., Dillig, T., Aiken, A.: Fluid updates: Beyond strong vs. Weak updates. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 246–266. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  11. 11.
    Fletcher, M., McCosh, C., Jin, G., Kennedy, K.: Compiling Parallel Matlab for General Distributions Using Telescoping Languages. In: ICASSP: Proceedings of the 2007 International Conference on Acoustics, Speech and Signal Processing, Honolulu, Hawai’i, USA (2007)Google Scholar
  12. 12.
    Grandy, J.: Efficient computation of volume of hexahedral cells. Technical Report UCRL-ID-128886, Lawrence Livermore National Laboratory (October 1997)Google Scholar
  13. 13.
    Gupta, R.: Optimizing array bound checks using flow analysis. ACM Lett. Program. Lang. Syst. 2(1-4), 135–150 (1993)CrossRefGoogle Scholar
  14. 14.
    Heffner, K., Tarditi, D., Smith, M.D.: Extending object-oriented optimizations for concurrent programs. In: PACT 2007: Proceedings of the 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007), pp. 119–129 (2007)Google Scholar
  15. 15.
    Ishizaki, K., et al.: Design, implementation, and evaluation of optimizations in a just-in-time compiler. In: Proceedings of the ACM 1999 Conference on Java Grande, pp. 119–128 (1999)Google Scholar
  16. 16.
    The Java Grande forum benchmark suite, http://www.epcc.ed.ac.uk/javagrande
  17. 17.
    Joyner, M., Budimlić, Z., Sarkar, V.: Optimizing array accesses in high productivity languages. In: Proceedings of the High Performance Computation Conference (HPCC), Houston, Texas (September 2007)Google Scholar
  18. 18.
    Joyner, M., Budimlić, Z., Sarkar, V., Zhang, R.: Array optimizations for parallel implementations of high productivity languages. In: Workshop on Performance Optimization for High-Level Languages and Libraries (POHLL), Miami, Florida (April 2008)Google Scholar
  19. 19.
    Mateev, N., Pingali, K., Stodghill, P., Kotlyar, V.: Next-generation generic programming and its application to sparse matrix computations. In: ICS 2000: Proceedings of the 14th International Conference on Supercomputing, pp. 88–99 (2000)Google Scholar
  20. 20.
    McCosh, C.: Type-Based Specialization in a Telescoping Compiler for ARPACK. Master’s thesis, Rice University, Houston, Texas (2002)Google Scholar
  21. 21.
    Pechtchanski, I., Sarkar, V.: Dynamic optimistic interprocedural analysis: a framework and an application. In: Proceedings of the 16th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 2001, pp. 195–210. ACM, New York (2001)CrossRefGoogle Scholar
  22. 22.
    Rose, L.D., Padua, D.: Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst. 21(2), 286–323 (1999)CrossRefGoogle Scholar
  23. 23.
    Sagiv, M., Reps, T., Horwitz, S.: Precise interprocedural dataflow analysis with applications to constant propagation. Theor. Comput. Sci. 167(1-2), 131–170 (1996)MathSciNetCrossRefzbMATHGoogle Scholar
  24. 24.
    Snyder, L.: A Programmer’s Guide to ZPL. MIT Press, Cambridge (1999)Google Scholar
  25. 25.
    Sundaresan, V., et al.: Experiences with multi-threading and dynamic class loading in a java just-in-time compiler. In: CGO 2006, Washington, DC, USA, pp. 87–97 (2006)Google Scholar
  26. 26.
    Suzuki, N., Ishihata, K.: Implementation of an Array Bound Checker. In: POPL 1977, pp. 132–143 (1977)Google Scholar
  27. 27.
    Triolet, R., Irigoin, F., Feautrier, P.: Direct parallelization of call statements. SIGPLAN Not. 21, 176–185 (1986)CrossRefzbMATHGoogle Scholar
  28. 28.
    Wegman, M.N., Zadeck, F.K.: Constant propagation with conditional branches. ACM Trans. Program. Lang. Syst. 13(2), 181–210 (1991)CrossRefGoogle Scholar
  29. 29.
    Yelick, K., et al.: Titanium: A High-Performance Java Dialect. Concurrency: Practice and Experience 10(11) (September 1998)Google Scholar
  30. 30.
    Zhao, Y., Kennedy, K.: Scalarizing Fortran 90 Array Syntax. Technical Report TR01-373, Department of Computer Science, Rice University (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Mackale Joyner
    • 1
  • Zoran Budimlić
    • 2
  • Vivek Sarkar
    • 2
  1. 1.Texas InstrumentsDallasUSA
  2. 2.Rice UniversityHoustonUSA

Personalised recommendations