Advertisement

An analysis of executable size reduction by LLVM passes

  • Shalini Jain
  • Utpal Bora
  • Prateek Kumar
  • Vaibhav B. Sinha
  • Suresh Purini
  • Ramakrishna UpadrastaEmail author
S.I. : Visvesvaraya
  • 6 Downloads

Abstract

The formidable increase in the number of smaller and smarter embedded devices has compelled programmers to develop more and more specialized application programs for these systems. These resource intensive programs that have to be executed on limited memory systems make a strong case for compiler optimizations that reduce the executable size of programs. Standard compilers (like LLVM) offer an out-of-the-box -Oz optimization option—just a series of compiler optimization passes—that is specifically targeted for the reduction of the generated executable size. In this paper, we aim to analyze the effects of optimizations of LLVM compiler on the reduction of executable size. Specifically, we take the size of the executable as a metric and attempt to divide the -Oz series into logical groups and study their individual effects; while also study the effect of their combinations. Our preliminary study over SPEC CPU 2017 benchmarks gives us an insight into the comparative effect of the groups of passes on the executable size. Our work has potential to enable the user to tailor a custom series of passes so as to obtain the desired executable size.

Keywords

Compilers Compiler optimizations Code size optimizations 

Notes

Acknowledgements

This work has been partially supported by the Project under The Visvesvaraya Ph.D. Scheme of Ministry of Electronics & Information Technology, Government of India, being implemented by Digital India Corporation (formerly Media Lab Asia). The work was also enabled by travels funded by The LLVM Foundation. The fellowship has helped in publishing research contributions in [3, 4, 5, 6].

Funding

Funding was provided by Department of Electronics and Information Technology, Ministry of Communications and Information Technology.

References

  1. 1.
    Lattner C, Adve V (2004) LLVM: a compilation framework for lifelong program analysis and transformation. In: Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization (CGO ’04). IEEE Computer Society, Washington, p 75Google Scholar
  2. 2.
  3. 3.
    Dangeti TK, Bora U, Das S, Grosser T, Upadrasta R (2017) Improved loop distribution in LLVM using polyhedral dependences. In: The fourth workshop on the LLVM compiler infrastructure in HPC. https://llvm-hpc4-workshop.github.io/
  4. 4.
    Jain S, Kumar K, Purini S, Das D, Upadrasta R (2017) An LLVM based loop profiler. US LLVM Developers’ meeting. https://llvm.org/devmtg/2017-10/
  5. 5.
    Bora U, Grosser T, Upadrasta R (2016) PolyhedralInfo: polly as an analysis pass in LLVM. Google Summer of Code 2016 and Poster+Lightning Talk, US LLVM Developers’ meetingGoogle Scholar
  6. 6.
    Bhatu Pratik (2015) Compile-time optimizations in polly. Google Summer of Code. https://www.googlemelange.com/archive/gsoc/2015/orgs/llvm/projects/bhatuzdaname.html

Copyright information

© CSI Publications 2019

Authors and Affiliations

  1. 1.Computer Science and EngineeringIndian Institute of TechnologyHyderabadIndia
  2. 2.Computer Science and EngineeringInternational Institute of Information TechnologyHyderabadIndia

Personalised recommendations