skip to main content
research-article

Automatic SIMD vectorization for Haskell

Published:25 September 2013Publication History
Skip Abstract Section

Abstract

Expressing algorithms using immutable arrays greatly simplifies the challenges of automatic SIMD vectorization, since several important classes of dependency violations cannot occur. The Haskell programming language provides libraries for programming with immutable arrays, and compiler support for optimizing them to eliminate the overhead of intermediate temporary arrays. We describe an implementation of automatic SIMD vectorization in a Haskell compiler which gives substantial vector speedups for a range of programs written in a natural programming style. We compare performance with that of programs compiled by the Glasgow Haskell Compiler.

References

  1. T. Anderson, N. Glew, P. Guo, B. T. Lewis,W. Liu, Z. Liu, L. Petersen, M. Rajagopalan, J. M. Stichnoth, G. Wu, and D. Zhang. Pillar: A parallel implementation language. In V. Adve, M. J. Garzaran, and P. Petersen, editors, Languages and Compilers for Parallel Computing, pages 141--155. Springer-Verlag, Berlin, Heidelberg, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Appel and T. Jim. Shrinking lambda expressions in linear time. Journal of Functional Programming, 7(5), Sept. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. J. C. Bik. The Software Vectorization Handbook. Intel Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. G. E. Blelloch. Programming parallel algorithms. Communications of the ACM, 39(3):85--97, Mar. 1996. ISSN 0001-0782. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Fluet and S. Weeks. Contification using dominators. In International Conference on Functional Programming, pages 2--13, Florence, Italy, 2001. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Keller, M. M. Chakravarty, R. Leshchinskiy, S. Peyton Jones, and B. Lippmeier. Regular, shape-polymorphic, parallel arrays in Haskell. In International Conference on Functional Programming, pages 261--272, Baltimore, Maryland, USA, 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. K. Kennedy, C. Koelbel, and H. Zima. The rise and fall of High Performance Fortran: an historical object lesson. In History of Programming Languages, pages 1--22. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Leshchinskiy. Recycle your arrays! In Practical Aspects of Declarative Languages, pages 209--223. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. B. Lippmeier and G. Keller. Efficient parallel stencil convolution in haskell. In Haskell Symposium, pages 59--70. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Mainland, R. Leshchinskiy, and S. Peyton Jones. Exploiting Vector Instructions with Generalized Stream Fusion. In International Conference on Functional Programming. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. L. Petersen and N. Glew. GC-safe interprocedural unboxing. In Compiler Construction, pages 165--184, Tallinn, Estonia, 2012. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Peyton Jones. Harnessing the multicores: Nested data parallelism in Haskell. In Asian Symposium on Programming Languages and Systems, pages 138--138, Bangalore, India, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. W. Pugh. A practical algorithm for exact array dependence analysis. Communications of the ACM, 35(8):102--114, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. A. Terei and M. M. Chakravarty. An LLVM backend for GHC. SIGPLAN Notices, 45(11):109--120, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. N. Vasilache, C. Bastoul, A. Cohen, and S. Girbal. Violated dependence analysis. In International Conference on Supercomputing, pages 335--344. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Weeks. Whole-program compilation in MLton. In Workshop on ML, pages 1--1, Portland, Oregon, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automatic SIMD vectorization for Haskell

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 9
      ICFP '13
      September 2013
      457 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2544174
      Issue’s Table of Contents
      • cover image ACM Conferences
        ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
        September 2013
        484 pages
        ISBN:9781450323260
        DOI:10.1145/2500365

      Copyright © 2013 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 September 2013

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!