[LLVMdev] -Os

David Chisnall David.Chisnall at cl.cam.ac.uk
Sat Feb 23 11:06:13 PST 2013


On 23 Feb 2013, at 18:54, Reed Kotler <rkotler at mips.com> wrote:

> Hmmm. You don't remember which tweaks you tried?


I don't, I'm afraid.  I more or less just ran opt with vaguely sensible sounding combinations of passes to find the smallest one.  Eventually we just removed some features from the bootloader to make it fit.  One of the things on my to-do-eventually list if to set up a simulated annealing run to try permuting optimisation combinations and then running some benchmarks on size and speed to see if we can improve the default set.

> At one of the BOFS during the llvm conference a few years back, one of the Apple managers stated in effect that their view of -Os was to get some modest savings but only if performance has near 0 impact.

I think that's sensible.  This is why (in theory, at least) -Oz exists: for when you want to optimise for size, even at the expense of speed.  In PassManagerBuilder, it's a controlled by the size factor.  The interface at that level allows you to have quite fine granularity over your choice to the performance / size tradeoff, but the current implementation doesn't do much with the size parameter.  

David





More information about the llvm-dev mailing list