<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 8, 2016 at 10:14 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Feb 8, 2016, at 10:10 AM, Justin Bogner <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br>
><br>
> Mehdi AMINI <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>> writes:<br>
>> joker.eph added a subscriber: joker.eph.<br>
>> joker.eph added a comment.<br>
><br>
> Please keep patch review on-list. It seems whatever phabricator feature<br>
> this is just sends personal emails in a new thread with no patch<br>
> context. I've dug up the original thread and restored the context.<br>
<br>
</span>Good point...<br>
<span class=""><br>
><br>
>> Could we support a string flag instead of a boolean? (I don't know if<br>
>> CMake options can be enums)<br>
>> The clang "-flto" accepts both "full" and "thin" as an argument, and<br>
>> it would be nice to support it first class in the configuration.<br>
><br>
> This seems reasonable, but it would have to allow/use by default the<br>
> form without an '=' so that this can be used with gcc as well.<br>
<br>
</span>Good point (as well)!<br>
<span class=""><br>
> I'm thinking something like -DLLVM_LTO_MODE={off,on,full,thin}. WDYT?<br></span></blockquote><div><br></div><div>That sounds good to me. It is similar to the driver option which maps -flto to -flto=full.</div><div><br></div><div>Thanks,</div><div>Teresa</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>I don't have a better idea :)<br>
<br>
CC Teresa who may have an opinion as she added the -flto=thin to clang.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mehdi<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> Justin Bogner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> writes:<br>
>> Author: bogner<br>
>> Date: Thu Feb  4 01:28:30 2016<br>
>> New Revision: 259766<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=259766&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=259766&view=rev</a><br>
>> Log:<br>
>> cmake: Add a flag to enable LTO<br>
>><br>
>> This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually<br>
>> add -flto to the various _FLAGS variables.<br>
>><br>
>> Modified:<br>
>>    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake<br>
>>    llvm/trunk/docs/CMake.rst<br>
>><br>
>> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=259766&r1=259765&r2=259766&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=259766&r1=259765&r2=259766&view=diff</a><br>
>> ==============================================================================<br>
>> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)<br>
>> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu Feb  4 01:28:30 2016<br>
>> @@ -656,6 +656,13 @@ append_if(LLVM_BUILD_INSTRUMENTED "-fpro<br>
>>   CMAKE_EXE_LINKER_FLAGS<br>
>>   CMAKE_SHARED_LINKER_FLAGS)<br>
>><br>
>> +option(LLVM_ENABLE_LTO "Enable link-time optimization" OFF)<br>
>> +append_if(LLVM_ENABLE_LTO "-flto"<br>
>> +  CMAKE_CXX_FLAGS<br>
>> +  CMAKE_C_FLAGS<br>
>> +  CMAKE_EXE_LINKER_FLAGS<br>
>> +  CMAKE_SHARED_LINKER_FLAGS)<br>
>> +<br>
>> # Plugin support<br>
>> # FIXME: Make this configurable.<br>
>> if(WIN32 OR CYGWIN)<br>
>><br>
>> Modified: llvm/trunk/docs/CMake.rst<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=259766&r1=259765&r2=259766&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=259766&r1=259765&r2=259766&view=diff</a><br>
>> ==============================================================================<br>
>> --- llvm/trunk/docs/CMake.rst (original)<br>
>> +++ llvm/trunk/docs/CMake.rst Thu Feb  4 01:28:30 2016<br>
>> @@ -347,6 +347,10 @@ LLVM-specific variables<br>
>>   are ``Address``, ``Memory``, ``MemoryWithOrigins``, ``Undefined``, ``Thread``,<br>
>>   and ``Address;Undefined``. Defaults to empty string.<br>
>><br>
>> +**LLVM_ENABLE_LTO**:BOOL<br>
>> +  Add the ``-flto`` flag to the compile and link command lines,<br>
>> +  enabling link-time optimization. Defaults to OFF.<br>
>> +<br>
>> **LLVM_PARALLEL_COMPILE_JOBS**:STRING<br>
>>   Define the maximum number of concurrent compilation jobs.<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>