Skip to main content

Part of the book series: Embedded Systems ((EMSY))

  • 1171 Accesses

Abstract

The manual generation of heuristics for compiler optimizations is a tedious task which requires both a high amount of expertise and an extensive trial-and-error tuning. The consequence is that many optimizations operate inefficiently. In this chapter, an automatic generation of machine learning based (MLB) heuristics for WCET-aware compiler optimizations is presented. A feasibility study for the generation of WCET-aware heuristics for the source code optimization function inlining is presented. Moreover, this chapter shows that on the one hand MLB WCET-aware heuristics can also be easily constructed at other abstraction levels of the code, namely at assembly level as demonstrated for the optimization loop-invariant code motion. On the other hand, this chapter indicates that an automatic selection of appropriate machine learning algorithms and their parameters can significantly improve the performance of the generated heuristics. To demonstrate the effectiveness of the MLB heuristics, evaluations on real-life benchmarks were performed, showing that the novel heuristics outperform traditional, hand-crafted heuristics.

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 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 169.99
Price excludes VAT (USA)
  • Durable hardcover 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

References

  1. A.V. Aho, R. Sethi, J.D. Ullman, Compilers: Principles, Techniques, and Tools (Addison-Wesley/Longman, Boston, 1986)

    Google Scholar 

  2. A.W. Appel, Modern Compiler Implementation in C (Cambridge University Press, New York, 1997)

    Book  MATH  Google Scholar 

  3. D.F. Bacon, S.L. Graham, O.J. Sharp, Compiler transformations for high-performance computing. ACM Comput. Surv. 26(4), 345–420 (1994)

    Article  Google Scholar 

  4. C.M. Bishop, Pattern Recognition and Machine Learning (Springer, Berlin, 2008)

    Google Scholar 

  5. P. Brazdil, C. Giraud-Carrier, C. Soares, R. Vilalta, Metalearning: Applications to Data Mining (Springer, Berlin, 2009)

    MATH  Google Scholar 

  6. L. Breiman, Random forests. Mach. Learn. 45(1), 5–32 (2001)

    Article  MATH  Google Scholar 

  7. B. Calder, D. Grunwald, M. Jones et al., Evidence-based static branch prediction using machine learning. ACM Trans. Program. Lang. Syst. 19(1), 188–222 (1997)

    Article  Google Scholar 

  8. J. Cavazos, J.E.B. Moss, Inducing heuristics to decide whether to schedule. SIGPLAN Not. 39(6), 183–194 (2004)

    Article  Google Scholar 

  9. J. Cavazos, M. O’Boyle, Method-specific dynamic compilation using logistic regression, in Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications (OOPSLA), Portland, USA, October 2006, pp. 229–240

    Google Scholar 

  10. J. Cavazos, M. O’Boyle, Automatic tuning of inlining heuristics, in Proceedings of the ACM/IEEE Conference on Supercomputing (SC), Seattle, USA, November 2005, pp. 14–25

    Google Scholar 

  11. K.D. Cooper, L. Torczon, Engineering A Compiler (Morgan Kaufmann, San Francisco, 2004)

    Google Scholar 

  12. K.D. Cooper, M.W. Hall, L. Torczon, An experiment with inline substitution. Softw. Pract. Exp. 21(6), 581–601 (1991)

    Article  Google Scholar 

  13. J.W. Davidson, A.M. Holler, Subprogram inlining: a study of its effects on program execution time. Technical report, University of Virginia, Charlottesville, USA, 1989

    Google Scholar 

  14. M. Guthaus, J. Ringenberg, D. Ernst et al., MiBench: a free, commercially representative embedded benchmark suite, in Proceedings of the 4th IEEE International Workshop on Workload Characteristics (WWC), Austin, USA, December 2001, pp. 3–14

    Google Scholar 

  15. M. Haneda, P. Knijnenburg, H. Wijshoff, Automatic selection of compiler options using non-parametric inferential statistics, in Proceedings of the 14th International Conference on Parallel Architectures and Compilation Techniques (PACT), Saint Louis, USA, September 2005, pp. 123–132

    Google Scholar 

  16. J.H. Holland, Adaptation in Natural and Artificial Systems (MIT Press, Cambridge, 1992)

    Google Scholar 

  17. H. Leather, E. Bonilla, M. O’Boyle, Automatic feature generation for machine learning based optimizing compilation, in Proceedings of the International Symposium on Code Generation and Optimization (CGO), Seattle, USA, March 2009, pp. 81–91

    Google Scholar 

  18. C. Lee, M. Potkonjak, W.H. Mangione-Smith, MediaBench: a tool for evaluating and synthesizing multimedia and communications systems, in Proceedings of the 30th Annual International Symposium on Microarchitecture (MICRO), Research Triangle Park, USA, December 1997, pp. 330–335

    Google Scholar 

  19. P. Lokuciejewski, F. Gedikli, P. Marwedel, K. Morik, Automatic WCET reduction by machine learning based heuristics for function inlining, in Proceedings of the 3rd Workshop on Statistical and Machine Learning Approaches to Architecture and Compilation (SMART), Paphos, Cyprus, January 2009, pp. 1–15

    Google Scholar 

  20. P. Lokuciejewski, M. Stolpe, K. Morik, P. Marwedel, Automatic selection of machine learning models for WCET-aware compiler heuristic generation, in Proceedings of the 4th Workshop on Statistical and Machine Learning Approaches to Architecture and Compilation (SMART), Pisa, Italy, January 2010, pp. 3–17

    Google Scholar 

  21. Mälardalen WCET Research Group. WCET Benchmarks, http://www.mrtc.mdh.se/projects/wcet, March 2010

  22. A. McGovern, J.E.B. Moss, Scheduling straight-line code using reinforcement learning and rollouts, in Proceedings of the Conference on Advances in Neural Information Processing Systems (NIPS), Denver, USA, November 1999, pp. 903–909

    Google Scholar 

  23. G. Memik, W.H. Mangione-Smith, W. Hu, NetBench: a benchmarking suite for network processors, in Proceedings of the International Conference on Computer-Aided Design (ICCAD), San Jose, USA, November 2001, pp. 39–42

    Google Scholar 

  24. I. Mierswa, Non-convex and multi-objective optimization in data mining, PhD thesis, TU Dortmund University, 2008

    Google Scholar 

  25. I. Mierswa, M. Wurst, R. Klinkenberg et al., YALE: rapid prototyping for complex data mining tasks, in Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), Philadelphia, USA, August 2006, pp. 935–940

    Google Scholar 

  26. A. Monsifrot, F. Bodin, R. Quiniou, A machine learning approach to automatic production of compiler heuristics, in Proceedings of the 10th International Conference on Artificial Intelligence: Methodology, Systems, and Applications (AIMSA), Varna, Bulgaria, September 2002, pp. 41–50

    Google Scholar 

  27. S.S. Muchnick, Advanced Compiler Design and Implementation (Morgan Kaufmann, San Francisco, 1997)

    Google Scholar 

  28. T. Russell, A.M. Malik, M. Chase et al., Learning heuristics for the superblock instruction scheduling problem. IEEE Trans. Knowl. Data Eng. 21(10), 1489–1502 (2009)

    Article  Google Scholar 

  29. Y.N. Srikant, P. Shankar, The Compiler Design Handbook: Optimizations and Machine Code Generation, 2nd edn. (CRC Press, Boca Raton, 2007)

    Book  Google Scholar 

  30. M. Stephenson, S. Amarasinghe, Predicting unroll factors using supervised classification, in Proceedings of the International Symposium on Code Generation and Optimization (CGO), San Jose, USA, March 2005, pp. 123–134

    Google Scholar 

  31. M. Stephenson, S. Amarasinghe, M. Martin, U.M. O’Reilly, Meta optimization: improving compiler heuristics with machine learning. SIGPLAN Not. 38(5), 77–90 (2003)

    Article  Google Scholar 

  32. UTDSP Benchmark Suite. http://www.eecg.toronto.edu/~corinna/DSP/infrastructure/UTDSP.html, March 2010

  33. K. Vaswani, M.J. Thazhuthaveetil, Y. Srikant et al., Microarchitecture sensitive empirical models for compiler optimizations, in Proceedings of the International Symposium on Code Generation and Optimization (CGO), San Jose, USA, March 2007, pp. 131–143

    Google Scholar 

  34. V. Zivojnović, J. Martínez Velarde, C. Schläger et al., DSPstone: a DSP-oriented benchmarking methodology, in Proceedings of the International Conference on Signal Processing and Technology (ICSPAT), Dallas, USA, January 1994, pp. 715–720

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul Lokuciejewski .

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer Science+Business Media B.V.

About this chapter

Cite this chapter

Lokuciejewski, P., Marwedel, P. (2011). Machine Learning Techniques in Compiler Design. In: Worst-Case Execution Time Aware Compilation Techniques for Real-Time Systems. Embedded Systems. Springer, Dordrecht. https://doi.org/10.1007/978-90-481-9929-7_6

Download citation

  • DOI: https://doi.org/10.1007/978-90-481-9929-7_6

  • Publisher Name: Springer, Dordrecht

  • Print ISBN: 978-90-481-9928-0

  • Online ISBN: 978-90-481-9929-7

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics