Skip to content

Commit 255b55c

Browse files
authored
[GlobalOpt] Use cast instead of dyn_cast. NFC (#144634)
The dyn_cast was not checked for null, and the cast is guaranteed to succeed by an earlier check.
1 parent 59d6fbb commit 255b55c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/GlobalOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ static bool tryWidenGlobalArraysUsedByMemcpy(
21692169

21702170
unsigned NumBytesToCopy = BytesToCopyOp->getZExtValue();
21712171

2172-
auto *Alloca = dyn_cast<AllocaInst>(CI->getArgOperand(0));
2172+
auto *Alloca = cast<AllocaInst>(CI->getArgOperand(0));
21732173
uint64_t DZSize = Alloca->getAllocatedType()->getArrayNumElements();
21742174
uint64_t SZSize = SourceDataArray->getType()->getNumElements();
21752175
unsigned ElementByteWidth = SourceDataArray->getElementByteSize();

0 commit comments

Comments
 (0)