diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -616,7 +616,7 @@ // If V is a constant, then it is known in all predecessors. if (Constant *KC = getKnownConstant(V, Preference)) { for (BasicBlock *Pred : predecessors(BB)) - Result.push_back(std::make_pair(KC, Pred)); + Result.emplace_back(KC, Pred); return !Result.empty(); } @@ -643,7 +643,7 @@ // predecessor, use that information to try to thread this block. Constant *PredCst = LVI->getConstantOnEdge(V, P, BB, CxtI); if (Constant *KC = getKnownConstant(PredCst, Preference)) - Result.push_back(std::make_pair(KC, P)); + Result.emplace_back(KC, P); } return !Result.empty(); @@ -654,13 +654,13 @@ for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { Value *InVal = PN->getIncomingValue(i); if (Constant *KC = getKnownConstant(InVal, Preference)) { - Result.push_back(std::make_pair(KC, PN->getIncomingBlock(i))); + Result.emplace_back(KC, PN->getIncomingBlock(i)); } else { Constant *CI = LVI->getConstantOnEdge(InVal, PN->getIncomingBlock(i), BB, CxtI); if (Constant *KC = getKnownConstant(CI, Preference)) - Result.push_back(std::make_pair(KC, PN->getIncomingBlock(i))); + Result.emplace_back(KC, PN->getIncomingBlock(i)); } } @@ -759,7 +759,7 @@ Constant *Folded = ConstantExpr::get(BO->getOpcode(), V, CI); if (Constant *KC = getKnownConstant(Folded, WantInteger)) - Result.push_back(std::make_pair(KC, LHSVal.second)); + Result.emplace_back(KC, LHSVal.second); } } @@ -811,7 +811,7 @@ } if (Constant *KC = getKnownConstant(Res, WantInteger)) - Result.push_back(std::make_pair(KC, PredBB)); + Result.emplace_back(KC, PredBB); } return !Result.empty(); @@ -834,7 +834,7 @@ continue; Constant *ResC = ConstantInt::get(CmpType, Res); - Result.push_back(std::make_pair(ResC, P)); + Result.emplace_back(ResC, P); } return !Result.empty(); @@ -873,7 +873,7 @@ else continue; - Result.push_back(std::make_pair(ResC, P)); + Result.emplace_back(ResC, P); } return !Result.empty(); @@ -891,7 +891,7 @@ Constant *V = LHSVal.first; Constant *Folded = ConstantExpr::getCompare(Pred, V, CmpConst); if (Constant *KC = getKnownConstant(Folded, WantInteger)) - Result.push_back(std::make_pair(KC, LHSVal.second)); + Result.emplace_back(KC, LHSVal.second); } return !Result.empty(); @@ -925,7 +925,7 @@ // See if the select has a known constant value for this predecessor. if (Constant *Val = KnownCond ? TrueVal : FalseVal) - Result.push_back(std::make_pair(Val, C.second)); + Result.emplace_back(Val, C.second); } return !Result.empty(); @@ -936,7 +936,7 @@ Constant *CI = LVI->getConstant(V, BB, CxtI); if (Constant *KC = getKnownConstant(CI, Preference)) { for (BasicBlock *Pred : predecessors(BB)) - Result.push_back(std::make_pair(KC, Pred)); + Result.emplace_back(KC, Pred); } return !Result.empty(); @@ -1345,7 +1345,7 @@ // If so, this load is partially redundant. Remember this info so that we // can create a PHI node. - AvailablePreds.push_back(std::make_pair(PredBB, PredAvailable)); + AvailablePreds.emplace_back(PredBB, PredAvailable); } // If the loaded value isn't available in any predecessor, it isn't partially @@ -1419,7 +1419,7 @@ if (AATags) NewVal->setAAMetadata(AATags); - AvailablePreds.push_back(std::make_pair(UnavailablePred, NewVal)); + AvailablePreds.emplace_back(UnavailablePred, NewVal); } // Now we know that each predecessor of this block has a value in @@ -1652,7 +1652,7 @@ isa(Pred->getTerminator())) continue; - PredToDestList.push_back(std::make_pair(Pred, DestBB)); + PredToDestList.emplace_back(Pred, DestBB); } // If all edges were unthreadable, we fail.