[llvm-branch-commits] [llvm] 897990e - [IROutliner] Use isa instead of dyn_cast where the casted value isn't used. NFC

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 23 11:46:53 PST 2020


Author: Craig Topper
Date: 2020-12-23T11:40:15-08:00
New Revision: 897990e614c8d609b2f62dde4f82eb3e96f9f0be

URL: https://github.com/llvm/llvm-project/commit/897990e614c8d609b2f62dde4f82eb3e96f9f0be
DIFF: https://github.com/llvm/llvm-project/commit/897990e614c8d609b2f62dde4f82eb3e96f9f0be.diff

LOG: [IROutliner] Use isa instead of dyn_cast where the casted value isn't used. NFC

Fixes unused variable warnings.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/IROutliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp
index 5b19d0718ab6..12a30744a652 100644
--- a/llvm/lib/Transforms/IPO/IROutliner.cpp
+++ b/llvm/lib/Transforms/IPO/IROutliner.cpp
@@ -297,7 +297,7 @@ static BasicBlock *moveFunctionData(Function &Old, Function &New) {
     CurrBB->removeFromParent();
     CurrBB->insertInto(&New);
     Instruction *I = CurrBB->getTerminator();
-    if (ReturnInst *RI = dyn_cast<ReturnInst>(I))
+    if (isa<ReturnInst>(I))
       NewEnd = &(*CurrBB);
   }
 
@@ -325,7 +325,7 @@ static void findConstants(IRSimilarityCandidate &C, DenseSet<unsigned> &NotSame,
       // Since these are stored before any outlining, they will be in the
       // global value numbering.
       unsigned GVN = C.getGVN(V).getValue();
-      if (Constant *CST = dyn_cast<Constant>(V))
+      if (isa<Constant>(V))
         if (NotSame.find(GVN) != NotSame.end() &&
             Seen.find(GVN) == Seen.end()) {
           Inputs.push_back(GVN);


        


More information about the llvm-branch-commits mailing list