<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 25, 2018 at 7:30 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry, I thought I am responding to D42107 thread :)<br>
In this thread you right. I'll update the patch in a minute.<br></blockquote><div><br></div><div>I assume in D42107 you will change it back to what this patch originally did then (always setting IRName)? To me it is essentially NFC either way, I don't have an issue with the original version of this patch, but will let you and Rafael decide.</div><div>(LGTM in any case, although one suggestion is to add a comment to the declaration of the isPrevailing bool field (i.e. that IR contains the prevailing definition).</div><div>Teresa</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best regards,<br>
George | Developer | Access Softek, Inc<br>
<br>
______________________________<wbr>__________<br>
От: George Rimar<br>
Отправлено: 25 января 2018 г. 18:20<br>
Кому: Rafael Avila de Espindola; <a href="mailto:reviews%2BD42528%2Bpublic%2B221bfc9b60e2bf03@reviews.llvm.org">reviews+D42528+public+<wbr>221bfc9b60e2bf03@reviews.llvm.<wbr>org</a>; <a href="mailto:tejohnson@google.com">tejohnson@google.com</a><br>
Копия: <a href="mailto:joker.eph@gmail.com">joker.eph@gmail.com</a>; <a href="mailto:llvm@inglorion.net">llvm@inglorion.net</a>; Igor Kudrin; Evgeny Leviant; <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
Тема: Re: [PATCH] D42528: [LTO] - Introduce GlobalResolution::Prevailing flag.<br>
<div class="HOEnZb"><div class="h5"><br>
>> Index: lib/LTO/LTO.cpp<br>
>> ==============================<wbr>==============================<wbr>=======<br>
>> --- lib/LTO/LTO.cpp<br>
>> +++ lib/LTO/LTO.cpp<br>
>> @@ -419,11 +419,14 @@<br>
>>      auto &GlobalRes = GlobalResolutions[Sym.getName(<wbr>)];<br>
>>      GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();<br>
>>      if (Res.Prevailing) {<br>
>> -      assert(GlobalRes.IRName.empty(<wbr>) &&<br>
>> +      assert(!GlobalRes.Prevailing &&<br>
>>               "Multiple prevailing defs are not allowed");<br>
>> -      GlobalRes.IRName = Sym.getIRName();<br>
>> +      GlobalRes.Prevailing = true;<br>
>>      }<br>
>><br>
>> +    if (GlobalRes.IRName.empty())<br>
>> +      GlobalRes.IRName = Sym.getIRName();<br>
><br>
>Why do you need the second if? It is still true that only for prevailing<br>
>symbols we need the name, no?<br>
<br>
No. Previously GlobalRes.IRName was set only for prevailing symbols.<br>
And so "if (GlobalRes.IRName)" was used like "if (Prevailing)".<br>
<br>
But now I need IRName for both privailing and not-prevailing symbols<br>
(see change in Error LTO::run(AddStreamFn AddStream, NativeObjectCache Cache) ).<br>
So I had to add bool Prevailing flag.<br>
<br>
With that I can mark Live all PrevailingType::Yes and PrevailingType::Unknown<br>
and make PrevailingType::No dead.<br>
<br>
>That is, could this be:<br>
><br>
>  if (Res.Prevailing) {<br>
 >     assert(!GlobalRes.Prevailing &&<br>
 >            "Multiple prevailing defs are not allowed");<br>
 >     GlobalRes.IRName = Sym.getIRName();<br>
 >     GlobalRes.Prevailing = true;<br>
 >     GlobalRes.IRName = Sym.getIRName();<br>
>  }<br>
><br>
>Cheers,<br>
>Rafael<br>
<br>
George.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>