Litcius/Paper detail

Exploring the space of optimization sequences for code-size reduction: insights and tools

Anderson Faustino da Silva, Bernardo N. B. de Lima, Fernando Magno Quintão Pereira

202128 citationsDOI

Abstract

The optimization space of a compiler is the set of every possible sequence of optimizations that said compiler can use. The exploration of the optimization space of any mainstream compiler has been, for decades, hampered by the lack of benchmarks. However, recent efforts from different research groups have made available a large quantity of compilable code that can be, today, used to overcome this problem. In this paper, we use 15,000 programs from a public collection to explore the optimization space of LLVM, focusing on code-size reduction. This exploration reveals that the probability of beating the default optimization levels of LLVM with random sequences ranges from 10% (considering opt -Oz) to 19% (considering clang -Os). Yet, the distribution of probabilities is uneven across programs: the default levels work well for most programs, and poorly for a few. Based on these observations, we introduce the notion of an Optimization Cache, a table of programs to optimization sequences that can be used to support predictive compilation. We then use an optimization cache to build what we call a Default Covering Set: a small ensemble of optimization sequences that, once combined, tend to be good for any program. Optimization caches and default covering sets are used independently. The former, when applied onto MiBench, yield programs that are 11.9% smaller than programs produced by opt -Os, on average. The latter produce programs 12.5% smaller.

Topics & Concepts

Computer scienceCompilerCacheOptimizing compilerParallel computingProgram optimizationSet (abstract data type)Code (set theory)Reduction (mathematics)Optimization problemSpace (punctuation)Programming languageAlgorithmOperating systemMathematicsGeometryParallel Computing and Optimization TechniquesSoftware Engineering ResearchLogic, programming, and type systems
Exploring the space of optimization sequences for code-size reduction: insights and tools | Litcius