[PATCH] D18667: ELF: Add flag for controlling LTO optimization level.

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 13:22:46 PDT 2016


> On Mar 31, 2016, at 1:17 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> On 31 March 2016 at 16:12, Mehdi AMINI <mehdi.amini at apple.com> wrote:
>> joker.eph added a comment.
>> 
>> Slightly off-topic: ld64 does not have this option, and we're not willing to add it. We have been discussing internally about how to communicate the "opt level" to the linker plugin, and we were thinking about some kind of metadata that would carry the configuration (including things like "fast-math" or other codegen related options).
>> I'm interested in your opinion :)
> 
> I see it as simple tool for doing experiments. What is the rationale
> for avoiding the option?

Yes for doing experiment it is fine (ld64 would support it with a -mllvm option I believe). 
The rationale is to support:

clang -O2 -flto *.cpp -o out
vs
clang -O3 -flto *.cpp -o out

At this point the optimizations will always be "O2"-like in both cases.

-- 
Mehdi



More information about the llvm-commits mailing list