<div dir="ltr">Thanks! I was just about to commit the identical patch.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 4, 2017 at 10:08 AM, Benjamin Kramer via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Fri Aug 4 09:08:41 2017<br>
New Revision: 310064<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=310064&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=310064&view=rev</a><br>
Log:<br>
[InstCombine] Fold single-use variable into assert.<br>
<br>
Avoids unused variable warnings in Release builds. No functional change.<br>
<br>
Modified:<br>
llvm/trunk/lib/Transforms/<wbr>InstCombine/InstCombineShifts.<wbr>cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/<wbr>InstCombine/InstCombineShifts.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp?rev=310064&r1=310063&r2=310064&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/<wbr>Transforms/InstCombine/<wbr>InstCombineShifts.cpp?rev=<wbr>310064&r1=310063&r2=310064&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Transforms/<wbr>InstCombine/InstCombineShifts.<wbr>cpp (original)<br>
+++ llvm/trunk/lib/Transforms/<wbr>InstCombine/InstCombineShifts.<wbr>cpp Fri Aug 4 09:08:41 2017<br>
@@ -682,8 +682,8 @@ Instruction *InstCombiner::visitLShr(Bin<br>
<br>
if (match(Op0, m_OneUse(m_ZExt(m_Value(X)))) &&<br>
(!Ty->isIntegerTy() || shouldChangeType(Ty, X->getType()))) {<br>
- unsigned SrcTyBitWidth = X->getType()-><wbr>getScalarSizeInBits();<br>
- assert(ShAmt < SrcTyBitWidth && "Big shift not simplified to zero?");<br>
+ assert(ShAmt < X->getType()-><wbr>getScalarSizeInBits() &&<br>
+ "Big shift not simplified to zero?");<br>
// lshr (zext iM X to iN), C --> zext (lshr X, C) to iN<br>
Value *NewLShr = Builder.CreateLShr(X, ShAmt);<br>
return new ZExtInst(NewLShr, Ty);<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">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><br></div>