[LLVMdev] comparing -O5 to -std-compile-opts

Chris Lattner sabre at nondot.org
Sun Apr 1 00:47:47 PDT 2007


On Sat, 31 Mar 2007, Ryan M. Lefever wrote:
> Let's say I have 2 bytecode files, X.bc and Y.bc that I want to combine
> into Z.bc.  Which of the following command sequences will produce more
> optimized code?
>
> Sequence 1:
>   llvm-link -o tmp.bc X.bc Y.bc
>   opt -std-compile-opts -o Z.bc tmp.bc
>
> Sequence 2:
>   llvm-ld -O5 -o Z.bc X.bc Y.bc

These are very different options. :)

Option #1 runs the "compile time" optimizations again at link time. 
Option #2 runs a different set of optimizations, more tuned for 
link-time-optimization.

> Without looking at details it seems like sequence 2 should produce the
> most optimized code.  As a follow up, where does -std-compile-opts fall
> within -O1 to -O5?

-std-compile-opts is roughly similar to GCC -O3. llvm-ld has no analog to 
GCC.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list