[llvm] 6386345 - Fix unused variable warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 07:43:47 PDT 2020


Author: Simon Pilgrim
Date: 2020-08-13T15:43:20+01:00
New Revision: 63863451d18b3ef590cba9916e1bec181ad252e7

URL: https://github.com/llvm/llvm-project/commit/63863451d18b3ef590cba9916e1bec181ad252e7
DIFF: https://github.com/llvm/llvm-project/commit/63863451d18b3ef590cba9916e1bec181ad252e7.diff

LOG: Fix unused variable warning. NFC.

Reduce the dyn_cast<> to a isa<> as that's all non-assert builds require, and move the cast<> inside the assert.

Added: 
    

Modified: 
    llvm/lib/Analysis/LazyValueInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index bfc1c8f9be71..55c9808f541e 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1256,8 +1256,8 @@ static ValueLatticeElement constantFoldUser(User *Usr, Value *Op,
             SimplifyBinOp(BO->getOpcode(), LHS, RHS, DL))) {
       return ValueLatticeElement::getRange(ConstantRange(C->getValue()));
     }
-  } else if (auto *FI = dyn_cast<FreezeInst>(Usr)) {
-    assert(FI->getOperand(0) == Op && "Operand 0 isn't Op");
+  } else if (isa<FreezeInst>(Usr)) {
+    assert(cast<FreezeInst>(Usr)->getOperand(0) == Op && "Operand 0 isn't Op");
     return ValueLatticeElement::getRange(ConstantRange(OpConstVal));
   }
   return ValueLatticeElement::getOverdefined();


        


More information about the llvm-commits mailing list