[InstCombine] use 'auto' with 'dyn_cast'; NFC

llvm-svn: 319067
This commit is contained in:
Sanjay Patel 2017-11-27 18:19:32 +00:00
parent a4120fc42c
commit 863d494730
1 changed files with 2 additions and 3 deletions

View File

@ -610,12 +610,11 @@ static Instruction *foldInsSequenceIntoBroadcast(InsertElementInst &InsElt) {
// Walk the chain backwards, keeping track of which indices we inserted into,
// until we hit something that isn't an insert of the splatted value.
while (CurrIE) {
ConstantInt *Idx = dyn_cast<ConstantInt>(CurrIE->getOperand(2));
auto *Idx = dyn_cast<ConstantInt>(CurrIE->getOperand(2));
if (!Idx || CurrIE->getOperand(1) != SplatVal)
return nullptr;
InsertElementInst *NextIE =
dyn_cast<InsertElementInst>(CurrIE->getOperand(0));
auto *NextIE = dyn_cast<InsertElementInst>(CurrIE->getOperand(0));
// Check none of the intermediate steps have any additional uses, except
// for the root insertelement instruction, which can be re-used, if it
// inserts at position 0.