[llvm] 356ada9 - Fix accidental usage of cast<> instead of dyn_cast<> in 58a0e44

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 11:00:28 PST 2022


Author: Philip Reames
Date: 2022-01-05T11:00:10-08:00
New Revision: 356ada9df419ac44e82b1078ccac819f352cd18d

URL: https://github.com/llvm/llvm-project/commit/356ada9df419ac44e82b1078ccac819f352cd18d
DIFF: https://github.com/llvm/llvm-project/commit/356ada9df419ac44e82b1078ccac819f352cd18d.diff

LOG: Fix accidental usage of cast<> instead of dyn_cast<> in 58a0e44

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 2d87f26ae39fb..ca73ab913c341 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3759,7 +3759,7 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock,
   if (I->mayWriteToMemory()) {
     // Check for case where the call writes to an otherwise dead alloca.  This
     // shows up for unused out-params in idiomatic C/C++ code.
-    auto *CB = cast<CallBase>(I);
+    auto *CB = dyn_cast<CallBase>(I);
     if (!CB)
       // TODO: handle e.g. store to alloca here - only worth doing if we extend
       // to allow reload along used path as described below.  Otherwise, this


        


More information about the llvm-commits mailing list