International Journal of Parallel Programming

, Volume 36, Issue 6, pp 592–623 | Cite as

A Compile/Run-time Environment for the Automatic Transformation of Linked List Data Structures

  • H. L. A. van der Spek
  • S. Groot
  • E. M. Bakker
  • H. A. G. Wijshoff
Open Access
Article

Abstract

Irregular access patterns are a major problem for today’s optimizing compilers. In this paper, a novel approach will be presented that enables transformations that were designed for regular loop structures to be applied to linked list data structures. This is achieved by linearizing access to a linked list, after which further data restructuring can be performed. Two subsequent optimization paths will be considered: annihilation and sublimation, which are driven by the occurring regular and irregular access patterns in the applications. These intermediate codes are amenable to traditional compiler optimizations targeting regular loops. In the case of sublimation, a run-time step is involved which takes the access pattern into account and thus generates a data instance specific optimized code. Both approaches are applied to a sparse matrix multiplication algorithm and an iterative solver: preconditioned conjugate gradient. The resulting transformed code is evaluated using the major compilers for the x86 platform, GCC and the Intel C compiler.

Keywords

Optimizing compilers Parallel processing Linked list data structures 

References

  1. 1.
    Bender, M.A., Hu, H.: An adaptive packed-memory array. In: PODS ’06: Proceedings of the Twenty-Fifth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pp. 20–29. ACM Press, New York, NY, USA (2006)Google Scholar
  2. 2.
    Bik, A.J.C. (ed.): Compiler Support for Sparse Matrices, PhD Thesis. Leiden University, The Netherlands (1996)Google Scholar
  3. 3.
    Bik, A.J.C., Knijenburg, P.M.W., Wijshoff, H.A.G.: Reshaping access patterns for generating sparse codes. In: LCPC ’94: Proceedings of the 7th International Workshop on Languages and Compilers for Parallel Computing, pp. 406–420. Springer-Verlag, London, UK (1994)Google Scholar
  4. 4.
    Bik A.J.C., Wijshoff H.A.G.: Advanced compiler optimizations for sparse computations. J. Parallel Distrib. Comput. 31(1), 14–24 (1995)CrossRefGoogle Scholar
  5. 5.
    Bik A.J.C., Wijshoff H.A.G.: Automatic data structure selection and transformation for sparse matrix computations. IEEE Trans. Parallel Distrib. Syst. 7(2), 109–126 (1996)CrossRefGoogle Scholar
  6. 6.
    Chilimbi, T.M., Davidson, B., Larus, J.R.: Cache-conscious structure definition. In: PLDI ’99: Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, pp. 13–24. ACM Press, New York, NY, USA (1999)Google Scholar
  7. 7.
    Chong, S., Rugina, R.: Static analysis of accessed regions in recursive data structures. In: Static Analysis, 10th International Symposium, SAS 2003, pp. 463–482 (2003)Google Scholar
  8. 8.
    Duff, I.S., Grimes, R.G., Lewis, J.G.: Users’ guide for the Harwell-Boeing sparse matrix collection (Release I). Technical Report RAL 92-086, Chilton, Oxon, England (1992)Google Scholar
  9. 9.
    Feldman S.I., Gay D.M., Maimone M.W., Schryer N.L.: A FORTRAN to C converter. SIGPLAN Fortran Forum 9(2), 21–22 (1990)CrossRefGoogle Scholar
  10. 10.
    Ghiya, R.: Putting Pointer Analysis to Work, PhD Thesis. School of Computer Science, McGill University, Montreal, Canada (1998)Google Scholar
  11. 11.
    Ghiya, R., Hendren, L.J.: Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C. In: POPL ’96: Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 1–15. ACM, New York, NY, USA (1996)Google Scholar
  12. 12.
    Ghiya, R., Hendren, L.J., Zhu, Y.: Detecting parallelism in C programs with recursive data structures. In: CC ’98: Proceedings of the 7th International Conference on Compiler Construction, pp. 159–173. Springer-Verlag, London, UK (1998)Google Scholar
  13. 13.
    Golovanevsky, O., Zaks, A.: Struct-reorg: current status and future perspectives. In: Proceedings of the GCC Developers’ Summit, pp. 47–56. http://www.gccsummit.org (2007)
  14. 14.
    Golub, G.H., Van Loan, C.F.: Matrix Computations. Johns Hopkins University Press, Baltimore (1989)MATHGoogle Scholar
  15. 15.
    Groot, S., van der Spek, H.L.A., Bakker, E.M., Wijshoff, H.A.G.: The automatic transformation of linked list data structures (abstract). In: PACT ’07: Proceedings of the 16th Intenational Conference on Parallel Architectures and Compilation Techniques. IEEE Computer Society, Washington, DC, USA (2007)Google Scholar
  16. 16.
    Hagog, M., Tice, C.: Cache aware data layout reorganization optimization in GCC. In: Proceedings of the GCC Developers’ Summit, pp. 69–92. http://www.gccsummit.org (2005)
  17. 17.
    Hummel, J., Hendren, L.J., Nicolau, A.: A general data dependence test for dynamic, pointer-based data structures. In: PLDI ’94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language Design and Implementation, pp. 218–229. ACM Press, New York, NY, USA (1994)Google Scholar
  18. 18.
    Hwang Y.-S., Saltz J.: Interprocedural definition-use chains of dynamic pointer-linked data structures. Sci. Program. 11(1), 3–37 (2003)Google Scholar
  19. 19.
    Karlsson, M., Dahlgren, F., Stenström, P.: A prefetching technique for irregular accesses to linked data structures. In: Proceedings of the Sixth International Symposium on High-Performance Computer Architecture, 8–12 January 2000, Toulouse, France, pp. 206–217. IEEE Computer Society, Washington, DC, USA (2000)Google Scholar
  20. 20.
    Kodukula I., Pingali K.: Data-centric transformations for locality enhancement. Int. J. Parallel Prog. 29(3), 319–364 (2001)MATHCrossRefGoogle Scholar
  21. 21.
    Langella, S., Hastings, S., Oster, S., Kurc, T., Catalyurek, U., Saltz, J.: A distributed data management middleware for data-driven application systems. In: CLUSTER ’04: Proceedings of the 2004 IEEE International Conference on Cluster Computing, Washington, DC, USA, pp. 267–276. IEEE Computer Society (2004)Google Scholar
  22. 22.
    Lattner, C., Adve, V.: Automatic pool allocation for disjoint data structures. In: MSP ’02: Proceedings of the 2002 Workshop on Memory System Performance, pp. 13–24. ACM, New York, NY, USA (2002)Google Scholar
  23. 23.
    Lin, Y., Padua, D.: Compiler analysis of irregular memory accesses. In: PLDI ’00: Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, pp. 157–168. ACM Press, New York, NY, USA (2000)Google Scholar
  24. 24.
    Luk, C.-K., Mowry, T.C.: Compiler-based prefetching for recursive data structures. In: ASPLOS-VII: Proceedings of the Seventh International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 222–233. ACM Press, New York, NY, USA (1996)Google Scholar
  25. 25.
    NIST. Matrix Market. http://math.nist.gov/MatrixMarket (2007)
  26. 26.
    Padua D.A., Wolfe M.J.: Advanced compiler optimizations for supercomputers. Commun. ACM 29(12), 1184–1201 (1986)CrossRefGoogle Scholar
  27. 27.
    Rubin, S., Bernstein, D., Rodeh, M.: Virtual cache line: a new technique to improve cache exploitation for recursive data structures. In: CC ’99: Proceedings of the 8th International Conference on Compiler Construction, Held as Part of the European Joint Conferences on the Theory and Practice of Software, ETAPS’99, pp. 259–273. Springer-Verlag, London, UK (1999)Google Scholar
  28. 28.
    Rugina R., Rinard M.C.: Symbolic bounds analysis of pointers, array indices, and accessed memory regions. ACM Trans. Program. Lang. Syst. 27(2), 185–235 (2005)CrossRefGoogle Scholar
  29. 29.
    Silvius R., Rauchwerger L., Hoeflinger J.: Hybrid analysis: static & dynamic memory reference analysis. Int. J. Parallel Prog. 31(4), 251–283 (2003)MATHCrossRefGoogle Scholar
  30. 30.
    Saltz J.H., Mirchandaney R., Crowley K.: Run-time parallelization and scheduling of loops. IEEE Trans. Comput. 40(5), 603–612 (1991)CrossRefGoogle Scholar
  31. 31.
    Weng, L., Agrawal, G., Catalyurek, U., Kurc, T., Narayanan, S., Saltz, J.: An approach for automatic data virtualization. In: HPDC ’04: Proceedings of the 13th IEEE International Symposium on High Performance Distributed Computing (HPDC ’04) pp. 24–33. IEEE Computer Society, Washington, DC, USA (2004)Google Scholar
  32. 32.
    Wijshoff, H.A.G.: Programming without bothering about data structures? IEEE Comput. Sci. Eng. IEEE Trans. Comput. (3), 67–68 (1996)CrossRefGoogle Scholar
  33. 33.
    Yang, C.-L., Lebeck, A.R.: Push vs. pull: data movement for linked data structures. In: ICS ’00: Proceedings of the 14th International Conference on Supercomputing, pp. 176–186. ACM Press, New York, NY, USA (2000)Google Scholar
  34. 34.
    Zhao, L., Wijshoff, H.A.G.: A case study in automatic data structure selection for optimizing sparse matrix computations. In: Proceedings of the IEEE International Workshop on Advanced Compiler Technology for High Performance and Embedded Systems (IWACT), July 2001, Bucharest, Romania, pp. 22–55. Editura MATRIX ROM (2001)Google Scholar
  35. 35.
    Zhong, Y., Orlovich, M., Shen, X., Ding, C.: Array regrouping and structure splitting using whole-program reference affinity. In: PLDI ’04: Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation, pp. 255–266. ACM Press, New York, NY, USA (2004)Google Scholar

Copyright information

© The Author(s) 2008

Authors and Affiliations

  • H. L. A. van der Spek
    • 1
  • S. Groot
    • 1
  • E. M. Bakker
    • 1
  • H. A. G. Wijshoff
    • 1
  1. 1.LIACS, Leiden UniversityLeidenThe Netherlands

Personalised recommendations