AMDGPU: Use cast instead of unchecked dyn_cast
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 3 Jan 2023 15:03:58 +0000 (10:03 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 3 Jan 2023 15:32:10 +0000 (10:32 -0500)
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp

index ef895c0..5319aac 100644 (file)
@@ -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.