[SCEV] Don't use std::make_pair; NFC

`{A, B}` reads cleaner than `std::make_pair(A, B)`.

llvm-svn: 261392
This commit is contained in:
Sanjoy Das 2016-02-20 01:35:56 +00:00
parent 3d8a30a9db
commit c42f7cc3f8
1 changed files with 14 additions and 15 deletions

View File

@ -1903,7 +1903,7 @@ CollectAddOperandsWithScales(DenseMap<const SCEV *, APInt> &M,
// the map.
SmallVector<const SCEV *, 4> MulOps(Mul->op_begin()+1, Mul->op_end());
const SCEV *Key = SE.getMulExpr(MulOps);
auto Pair = M.insert(std::make_pair(Key, NewScale));
auto Pair = M.insert({Key, NewScale});
if (Pair.second) {
NewOps.push_back(Pair.first->first);
} else {
@ -1916,7 +1916,7 @@ CollectAddOperandsWithScales(DenseMap<const SCEV *, APInt> &M,
} else {
// An ordinary operand. Update the map.
std::pair<DenseMap<const SCEV *, APInt>::iterator, bool> Pair =
M.insert(std::make_pair(Ops[i], Scale));
M.insert({Ops[i], Scale});
if (Pair.second) {
NewOps.push_back(Pair.first->first);
} else {
@ -3346,7 +3346,7 @@ bool ScalarEvolution::containsAddRecurrence(const SCEV *S) {
FindAddRecurrence F;
SCEVTraversal<FindAddRecurrence> ST(F);
ST.visitAll(S);
HasRecMap.insert(std::make_pair(S, F.FoundOne));
HasRecMap.insert({S, F.FoundOne});
return F.FoundOne;
}
@ -3393,7 +3393,7 @@ const SCEV *ScalarEvolution::getSCEV(Value *V) {
// V, so it is needed to double check whether V->S is inserted into
// ValueExprMap before insert S->V into ExprValueMap.
std::pair<ValueExprMapType::iterator, bool> Pair =
ValueExprMap.insert(std::make_pair(SCEVCallbackVH(V, this), S));
ValueExprMap.insert({SCEVCallbackVH(V, this), S});
if (Pair.second)
ExprValueMap[S].insert(V);
}
@ -3788,7 +3788,7 @@ const SCEV *ScalarEvolution::createAddRecFromPHI(PHINode *PN) {
const SCEV *SymbolicName = getUnknown(PN);
assert(ValueExprMap.find_as(PN) == ValueExprMap.end() &&
"PHI node already processed?");
ValueExprMap.insert(std::make_pair(SCEVCallbackVH(PN, this), SymbolicName));
ValueExprMap.insert({SCEVCallbackVH(PN, this), SymbolicName});
// Using this symbolic name for the PHI, analyze the value coming around
// the back-edge.
@ -5018,7 +5018,7 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
// code elsewhere that it shouldn't attempt to request a new
// backedge-taken count, which could result in infinite recursion.
std::pair<DenseMap<const Loop *, BackedgeTakenInfo>::iterator, bool> Pair =
BackedgeTakenCounts.insert(std::make_pair(L, BackedgeTakenInfo()));
BackedgeTakenCounts.insert({L, BackedgeTakenInfo()});
if (!Pair.second)
return Pair.first->second;
@ -5285,7 +5285,7 @@ ScalarEvolution::computeBackedgeTakenCount(const Loop *L) {
// we won't be able to compute an exact value for the loop.
CouldComputeBECount = false;
else
ExitCounts.push_back(std::make_pair(ExitBB, EL.Exact));
ExitCounts.push_back({ExitBB, EL.Exact});
// 2. Derive the loop's MaxBECount from each exit's max number of
// non-exiting iterations. Partition the loop exits into two kinds:
@ -6571,7 +6571,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
// We currently can only solve this if the coefficients are constants.
if (!LC || !MC || !NC) {
const SCEV *CNC = SE.getCouldNotCompute();
return std::make_pair(CNC, CNC);
return {CNC, CNC};
}
uint32_t BitWidth = LC->getAPInt().getBitWidth();
@ -6600,7 +6600,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
if (SqrtTerm.isNegative()) {
// The loop is provably infinite.
const SCEV *CNC = SE.getCouldNotCompute();
return std::make_pair(CNC, CNC);
return {CNC, CNC};
}
// Compute sqrt(B^2-4ac). This is guaranteed to be the nearest
@ -6613,7 +6613,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
APInt TwoA(A << 1);
if (TwoA.isMinValue()) {
const SCEV *CNC = SE.getCouldNotCompute();
return std::make_pair(CNC, CNC);
return {CNC, CNC};
}
LLVMContext &Context = SE.getContext();
@ -6623,8 +6623,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
ConstantInt *Solution2 =
ConstantInt::get(Context, (NegB - SqrtVal).sdiv(TwoA));
return std::make_pair(SE.getConstant(Solution1),
SE.getConstant(Solution2));
return {SE.getConstant(Solution1), SE.getConstant(Solution2)};
} // end APIntOps namespace
}
@ -6834,15 +6833,15 @@ ScalarEvolution::getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB) {
// predecessor to the block that does not go through the direct edge
// from the predecessor to the block.
if (BasicBlock *Pred = BB->getSinglePredecessor())
return std::make_pair(Pred, BB);
return {Pred, BB};
// A loop's header is defined to be a block that dominates the loop.
// If the header has a unique predecessor outside the loop, it must be
// a block that has exactly one successor that can reach the loop.
if (Loop *L = LI.getLoopFor(BB))
return std::make_pair(L->getLoopPredecessor(), L->getHeader());
return {L->getLoopPredecessor(), L->getHeader()};
return std::pair<BasicBlock *, BasicBlock *>();
return {nullptr, nullptr};
}
/// HasSameValue - SCEV structural equivalence is usually sufficient for