[llvm] r250634 - [SCEV] Use auto where it helps remove line breaks; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 17 17:29:20 PDT 2015


Author: sanjoy
Date: Sat Oct 17 19:29:20 2015
New Revision: 250634

URL: http://llvm.org/viewvc/llvm-project?rev=250634&view=rev
Log:
[SCEV] Use auto where it helps remove line breaks; NFC

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=250634&r1=250633&r2=250634&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Oct 17 19:29:20 2015
@@ -2043,8 +2043,7 @@ const SCEV *ScalarEvolution::getAddExpr(
               break;
             }
             LargeMulOps.push_back(T->getOperand());
-          } else if (const SCEVConstant *C =
-                       dyn_cast<SCEVConstant>(M->getOperand(j))) {
+          } else if (const auto *C = dyn_cast<SCEVConstant>(M->getOperand(j))) {
             LargeMulOps.push_back(getAnyExtendExpr(C, SrcType));
           } else {
             Ok = false;
@@ -2421,9 +2420,7 @@ const SCEV *ScalarEvolution::getMulExpr(
           }
           if (AnyFolded)
             return getAddExpr(NewOps);
-        }
-        else if (const SCEVAddRecExpr *
-                 AddRec = dyn_cast<SCEVAddRecExpr>(Ops[1])) {
+        } else if (const auto *AddRec = dyn_cast<SCEVAddRecExpr>(Ops[1])) {
           // Negation preserves a recurrence's no self-wrap property.
           SmallVector<const SCEV *, 4> Operands;
           for (SCEVAddRecExpr::op_iterator I = AddRec->op_begin(),
@@ -2748,8 +2745,7 @@ const SCEV *ScalarEvolution::getUDivExac
   if (const SCEVConstant *RHSCst = dyn_cast<SCEVConstant>(RHS)) {
     // If the mulexpr multiplies by a constant, then that constant must be the
     // first element of the mulexpr.
-    if (const SCEVConstant *LHSCst =
-            dyn_cast<SCEVConstant>(Mul->getOperand(0))) {
+    if (const auto *LHSCst = dyn_cast<SCEVConstant>(Mul->getOperand(0))) {
       if (LHSCst == RHSCst) {
         SmallVector<const SCEV *, 2> Operands;
         Operands.append(Mul->op_begin() + 1, Mul->op_end());
@@ -3567,8 +3563,7 @@ ScalarEvolution::ForgetSymbolicName(Inst
     if (!Visited.insert(I).second)
       continue;
 
-    ValueExprMapType::iterator It =
-      ValueExprMap.find_as(static_cast<Value *>(I));
+    auto It = ValueExprMap.find_as(static_cast<Value *>(I));
     if (It != ValueExprMap.end()) {
       const SCEV *Old = It->second;
 
@@ -3708,8 +3703,7 @@ const SCEV *ScalarEvolution::createAddRe
           return PHISCEV;
         }
       }
-    } else if (const SCEVAddRecExpr *AddRec =
-                   dyn_cast<SCEVAddRecExpr>(BEValue)) {
+    } else if (const auto *AddRec = dyn_cast<SCEVAddRecExpr>(BEValue)) {
       // Otherwise, this could be a loop like this:
       //     i = 0;  for (j = 1; ..; ++j) { ....  i = j; }
       // In this case, j = {1,+,1}  and BEValue is j.
@@ -8124,8 +8118,7 @@ const SCEV *SCEVAddRecExpr::getNumIterat
       Operands[0] = SE.getZero(SC->getType());
       const SCEV *Shifted = SE.getAddRecExpr(Operands, getLoop(),
                                              getNoWrapFlags(FlagNW));
-      if (const SCEVAddRecExpr *ShiftedAddRec =
-            dyn_cast<SCEVAddRecExpr>(Shifted))
+      if (const auto *ShiftedAddRec = dyn_cast<SCEVAddRecExpr>(Shifted))
         return ShiftedAddRec->getNumIterationsInRange(
                            Range.subtract(SC->getValue()->getValue()), SE);
       // This is strange and shouldn't happen.




More information about the llvm-commits mailing list