diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index a454653a3a13..6c99007475c1 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -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(CurrIE->getOperand(2)); + auto *Idx = dyn_cast(CurrIE->getOperand(2)); if (!Idx || CurrIE->getOperand(1) != SplatVal) return nullptr; - InsertElementInst *NextIE = - dyn_cast(CurrIE->getOperand(0)); + auto *NextIE = dyn_cast(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.