2021 · 28 citations · 18 references
ComputingComputer EngineeringComputer ScienceCompilersOptimizationProgramming LanguagesCode GenerationCompiler ConstructionCache OptimizationCode OptimizationCode Size Optimization
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.
18
MiBench: A free, commercially representative embedded benchmark suite
Matthew R. Guthaus, Jeffrey Ringenberg, Daniel Ernst et al. · 2001 · 3.1K citations
Using Machine Learning to Focus Iterative Optimization
Felix Agakov, Edwin V. Bonilla, José E Cavazos et al. · 2006 · 427 citations
Test-case reduction for C compiler bugs
John Regehr, Yang Chen, Pascal Cuoq et al. · 2012 · 294 citations