<div dir="ltr"><div>Hi Eli  and All,</div><div><br></div><div>Thank you for the suggestions, the subjected review is blocking our internal release.</div><div><br></div><div>We would like to know community suggestions over the problem and fix , that we suggested.</div><div><br></div><div>Appreciate your time and thank you </div><div>~Umesh</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">Umesh Kalappa via Phabricator</strong> <span dir="auto"><<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>></span><br>Date: Wed, May 13, 2020 at 10:02 AM<br>Subject: [PATCH] D79314: PR45733 : global weak symbol are excluded from the optimization .<br>To:  <<a href="mailto:umesh.kalappa0@gmail.com">umesh.kalappa0@gmail.com</a>>,  <<a href="mailto:renatoriolino@gmail.com">renatoriolino@gmail.com</a>>,  <<a href="mailto:spatel@rotateright.com">spatel@rotateright.com</a>>,  <<a href="mailto:tpr.ll@botech.co.uk">tpr.ll@botech.co.uk</a>>,  <<a href="mailto:efriedma@quicinc.com">efriedma@quicinc.com</a>><br>Cc:  <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>>,  <<a href="mailto:88888yl@gmail.com">88888yl@gmail.com</a>>,  <<a href="mailto:Samuel.j.knapp@btinternet.com">Samuel.j.knapp@btinternet.com</a>>,  <<a href="mailto:florian_hahn@apple.com">florian_hahn@apple.com</a>><br></div><br><br>umesh.kalappa0 added a comment.<br>
<br>
In D79314#2032099 <<a href="https://reviews.llvm.org/D79314#2032099" rel="noreferrer" target="_blank">https://reviews.llvm.org/D79314#2032099</a>>, @efriedma wrote:<br>
<br>
> Okay, so assuming that optimization is invalid, there's a bug in clang *somewhere*.  You haven't explained why this is the right fix.<br>
><br>
> LLVM IR is a distinct language with its own specification.  The definition of weak_odr is very explicitly written out.  If you're going to change LLVM IR optimizations, you need to justify the change in terms of that specification, not C code.<br>
<br>
<br>
<br>
<br>
In D79314#2032099 <<a href="https://reviews.llvm.org/D79314#2032099" rel="noreferrer" target="_blank">https://reviews.llvm.org/D79314#2032099</a>>, @efriedma wrote:<br>
<br>
> Okay, so assuming that optimization is invalid, there's a bug in clang *somewhere*.  You haven't explained why this is the right fix.<br>
<br>
<br>
We are bailing out the optimization, if the global has the weak_odr linkage  ,which is explicit in the condition check .<br>
<br>
> LLVM IR is a distinct language with its own specification.  The definition of weak_odr is very explicitly written out.  If you're going to change LLVM IR optimizations, you need to justify the change in terms of that specification, not C code.<br>
<br>
Yes, don't propagate the constant for the weak_odr / weak globals (in SCCP ).<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D79314/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D79314/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D79314" rel="noreferrer" target="_blank">https://reviews.llvm.org/D79314</a><br>
<br>
<br>
<br>
</div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
        <td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>