<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 10:46 AM, Davide Italiano via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br>
Date: Thu Apr 21 12:46:38 2016<br>
New Revision: 267020<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267020&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267020&view=rev</a><br>
Log:<br>
[LTO] Discard names for values that are not global by default.<br>
<br>
Rafael reported on the mailing list that this reduces peak memory<br>
usage while linking llvm-as by 15%. It makes sense to make it<br>
the default, and introduce an inverse knob -lto-no-discard-value-names<br>
for those who want to restore the old behavior.<br>
<br>
Modified:<br>
    lld/trunk/ELF/Driver.cpp<br>
    lld/trunk/ELF/Options.td<br>
    lld/trunk/test/ELF/lto/discard-value-names.ll<br>
    lld/trunk/test/ELF/lto/type-merge2.ll<br>
<br>
Modified: lld/trunk/ELF/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=267020&r1=267019&r2=267020&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=267020&r1=267019&r2=267020&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Driver.cpp (original)<br>
+++ lld/trunk/ELF/Driver.cpp Thu Apr 21 12:46:38 2016<br>
@@ -289,7 +289,7 @@ void LinkerDriver::readConfigs(opt::Inpu<br>
   Config->Demangle = !Args.hasArg(OPT_no_demangle);<br>
   Config->DisableVerify = Args.hasArg(OPT_disable_verify);<br>
   Config->DiscardAll = Args.hasArg(OPT_discard_all);<br>
-  Config->DiscardValueNames = Args.hasArg(OPT_lto_discard_value_names);<br>
+  Config->DiscardValueNames = !Args.hasArg(OPT_lto_no_discard_value_names);<br>
   Config->DiscardLocals = Args.hasArg(OPT_discard_locals);<br>
   Config->DiscardNone = Args.hasArg(OPT_discard_none);<br>
   Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr);<br>
<br>
Modified: lld/trunk/ELF/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=267020&r1=267019&r2=267020&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=267020&r1=267019&r2=267020&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Options.td (original)<br>
+++ lld/trunk/ELF/Options.td Thu Apr 21 12:46:38 2016<br>
@@ -238,7 +238,7 @@ def G : Separate<["-"], "G">;<br>
 def alias_version_script_version_script : Joined<["--"], "version-script=">, Alias<version_script>;<br>
<br>
 // LTO-related options.<br>
-def lto_discard_value_names : Flag<["-"], "lto-discard-value-names">;<br>
+def lto_no_discard_value_names : Flag<["-"], "lto-no-discard-value-names">;<br></blockquote><div><br></div><div>We probably don't want to name flags "-l(something)", as that would conflict with the -l flag. Can you please rename this "--lto-..."?</div><div><br></div><div>(That is, if we want a flag for this at all. Have you considered gating this behavior behind -save-temps instead?)</div><div><br></div><div>Thanks,</div></div><div class="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>