[LLVMdev] -Os

David Chisnall David.Chisnall at cl.cam.ac.uk
Sat Feb 23 04:28:06 PST 2013


Hi Reed,

-Os could do with some love.  It is more or less the same set of passes as -O2, but with a few things that are most likely to increase code size removed.  We have had problems with it in the past for FreeBSD's bootloader.  By tweaking the set of default passes added for -Os, I got the size down by about 20%, but I didn't have time to evaluate whether this was a general saving or just for this specific case.  If you have customers who value size optimisations, then it would be worth looking in lib/Transforms/IPO/PassManagerBuilder.cpp and tweaking things a bit.  I suspect that you can get some quite significant improvements here, but so far it hasn't been a priority for anyone.  Having -Oz working well (currently it comes nowhere near gcc) would be particularly helpful for bootloaders, where there is little or no performance-critical code, but there is a hard limit on the size.  I imagine a lot of embedded MIPS systems have similar constraints.

David

On 23 Feb 2013, at 02:56, reed kotler <rkotler at mips.com> wrote:

> Mips 16 is basically to save space.
> 
> I want to start comparing real benchmarks with llvm and gcc -mips16.
> 
> Does -Os have any meaning currently to clang? llvm?
> 
> What about inlining? Is inlining turned off?
> 
> Tia.
> 
> Reed
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list