[PATCH][Clang Driver] Driver::IsUsingLTO no longer return true when seeing -emit-llvm

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Aug 22 14:33:13 PDT 2013


> As Eric suggested, I was surprised to discover we have a -emit-llvm flag,
> then more surprised that it didn't bother to pass the right linker flags
> when linking. I think I called it "a broken copy of -flto", arguing that we
> should delete it entirely, in favour of -flto.

We do need a way of getting to the IR as a developer tool. I think
having the driver error on "clang -emit-llvm" without a -c or -S
should make it clear that the option is there for llvm developers.

> As for telling the compiler "I want to build with LTO", we already have -O4
> which is presently equivalent to -O3 -flto. Let's keep that? In the future,
> -O4 should select the pre-IPO optimizations. (I would also like a "-Olto"
> flag specifically so that I can select the pre-IPO optimization stack, even
> if I'm generating native code directly, for debugging and benchmarking and
> also to keep separate the concerns of selecting an optz'n stack and
> selecting the output format.)

I would probably keep -O4 always equivalent to -O3 -flto.

Cheers,
Rafael



More information about the llvm-commits mailing list