[LLVMdev] [OT] GCC specs language and adding options

Devang Patel devang.patel at gmail.com
Fri Sep 18 08:25:01 PDT 2009

On Fri, Sep 18, 2009 at 1:00 AM, Daniel Dunbar <daniel at zuster.org> wrote:
>> The LLVM code is as follows :-
>> "%{O4|emit-llvm|flto:%{S:-emit-llvm} %{!S:-emit-llvm-bc %{c: %W{o*} %{!o*:-o
>> %b%w.o}} %{!c:-o %d%w%u%O}}}"
>> So we have '-O4', '-emit-llvm', and '-flto' equivalent options.
> Yes, although they aren't actually equivalent, they definitely overlap
> a lot. The distinctions are *mostly* pedantic though.

-flto is documented command line options for llvm-gcc users to enable
link time optimization (LTO).

-emit-llvm was added for folks who has write access to llvm svn (IMO
:). -emit-llvm is intentionally not documented in man page. -emit-llvm
is not appropriate name to enable LTO, it does not follow usual gcc
command line naming conversions and it was introduced before LTO.

Yes, internally, -flto and -emit-llvm enables same functionality.

However, -O4 is not same as -flto.  -flto enables link time
optimization but one can use various -Oblah flags to select compile
time options. -O4 means -O3 + -flto. It would be OK to say -Os + -flto
 also, if code size is important.


More information about the llvm-dev mailing list