An analysis of executable size reduction by LLVM passes

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.

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

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

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 75

  2. 2.

    https://www.spec.org/cpu2017/

  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’ meeting

  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

Download references

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.

Author information

Affiliations

Authors

Corresponding author

Correspondence to Ramakrishna Upadrasta.

Additional information

An earlier version of this work was peer reviewed and selected for presentation at EuroLLVM 2018.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Jain, S., Bora, U., Kumar, P. et al. An analysis of executable size reduction by LLVM passes. CSIT 7, 105–110 (2019). https://doi.org/10.1007/s40012-019-00248-5

Download citation

Keywords

  • Compilers
  • Compiler optimizations
  • Code size optimizations