[llvm] 49caf70 - AMDGPU: Use cast instead of unchecked dyn_cast

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 07:32:18 PST 2023


Author: Matt Arsenault
Date: 2023-01-03T10:32:10-05:00
New Revision: 49caf7012170422afa84868598063818f9344228

URL: https://github.com/llvm/llvm-project/commit/49caf7012170422afa84868598063818f9344228
DIFF: https://github.com/llvm/llvm-project/commit/49caf7012170422afa84868598063818f9344228.diff

LOG: AMDGPU: Use cast instead of unchecked dyn_cast

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
index ef895c0a7961..5319aac85ed6 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
@@ -426,7 +426,7 @@ static bool tryPromoteAllocaToVector(AllocaInst *Alloca, const DataLayout &DL,
   Type *VecEltTy = VectorTy->getElementType();
   while (!Uses.empty()) {
     Use *U = Uses.pop_back_val();
-    Instruction *Inst = dyn_cast<Instruction>(U->getUser());
+    Instruction *Inst = cast<Instruction>(U->getUser());
 
     if (Value *Ptr = getLoadStorePointerOperand(Inst)) {
       // This is a store of the pointer, not to the pointer.


        


More information about the llvm-commits mailing list