[lld] r267020 - [LTO] Discard names for values that are not global by default.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 12:20:52 PDT 2016


Ah, so it is discussed here. I'd love to see -save-temps being used instead
of introducing a new flag.

On Thu, Apr 21, 2016 at 11:39 AM, Rafael EspĂ­ndola <
llvm-commits at lists.llvm.org> wrote:

> I like Peter's idea: Lets keep local names only when using -save-temps.
>
> Cheers,
> Rafael
>
>
> On 21 April 2016 at 14:32, Teresa Johnson <tejohnson at google.com> wrote:
>
>>
>>
>> On Thu, Apr 21, 2016 at 11:18 AM, Davide Italiano <davide at freebsd.org>
>> wrote:
>>
>>> On Thu, Apr 21, 2016 at 10:57 AM, Peter Collingbourne <peter at pcc.me.uk>
>>> wrote:
>>> >
>>> >
>>> > On Thu, Apr 21, 2016 at 10:46 AM, Davide Italiano via llvm-commits
>>> > <llvm-commits at lists.llvm.org> wrote:
>>> >>
>>> >> Author: davide
>>> >> Date: Thu Apr 21 12:46:38 2016
>>> >> New Revision: 267020
>>> >>
>>> >> URL: http://llvm.org/viewvc/llvm-project?rev=267020&view=rev
>>> >> Log:
>>> >> [LTO] Discard names for values that are not global by default.
>>> >>
>>> >> Rafael reported on the mailing list that this reduces peak memory
>>> >> usage while linking llvm-as by 15%. It makes sense to make it
>>> >> the default, and introduce an inverse knob -lto-no-discard-value-names
>>> >> for those who want to restore the old behavior.
>>> >>
>>> >> Modified:
>>> >>     lld/trunk/ELF/Driver.cpp
>>> >>     lld/trunk/ELF/Options.td
>>> >>     lld/trunk/test/ELF/lto/discard-value-names.ll
>>> >>     lld/trunk/test/ELF/lto/type-merge2.ll
>>> >>
>>> >> Modified: lld/trunk/ELF/Driver.cpp
>>> >> URL:
>>> >>
>>> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=267020&r1=267019&r2=267020&view=diff
>>> >>
>>> >>
>>> ==============================================================================
>>> >> --- lld/trunk/ELF/Driver.cpp (original)
>>> >> +++ lld/trunk/ELF/Driver.cpp Thu Apr 21 12:46:38 2016
>>> >> @@ -289,7 +289,7 @@ void LinkerDriver::readConfigs(opt::Inpu
>>> >>    Config->Demangle = !Args.hasArg(OPT_no_demangle);
>>> >>    Config->DisableVerify = Args.hasArg(OPT_disable_verify);
>>> >>    Config->DiscardAll = Args.hasArg(OPT_discard_all);
>>> >> -  Config->DiscardValueNames =
>>> Args.hasArg(OPT_lto_discard_value_names);
>>> >> +  Config->DiscardValueNames =
>>> >> !Args.hasArg(OPT_lto_no_discard_value_names);
>>> >>    Config->DiscardLocals = Args.hasArg(OPT_discard_locals);
>>> >>    Config->DiscardNone = Args.hasArg(OPT_discard_none);
>>> >>    Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr);
>>> >>
>>> >> Modified: lld/trunk/ELF/Options.td
>>> >> URL:
>>> >>
>>> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=267020&r1=267019&r2=267020&view=diff
>>> >>
>>> >>
>>> ==============================================================================
>>> >> --- lld/trunk/ELF/Options.td (original)
>>> >> +++ lld/trunk/ELF/Options.td Thu Apr 21 12:46:38 2016
>>> >> @@ -238,7 +238,7 @@ def G : Separate<["-"], "G">;
>>> >>  def alias_version_script_version_script : Joined<["--"],
>>> >> "version-script=">, Alias<version_script>;
>>> >>
>>> >>  // LTO-related options.
>>> >> -def lto_discard_value_names : Flag<["-"], "lto-discard-value-names">;
>>> >> +def lto_no_discard_value_names : Flag<["-"],
>>> >> "lto-no-discard-value-names">;
>>> >
>>> >
>>> > We probably don't want to name flags "-l(something)", as that would
>>> conflict
>>> > with the -l flag. Can you please rename this "--lto-..."?
>>> >
>>> > (That is, if we want a flag for this at all. Have you considered
>>> gating this
>>> > behavior behind -save-temps instead?)
>>> >
>>>
>>> I'm fine with one less flag (and using -save-temps), but I'm cc:ing
>>> the other people involved to hear if they agree.
>>>
>>
>> Interesting idea. When I added this to gold-plugin yesterday morning I
>> also had to add a no- variant so that certain tests would keep working. If
>> lld goes the route of using -save-temps we should consider doing the same
>> for gold-plugin for consistency and flag reduction.
>>
>> Teresa
>>
>>
>>>
>>> --
>>> Davide
>>>
>>> "There are no solved problems; there are only problems that are more
>>> or less solved" -- Henri Poincare
>>>
>>
>>
>>
>> --
>> Teresa Johnson |  Software Engineer |  tejohnson at google.com |
>> 408-460-2413
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160421/856e7bd3/attachment.html>


More information about the llvm-commits mailing list