]> granicus.if.org Git - llvm/commitdiff
[InstCombine] use 'auto' with 'dyn_cast'; NFC
authorSanjay Patel <spatel@rotateright.com>
Mon, 27 Nov 2017 18:19:32 +0000 (18:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 27 Nov 2017 18:19:32 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319067 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineVectorOps.cpp

index a454653a3a135c0e6ce2be48d4cdef67d6628cca..6c99007475c12941cffe0b142656e27296ec3654 100644 (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.