z-logo
open-access-imgOpen Access
Mutual Inlining: An Inlining Algorithm to Reduce the Executable Size
Author(s) -
Yosi Ben-Asher,
Nidal Faour,
Ofer Shinaar
Publication year - 2022
Language(s) - English
Resource type - Conference proceedings
DOI - 10.5121/csit.2022.120601
Subject(s) - computer science , executable , compiler , call graph , graph , parallel computing , code (set theory) , programming language , optimizing compiler , algorithm , operating system , theoretical computer science , set (abstract data type)
We consider the problem of selecting an optimized subset of inlinings (replacing a call to a function by its body) that minimize the resulting code size. Frequently, in embedded systems, the program’s executable file size must fit into a small size memory. In such cases, the compiler should generate as small as possible executables. In particular, we seek to improve the code size obtained by the LLVM inliner executed with the -Oz option. One important aspect is whether or not this problem requires a global solution that considers the full span of the call graph or a local solution (as is the case with the LLVM inliner) that decides whether to apply inlining to each call separately based on the expected code-size improvement. We have implemented a global type of inlining algorithm called Mutual Inlining that selects the next call-site (f()callsg() to be inline based on its global properties. The first property is the number of calls to g(). Next property is determining if inlining g() to f() may prevent inlining other more beneficial neighboring callsites. Finaly repeated inlining iterations over the call graph are performed until there are no more beneficial inlinings to perform. Hence, considering the effect of previously made inlinings on the next call-site to be inline. Our results show small but consistant improvement compare to LLVM’s Oz.

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here