Skip to main content

An analysis of executable size reduction by LLVM passes


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, access via your institution.

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


  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.

  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.

  4. 4.

    Jain S, Kumar K, Purini S, Das D, Upadrasta R (2017) An LLVM based loop profiler. US LLVM Developers’ meeting.

  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.

Download references


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 was provided by Department of Electronics and Information Technology, Ministry of Communications and Information Technology.

Author information



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).

Download citation


  • Compilers
  • Compiler optimizations
  • Code size optimizations