Skip to main content

Slice-Hoisting for Array-Size Inference in MATLAB

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2958))

Abstract

Inferring variable types precisely is very important to be able to compile MATLAB libraries effectively in the context of the telescoping languages framework being developed at Rice. Past studies have demonstrated the value of type information in optimizing MATLAB [4]. The variable types are inferred through a static approach based on writing propositional constraints on program statements [11]. The static approach has certain limitations with respect to inferring array-sizes. Imprecise inference of array-sizes can have a drastic effect on the performance of the generated code, especially in those cases where arrays are resized dynamically. The impact of appropriate array allocation is also borne out of earlier studies [3]. This paper presents a new approach to inferring array-sizes, called slice-hoisting. The approach is based on simple code transformations and is easy to implement in a practical compiler. Experimental evaluation shows that slice-hoisting, along with the constraints-based static algorithm, can result in a very high level of precision in inferring MATLAB array sizes.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Almási, G., Padua, D.: MaJIC: Compiling MATLAB for speed and responsiveness. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, June 2002, pp. 294–303 (2002)

    Google Scholar 

  2. Chauhan, A., Kennedy, K.: Procedure strength reduction and procedure vectorization: Optimization strategies for telescoping languages. In: Proceedings of ACM-SIGARCH International Conference on Supercomputing (June 2001)

    Google Scholar 

  3. Chauhan, A., Kennedy, K.: Reducing and vectorizing procedures for telescoping languages. International Journal of Parallel Programming 30(4), 289–313 (2002)

    Article  MATH  Google Scholar 

  4. Chauhan, A., McCosh, C., Kennedy, K., Hanson, R.: Automatic type-driven library generation for telescoping language. To appear in the Proceedings of SC: High Performance Networking and Computing Conference (2003)

    Google Scholar 

  5. 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)

    Article  Google Scholar 

  6. De Rose, L., Padua, D.: Techniques for the translation of MATLAB programs into Fortran 90. ACM Transactions on Programming Languages and Systems 21(2), 286–323 (1999)

    Article  Google Scholar 

  7. DeRose, L.A.: Compiler Techniques for Matlab Programs. PhD thesis, University of Illinois at Urbana-Champaign (1996)

    Google Scholar 

  8. Joisha, P.G., Banerjee, P.: Static array storage optimization in MATLAB. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation (June 2003)

    Google Scholar 

  9. Kennedy, K., Broom, B., Cooper, K., Dongarra, J., Fowler, R., Gannon, D., Johnson, L., Mellor-Crummey, J., Torczon, L.: Telescoping Languages: A strategy for automatic generation of scientific problem-solving systems from annotated libraries. Journal of Parallel and Distributed Computing 61(12), 1803–1826 (2001)

    Article  MATH  Google Scholar 

  10. Knobe, K., Sarkar, V.: Array SSA form and its use in parallelization. In: 25th Proceedings of ACM SIGACT-SIGPLAN Symposium on the Principles of Programming Languages (January 1998)

    Google Scholar 

  11. McCosh, C.: Type-based specialization in a telescoping compiler for MATLAB. Master’s thesis, Rice University, Houston, Texas (2002)

    Google Scholar 

  12. Menon, V., Pingali, K.: A case for source level transformations in MATLAB. In: Proceedings of the ACM SIGPLAN / USENIX Conference on Domain Specific Languages (1999)

    Google Scholar 

  13. Sharma, S., Ponnusamy, R., Moon, B., Hwang, Y.-S., Das, R., Saltz, J.: Run-time and compile-time support for adaptive irregular problems. In: Proceedings of SC: High Performance Networking and Computing Conference (November 1994)

    Google Scholar 

  14. Tu, P., Padua, D.A.: Gated SSA-based demand-driven symbolic analysis for parallelizing compilers. In: Proceedings of ACM-SIGARCH International Conference on Supercomputing, pp. 414–423 (1995)

    Google Scholar 

  15. Xi, H., Pfenning, F.: Eliminating array bound checking through dependent types. In: Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, June 1998, pp. 249–257 (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chauhan, A., Kennedy, K. (2004). Slice-Hoisting for Array-Size Inference in MATLAB. In: Rauchwerger, L. (eds) Languages and Compilers for Parallel Computing. LCPC 2003. Lecture Notes in Computer Science, vol 2958. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24644-2_32

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24644-2_32

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-21199-0

  • Online ISBN: 978-3-540-24644-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics