From: Sanjoy Das Date: Sun, 18 Oct 2015 00:29:20 +0000 (+0000) Subject: [SCEV] Use auto where it helps remove line breaks; NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba899a9456571a759d1b01ea5083feb3a19e4dfb;p=oota-llvm.git [SCEV] Use auto where it helps remove line breaks; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250634 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index d3574b97bf6..6c72feb71cd 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -2043,8 +2043,7 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl &Ops, break; } LargeMulOps.push_back(T->getOperand()); - } else if (const SCEVConstant *C = - dyn_cast(M->getOperand(j))) { + } else if (const auto *C = dyn_cast(M->getOperand(j))) { LargeMulOps.push_back(getAnyExtendExpr(C, SrcType)); } else { Ok = false; @@ -2421,9 +2420,7 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl &Ops, } if (AnyFolded) return getAddExpr(NewOps); - } - else if (const SCEVAddRecExpr * - AddRec = dyn_cast(Ops[1])) { + } else if (const auto *AddRec = dyn_cast(Ops[1])) { // Negation preserves a recurrence's no self-wrap property. SmallVector Operands; for (SCEVAddRecExpr::op_iterator I = AddRec->op_begin(), @@ -2748,8 +2745,7 @@ const SCEV *ScalarEvolution::getUDivExactExpr(const SCEV *LHS, if (const SCEVConstant *RHSCst = dyn_cast(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(Mul->getOperand(0))) { + if (const auto *LHSCst = dyn_cast(Mul->getOperand(0))) { if (LHSCst == RHSCst) { SmallVector Operands; Operands.append(Mul->op_begin() + 1, Mul->op_end()); @@ -3567,8 +3563,7 @@ ScalarEvolution::ForgetSymbolicName(Instruction *PN, const SCEV *SymName) { if (!Visited.insert(I).second) continue; - ValueExprMapType::iterator It = - ValueExprMap.find_as(static_cast(I)); + auto It = ValueExprMap.find_as(static_cast(I)); if (It != ValueExprMap.end()) { const SCEV *Old = It->second; @@ -3708,8 +3703,7 @@ const SCEV *ScalarEvolution::createAddRecFromPHI(PHINode *PN) { return PHISCEV; } } - } else if (const SCEVAddRecExpr *AddRec = - dyn_cast(BEValue)) { + } else if (const auto *AddRec = dyn_cast(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::getNumIterationsInRange(ConstantRange Range, Operands[0] = SE.getZero(SC->getType()); const SCEV *Shifted = SE.getAddRecExpr(Operands, getLoop(), getNoWrapFlags(FlagNW)); - if (const SCEVAddRecExpr *ShiftedAddRec = - dyn_cast(Shifted)) + if (const auto *ShiftedAddRec = dyn_cast(Shifted)) return ShiftedAddRec->getNumIterationsInRange( Range.subtract(SC->getValue()->getValue()), SE); // This is strange and shouldn't happen.