[llvm] r310064 - [InstCombine] Fold single-use variable into assert.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 09:08:41 PDT 2017


Author: d0k
Date: Fri Aug  4 09:08:41 2017
New Revision: 310064

URL: http://llvm.org/viewvc/llvm-project?rev=310064&view=rev
Log:
[InstCombine] Fold single-use variable into assert.

Avoids unused variable warnings in Release builds. No functional change.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp?rev=310064&r1=310063&r2=310064&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp Fri Aug  4 09:08:41 2017
@@ -682,8 +682,8 @@ Instruction *InstCombiner::visitLShr(Bin
 
     if (match(Op0, m_OneUse(m_ZExt(m_Value(X)))) &&
         (!Ty->isIntegerTy() || shouldChangeType(Ty, X->getType()))) {
-      unsigned SrcTyBitWidth = X->getType()->getScalarSizeInBits();
-      assert(ShAmt < SrcTyBitWidth && "Big shift not simplified to zero?");
+      assert(ShAmt < X->getType()->getScalarSizeInBits() &&
+             "Big shift not simplified to zero?");
       // lshr (zext iM X to iN), C --> zext (lshr X, C) to iN
       Value *NewLShr = Builder.CreateLShr(X, ShAmt);
       return new ZExtInst(NewLShr, Ty);




More information about the llvm-commits mailing list