<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Peter,<br>
</p>
On 4/6/2018 12:25 PM, Peter Collingbourne wrote:<br>
<blockquote type="cite"
cite="mid:CAPQLkRhH=UW3WshNuEguTphy6pnbjdaH32OsNUBjasRBYZghHQ@mail.gmail.com">
<div dir="auto">
<div>Unfortunately reverting would regress the user that
requested this patch. They use -plugin-opt=O0 and expect
performance consistent with setting cg opt level to default.</div>
</div>
</blockquote>
<br>
Using -O0 with LTO seems like a very odd/uncommon use case. Can the
user use '-mllvm -cg-opt-level=2' as an alternative solution to
override the codegen optimization level used during LTO?<br>
<br>
<blockquote type="cite"
cite="mid:CAPQLkRhH=UW3WshNuEguTphy6pnbjdaH32OsNUBjasRBYZghHQ@mail.gmail.com">
<div dir="auto">
<div>
<div dir="auto"><br>
</div>
<div dir="auto">Instead of reverting can we make a change that
just sets the cg opt level to aggressive if -plugin-opt=O3
is passed?</div>
</div>
</div>
</blockquote>
<br>
I'd prefer not. IMO, this would just further muddy the water. The
'-mllvm -cg-opt-level=2' suggestion seems like a much less intrusive
fix/workaround.<br>
<br>
<blockquote type="cite"
cite="mid:CAPQLkRhH=UW3WshNuEguTphy6pnbjdaH32OsNUBjasRBYZghHQ@mail.gmail.com">
<div dir="auto">
<div>
<div dir="auto"><br>
</div>
<div dir="auto">Peter</div>
<br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, Apr 6, 2018, 09:18 Chad Rosier <<a
href="mailto:mcrosier@codeaurora.org"
moz-do-not-send="true">mcrosier@codeaurora.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks,
Rafael. Sound reasonable to you, Peter?<br>
<br>
<br>
On 4/6/2018 12:12 PM, Rafael Avila de Espindola wrote:<br>
> I am OK with reverting it until we have a better
framework in place.<br>
><br>
> Cheers,<br>
> Rafael<br>
><br>
> Chad Rosier via llvm-commits <<a
href="mailto:llvm-commits@lists.llvm.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">llvm-commits@lists.llvm.org</a>>
writes:<br>
><br>
>> Peter/Rafael,<br>
>><br>
>> Over the past few days I've been investigating
several regressions with<br>
>> our weekly LTO configuration. As a result, I
identified that the<br>
>> following regressions were due to this commit:<br>
>><br>
>> SPEC2006/h264ref: -2.68%<br>
>> SPEC2006/libquantum: -4.36%<br>
>> SPEC2006/perlbench: -2.67%<br>
>> SPEC2017/mcf: -4.47%<br>
>> SPEC2017/perlbench: -3.82%<br>
>><br>
>> I did not test SPEC2000, SPEC2006fp, or
SPEC2017fp, but I'm seeing<br>
>> similar small regressions in our weekly runs
there as well (i.e., the<br>
>> above is just what I was able to test last night,
but isn't likely the<br>
>> only regressions). I'd like to kindly request
that this change be<br>
>> reverted until something is in place to properly
propagate the codegen<br>
>> optimization level.<br>
>><br>
>> Chad<br>
>><br>
>><br>
>> On 2/7/2018 9:41 PM, Peter Collingbourne via
llvm-commits wrote:<br>
>>> Author: pcc<br>
>>> Date: Wed Feb 7 18:41:22 2018<br>
>>> New Revision: 324557<br>
>>><br>
>>> URL: <a
href="http://llvm.org/viewvc/llvm-project?rev=324557&view=rev"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://llvm.org/viewvc/llvm-project?rev=324557&view=rev</a><br>
>>> Log:<br>
>>> gold-plugin: Do not set codegen opt level
based on LTO opt level.<br>
>>><br>
>>> The LTO opt level should not affect the
codegen opt level, and indeed<br>
>>> it does not affect it in lld. Ideally the
codegen opt level should<br>
>>> be controlled by an IR-level attribute based
on the compile-time opt<br>
>>> level, but that hasn't been implemented yet.<br>
>>><br>
>>> Differential Revision: <a
href="https://reviews.llvm.org/D43040" rel="noreferrer
noreferrer" target="_blank" moz-do-not-send="true">https://reviews.llvm.org/D43040</a><br>
>>><br>
>>> Modified:<br>
>>> llvm/trunk/tools/gold/gold-plugin.cpp<br>
>>><br>
>>> Modified:
llvm/trunk/tools/gold/gold-plugin.cpp<br>
>>> URL: <a
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=324557&r1=324556&r2=324557&view=diff"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=324557&r1=324556&r2=324557&view=diff</a><br>
>>>
==============================================================================<br>
>>> --- llvm/trunk/tools/gold/gold-plugin.cpp
(original)<br>
>>> +++ llvm/trunk/tools/gold/gold-plugin.cpp Wed
Feb 7 18:41:22 2018<br>
>>> @@ -727,20 +727,6 @@ static int
getOutputFileName(StringRef I<br>
>>> return FD;<br>
>>> }<br>
>>><br>
>>> -static CodeGenOpt::Level getCGOptLevel() {<br>
>>> - switch (options::OptLevel) {<br>
>>> - case 0:<br>
>>> - return CodeGenOpt::None;<br>
>>> - case 1:<br>
>>> - return CodeGenOpt::Less;<br>
>>> - case 2:<br>
>>> - return CodeGenOpt::Default;<br>
>>> - case 3:<br>
>>> - return CodeGenOpt::Aggressive;<br>
>>> - }<br>
>>> - llvm_unreachable("Invalid optimization
level");<br>
>>> -}<br>
>>> -<br>
>>> /// Parse the thinlto_prefix_replace
option into the \p OldPrefix and<br>
>>> /// \p NewPrefix strings, if it was
specified.<br>
>>> static void
getThinLTOOldAndNewPrefix(std::string &OldPrefix,<br>
>>> @@ -767,7 +753,6 @@ static
std::unique_ptr<LTO> createLTO(In<br>
>>><br>
>>> Conf.MAttrs = MAttrs;<br>
>>> Conf.RelocModel = RelocationModel;<br>
>>> - Conf.CGOptLevel = getCGOptLevel();<br>
>>> Conf.DisableVerify =
options::DisableVerify;<br>
>>> Conf.OptLevel = options::OptLevel;<br>
>>> if (options::Parallelism)<br>
>>><br>
>>><br>
>>>
_______________________________________________<br>
>>> llvm-commits mailing list<br>
>>> <a href="mailto:llvm-commits@lists.llvm.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">llvm-commits@lists.llvm.org</a><br>
>>> <a
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org"
target="_blank" rel="noreferrer" moz-do-not-send="true">llvm-commits@lists.llvm.org</a><br>
>> <a
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>