From: Kazu Hirata Date: Wed, 30 Dec 2020 03:23:21 +0000 (-0800) Subject: [Analysis] Use llvm::append_range (NFC) X-Git-Tag: llvmorg-13-init~2404 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f76e83bfbba9fcaf6f2e3d869774302d721ba1e4;p=platform%2Fupstream%2Fllvm.git [Analysis] Use llvm::append_range (NFC) --- diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h index 8d225c1..e3bef33 100644 --- a/llvm/include/llvm/Analysis/DDG.h +++ b/llvm/include/llvm/Analysis/DDG.h @@ -152,7 +152,7 @@ private: 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 38bb3bb..8e22736 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, diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index 77dba34..9b21fbf 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 280d9ef..b2aa322 100644 --- a/llvm/lib/Analysis/DDG.cpp +++ b/llvm/lib/Analysis/DDG.cpp @@ -49,7 +49,7 @@ bool DDGNode::collectInstructions( assert(!isa(PN) && "Nested PiBlocks are not supported."); SmallVector 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 7a98d84..fbf0f66 100644 --- a/llvm/lib/Analysis/DependenceGraphBuilder.cpp +++ b/llvm/lib/Analysis/DependenceGraphBuilder.cpp @@ -492,8 +492,7 @@ void AbstractDependenceGraphBuilder::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 4ee1524..141c1e0 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 aadb90d..d95c906 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 361a143..b0ead73 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(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(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(this)->getBackedgeTakenCount(L)); diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 53283c4..26972b2 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 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); }