<div dir="ltr"><div>getSDValue does have side effects in that it does a normalizing update, but the looped call to replaced values immediately preceding avoids making such modifications. I left the call as getSDValue as a direct call rather than inlining it to explicitly avoid the superficially inlined check as it captures the non-zero assertion in one place and we're already in an expensive check so the marginal performance cost seemed acceptable. </div><div><br></div><div>I have no objections to changing it though.</div><div><br></div><div>-Nirav</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 18, 2018 at 2:53 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Could the getSDValue call be rolled into the assert? (to avoid doing the work of that function call when assertions are enabled) Or does it have necessary side effects that must occur even in a nonasserts build? (functions name 'get' with side effects are a bit misleading, though not all that uncommon)</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 8:59 AM Nirav Dave via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: niravd<br>
Date: Thu Jun 14 08:55:15 2018<br>
New Revision: 334731<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=334731&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=334731&view=rev</a><br>
Log:<br>
Avoid unused variable in non-assert builds.<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/<wbr>SelectionDAG/LegalizeTypes.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/<wbr>SelectionDAG/LegalizeTypes.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=334731&r1=334730&r2=334731&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/<wbr>CodeGen/SelectionDAG/<wbr>LegalizeTypes.cpp?rev=334731&<wbr>r1=334730&r2=334731&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/CodeGen/<wbr>SelectionDAG/LegalizeTypes.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/<wbr>SelectionDAG/LegalizeTypes.cpp Thu Jun 14 08:55:15 2018<br>
@@ -105,6 +105,7 @@ void DAGTypeLegalizer::<wbr>PerformExpensiveC<br>
           I = ReplacedValues.find(NewValId);<br>
         }<br>
         SDValue NewVal = getSDValue(NewValId);<br>
+        (void)NewVal;<br>
         assert(NewVal.getNode()-><wbr>getNodeId() != NewNode &&<br>
                "ReplacedValues maps to a new node!");<br>
       }<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div>