comparing -O5 to -std-compile-opts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

comparing -O5 to -std-compile-opts

Ryan M. Lefever
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

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?

Thanks,
Ryan


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: comparing -O5 to -std-compile-opts

Chris Lattner
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/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev