Author: Kazu Hirata Date: 2020-12-29T19:23:21-08:00 New Revision: f76e83bfbba9fcaf6f2e3d869774302d721ba1e4
URL: https://github.com/llvm/llvm-project/commit/f76e83bfbba9fcaf6f2e3d869774302d721ba1e4 DIFF: https://github.com/llvm/llvm-project/commit/f76e83bfbba9fcaf6f2e3d869774302d721ba1e4.diff LOG: [Analysis] Use llvm::append_range (NFC) Added: Modified: llvm/include/llvm/Analysis/DDG.h llvm/include/llvm/Analysis/IntervalIterator.h llvm/lib/Analysis/AliasSetTracker.cpp llvm/lib/Analysis/DDG.cpp llvm/lib/Analysis/DependenceGraphBuilder.cpp llvm/lib/Analysis/IRSimilarityIdentifier.cpp llvm/lib/Analysis/LazyValueInfo.cpp llvm/lib/Analysis/ScalarEvolution.cpp llvm/lib/Analysis/TargetLibraryInfo.cpp Removed: ################################################################################ diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h index 8d225c155cd4..e3bef33e55c3 100644 --- a/llvm/include/llvm/Analysis/DDG.h +++ b/llvm/include/llvm/Analysis/DDG.h @@ -152,7 +152,7 @@ class SimpleDDGNode : public DDGNode { setKind((InstList.size() == 0 && Input.size() == 1) ? NodeKind::SingleInstruction : NodeKind::MultiInstruction); - InstList.insert(InstList.end(), Input.begin(), Input.end()); + llvm::append_range(InstList, Input); } void appendInstructions(const SimpleDDGNode &Input) { appendInstructions(Input.getInstructions()); diff --git a/llvm/include/llvm/Analysis/IntervalIterator.h b/llvm/include/llvm/Analysis/IntervalIterator.h index 38bb3bbb1719..8e2273618a66 100644 --- a/llvm/include/llvm/Analysis/IntervalIterator.h +++ b/llvm/include/llvm/Analysis/IntervalIterator.h @@ -81,7 +81,7 @@ inline void addNodeToInterval(Interval *Int, BasicBlock *BB) { // BasicBlocks are added to the interval. inline void addNodeToInterval(Interval *Int, Interval *I) { // Add all of the nodes in I as new nodes in Int. - Int->Nodes.insert(Int->Nodes.end(), I->Nodes.begin(), I->Nodes.end()); + llvm::append_range(Int->Nodes, I->Nodes); } template<class NodeTy, class OrigContainer_t, class GT = GraphTraits<NodeTy *>, diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index 77dba3444e3d..9b21fbf4c9b7 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -83,7 +83,7 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) { addRef(); } } else if (ASHadUnknownInsts) { - UnknownInsts.insert(UnknownInsts.end(), AS.UnknownInsts.begin(), AS.UnknownInsts.end()); + llvm::append_range(UnknownInsts, AS.UnknownInsts); AS.UnknownInsts.clear(); } diff --git a/llvm/lib/Analysis/DDG.cpp b/llvm/lib/Analysis/DDG.cpp index 280d9ef79efa..b2aa322454e7 100644 --- a/llvm/lib/Analysis/DDG.cpp +++ b/llvm/lib/Analysis/DDG.cpp @@ -49,7 +49,7 @@ bool DDGNode::collectInstructions( assert(!isa<PiBlockDDGNode>(PN) && "Nested PiBlocks are not supported."); SmallVector<Instruction *, 8> TmpIList; PN->collectInstructions(Pred, TmpIList); - IList.insert(IList.end(), TmpIList.begin(), TmpIList.end()); + llvm::append_range(IList, TmpIList); } } else llvm_unreachable("unimplemented type of node"); diff --git a/llvm/lib/Analysis/DependenceGraphBuilder.cpp b/llvm/lib/Analysis/DependenceGraphBuilder.cpp index 7a98d844e4cb..fbf0f6651599 100644 --- a/llvm/lib/Analysis/DependenceGraphBuilder.cpp +++ b/llvm/lib/Analysis/DependenceGraphBuilder.cpp @@ -492,8 +492,7 @@ void AbstractDependenceGraphBuilder<G>::sortNodesTopologically() { // Put members of the pi-block right after the pi-block itself, for // convenience. const NodeListType &PiBlockMembers = getNodesInPiBlock(*N); - NodesInPO.insert(NodesInPO.end(), PiBlockMembers.begin(), - PiBlockMembers.end()); + llvm::append_range(NodesInPO, PiBlockMembers); } NodesInPO.push_back(N); } diff --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp index 4ee152450c05..141c1e0a5d03 100644 --- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp +++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp @@ -138,10 +138,8 @@ void IRInstructionMapper::convertToUnsignedVec( mapToIllegalUnsigned(It, IntegerMappingForBB, InstrListForBB, true); for_each(InstrListForBB, [this](IRInstructionData *ID) { this->IDL->push_back(*ID); }); - InstrList.insert(InstrList.end(), InstrListForBB.begin(), - InstrListForBB.end()); - IntegerMapping.insert(IntegerMapping.end(), IntegerMappingForBB.begin(), - IntegerMappingForBB.end()); + llvm::append_range(InstrList, InstrListForBB); + llvm::append_range(IntegerMapping, IntegerMappingForBB); } } @@ -639,11 +637,9 @@ void IRSimilarityIdentifier::populateMapper( // Insert the InstrListForModule at the end of the overall InstrList so that // we can have a long InstrList for the entire set of Modules being analyzed. - InstrList.insert(InstrList.end(), InstrListForModule.begin(), - InstrListForModule.end()); + llvm::append_range(InstrList, InstrListForModule); // Do the same as above, but for IntegerMapping. - IntegerMapping.insert(IntegerMapping.end(), IntegerMappingForModule.begin(), - IntegerMappingForModule.end()); + llvm::append_range(IntegerMapping, IntegerMappingForModule); } void IRSimilarityIdentifier::populateMapper( diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index aadb90d372f4..d95c9064f570 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -333,7 +333,7 @@ void LazyValueInfoCache::threadEdgeImpl(BasicBlock *OldSucc, if (!changed) continue; - worklist.insert(worklist.end(), succ_begin(ToUpdate), succ_end(ToUpdate)); + llvm::append_range(worklist, successors(ToUpdate)); } } diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 361a1437f690..b0ead7349ba5 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -11961,7 +11961,7 @@ void ScalarEvolution::SCEVCallbackVH::allUsesReplacedWith(Value *V) { if (PHINode *PN = dyn_cast<PHINode>(U)) SE->ConstantEvolutionLoopExitValue.erase(PN); SE->eraseValueFromMap(U); - Worklist.insert(Worklist.end(), U->user_begin(), U->user_end()); + llvm::append_range(Worklist, U->users()); } // Delete the Old value. if (PHINode *PN = dyn_cast<PHINode>(Old)) @@ -12526,7 +12526,7 @@ void ScalarEvolution::verify() const { while (!LoopStack.empty()) { auto *L = LoopStack.pop_back_val(); - LoopStack.insert(LoopStack.end(), L->begin(), L->end()); + llvm::append_range(LoopStack, *L); auto *CurBECount = SCM.visit( const_cast<ScalarEvolution *>(this)->getBackedgeTakenCount(L)); diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 53283c434f2d..26972b2fbfbb 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -1543,10 +1543,10 @@ static bool compareWithVectorFnName(const VecDesc &LHS, StringRef S) { } void TargetLibraryInfoImpl::addVectorizableFunctions(ArrayRef<VecDesc> Fns) { - VectorDescs.insert(VectorDescs.end(), Fns.begin(), Fns.end()); + llvm::append_range(VectorDescs, Fns); llvm::sort(VectorDescs, compareByScalarFnName); - ScalarDescs.insert(ScalarDescs.end(), Fns.begin(), Fns.end()); + llvm::append_range(ScalarDescs, Fns); llvm::sort(ScalarDescs, compareByVectorFnName); } _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits