Skip to main content

An Effective Automated Approach to Specialization of Code

  • Conference paper
Languages and Compilers for Parallel Computing (LCPC 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5234))

Abstract

Application performance is heavily dependent on the compiler optimizations. Modern compilers rely largely on the information made available to them at the time of compilation. In this regard, specializing the code according to input values is an effective way to communicate necessary information to the compiler.

However, the static specialization suffers from possible code explosion and dynamic specialization requires runtime compilation activities that may degrade the overall performance of the application.

This article proposes an automated approach for specializing code that is able to address both the problems of code size increase and the overhead of runtime activities. We first obtain optimized code through specialization performed at static compile time and then generate a template that can work for a large set of values through runtime specialization.

Our experiments show significant improvement for different SPEC benchmarks on Itanium-II(IA-64) and Pentium-IV processors using icc and gcc compilers.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Poletto, M., Hsieh, W.C., Engler, D.R., Kaashoek, F.M.: ’C and tcc: A language and compiler for dynamic code generation. ACM Transactions on Programming Languages and Systems 21, 324–369 (1999)

    Article  Google Scholar 

  2. Grant, B., Mock, M., Philipose, M., Chambers, C., Eggers, S.J.: DyC: An expressive annotation-directed dynamic compiler for C. Technical report, Department of Computer Science and Engineering, University of Washington (1999)

    Google Scholar 

  3. Leone, M., Lee, P.: Optimizing ml with run-time code generation. Technical report, School of Computer Science, Carnegie Mellon University (1995)

    Google Scholar 

  4. Khan, M.A., Charles, H.P.: Applying code specialization to FFT libraries for integral parameters. In: 19th Intl. Workshop on Languages and Compilers for Parallel Computing, New Orleans, Louisiana, November 2-4 (2006)

    Google Scholar 

  5. Khan, M.A., Charles, H.P., Barthou, D.: Reducing code size explosion through low-overhead specialization. In: Proceeding of the 11th Annual Workshop on the Interaction between Compilers and Computer Architecture, Phoenix (2007)

    Google Scholar 

  6. Consel, C., Hornof, L., Marlet, R., Muller, G., Thibault, S., Volanschi, E.N.: Tempo: Specializing Systems Applications and Beyond. ACM Computing Surveys 30(3es) (1998)

    Google Scholar 

  7. Consel, C., Hornof, L., Noël, F., Noyé, J., Volanschi, N.: A uniform approach for compile-time and run-time specialization. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Partial Evaluation, Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 54–72. Springer, Heidelberg (1996)

    Google Scholar 

  8. SPEC: SPEC Benhmarks: SPEC (2000), http://www.spec.org/cpu2000/

  9. Calder, B., Feller, P., Eustace, A.: Value profiling. In: International Symposium on Microarchitecture, pp. 259–269 (1997)

    Google Scholar 

  10. Makholm, H.: Specializing C— An introduction to the principles behind C-Mix. Technical report, Computer Science Department, University of Copenhagen (1999)

    Google Scholar 

  11. Engler, D.R., Proebsting, T.A.: DCG: An efficient, retargetable dynamic code generation system. In: Proceedings of Sixth International Conf. on Architectural Support for Programming Languages and Operating Systems, California (1994)

    Google Scholar 

  12. Leone, M., Lee, P.: Dynamic Specialization in the Fabius System. ACM Computing Surveys 30(3es) (1998)

    Google Scholar 

  13. Bala, V., Duesterwald, E., Banerjia, S.: Dynamo: a transparent dynamic optimization system. ACM SIGPLAN Notices 35(5), 1–12 (2000)

    Article  Google Scholar 

  14. Lu, J., Chen, H., Yew, P.C., Hsu, W.C.: Design and Implementation of a Lightweight Dynamic Optimization System. Journal of Instruction-Level Parallelism 6 (2004)

    Google Scholar 

  15. Donadio, S., Brodman, J., Roeder, T., Yotov, K., Barthou, D., Cohen, A., Garzaran, M., Padua, D., Pingali, K.: A language for the comParallel Architectures and Compilation Techniques representation of multiple program versions. In: Ayguadé, E., Baumgartner, G., Ramanujam, J., Sadayappan, P. (eds.) LCPC 2005. LNCS, vol. 4339. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Vikram Adve María Jesús Garzarán Paul Petersen

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Khan, M.A., Charles, H.P., Barthou, D. (2008). An Effective Automated Approach to Specialization of Code. In: Adve, V., Garzarán, M.J., Petersen, P. (eds) Languages and Compilers for Parallel Computing. LCPC 2007. Lecture Notes in Computer Science, vol 5234. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-85261-2_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-85261-2_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-85260-5

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics