[LLVMdev] -O4 limitations in llvm/llvm-gcc-4.2 2.5?

Chris Lattner clattner at apple.com
Sat Jan 24 18:01:06 PST 2009


On Jan 24, 2009, at 5:43 PM, Nick Lewycky wrote:
> Jack Howarth wrote:
>>   I've had better luck compiling all of pymol 1.1r2 with
>> -O4 on darwin9. Everythink links and there appears to be
>> no regressions in the resulting code. I take it that LTO
>> in llvm 2.5 is still limited to dead code elimination,
>> correct?
>
> No.
>
> libLTO does the equivalent to opt -internalize -ipsccp -globalopt
> -constmerge -deadargelim -instcombine -inline -prune-eh -globaldce
> -argpromotion -instcombine -jump-threading -scalarrepl - 
> globalsmodref-aa
> -licm -gvn -memcpyopt -dse -instcombine -jump-threading -mem2reg
> -simplifycfg -globaldce

Right.  Note however that LTO is significantly crippled if you don't  
use export controls.  I'd strongly recommend building the code with - 
fvisibility-hidden or using an export map at the final link stage to  
avoid exporting all symbols.  If the optimizer knows a symbol is  
private to the linked image, it can be significantly more aggressive  
with it.

-Chris



More information about the llvm-dev mailing list