diff options
Diffstat (limited to 'llvm')
25 files changed, 39 insertions, 42 deletions
diff --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h index e8041e2..42bccdc 100644 --- a/llvm/include/llvm/Analysis/IVDescriptors.h +++ b/llvm/include/llvm/Analysis/IVDescriptors.h @@ -87,7 +87,7 @@ public: Kind(K), FMF(FMF), ExactFPMathInst(ExactFP), RecurrenceType(RT), IsSigned(Signed), IsOrdered(Ordered), MinWidthCastToRecurrenceType(MinWidthCastToRecurTy) { - CastInsts.insert(CI.begin(), CI.end()); + CastInsts.insert_range(CI); } /// This POD struct holds information about a potential recurrence operation. diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 1583e0e3..fe3aea3 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1573,7 +1573,7 @@ void MemorySSA::buildMemorySSA(BatchAAResults &BAA, IterT Blocks) { // the loop, to limit the scope of the renaming. SmallVector<BasicBlock *> ExitBlocks; L->getExitBlocks(ExitBlocks); - Visited.insert(ExitBlocks.begin(), ExitBlocks.end()); + Visited.insert_range(ExitBlocks); renamePass(DT->getNode(L->getLoopPreheader()), LiveOnEntryDef.get(), Visited); } else { diff --git a/llvm/lib/Analysis/PhiValues.cpp b/llvm/lib/Analysis/PhiValues.cpp index 1e0dac3..dad91a9 100644 --- a/llvm/lib/Analysis/PhiValues.cpp +++ b/llvm/lib/Analysis/PhiValues.cpp @@ -100,7 +100,7 @@ void PhiValues::processPhi(const PHINode *Phi, if (OpDepthNumber != RootDepthNumber) { auto It = ReachableMap.find(OpDepthNumber); if (It != ReachableMap.end()) - Reachable.insert(It->second.begin(), It->second.end()); + Reachable.insert_range(It->second); } } else Reachable.insert(Op); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index dad14b9..3939dae 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1170,7 +1170,7 @@ DIE *DwarfCompileUnit::createAndAddScopeChildren(LexicalScope *Scope, // should be emitted for subprograms in this CU. if (!includeMinimalInlineScopes() && !Scope->getInlinedAt()) { auto &LocalDecls = DD->getLocalDeclsForScope(Scope->getScopeNode()); - DeferredLocalDecls.insert(LocalDecls.begin(), LocalDecls.end()); + DeferredLocalDecls.insert_range(LocalDecls); } // Emit inner lexical scopes. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index b7b0830..a78f606 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -706,8 +706,7 @@ static void interpretValues(const MachineInstr *CurMI, getForwardingRegsDefinedByMI(*CurMI, FwdRegDefs); if (FwdRegDefs.empty()) { // Any definitions by this instruction will clobber earlier reg movements. - ClobberedRegUnits.insert(NewClobberedRegUnits.begin(), - NewClobberedRegUnits.end()); + ClobberedRegUnits.insert_range(NewClobberedRegUnits); return; } @@ -756,8 +755,7 @@ static void interpretValues(const MachineInstr *CurMI, ForwardedRegWorklist.erase(ParamFwdReg); // Any definitions by this instruction will clobber earlier reg movements. - ClobberedRegUnits.insert(NewClobberedRegUnits.begin(), - NewClobberedRegUnits.end()); + ClobberedRegUnits.insert_range(NewClobberedRegUnits); // Now that we are done handling this instruction, add items from the // temporary worklist to the real one. diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index d5fbd4c..1a791f0 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -7577,7 +7577,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) { FalseBlock = StartBlock; SmallPtrSet<const Instruction *, 2> INS; - INS.insert(ASI.begin(), ASI.end()); + INS.insert_range(ASI); // Use reverse iterator because later select may use the value of the // earlier select, and we need to propagate value through earlier select // to get the PHI operand. diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp index ec71d50..920873c 100644 --- a/llvm/lib/CodeGen/InlineSpiller.cpp +++ b/llvm/lib/CodeGen/InlineSpiller.cpp @@ -1461,7 +1461,7 @@ void HoistSpillHelper::getVisitOrders( // with BBs containing hoisted spills which will be inserted to // SpillsToKeep later during hoisting. SpillsToKeep[MDT[Block]] = Register(); - WorkSet.insert(NodesOnPath.begin(), NodesOnPath.end()); + WorkSet.insert_range(NodesOnPath); } NodesOnPath.clear(); } diff --git a/llvm/lib/CodeGen/InterleavedAccessPass.cpp b/llvm/lib/CodeGen/InterleavedAccessPass.cpp index 3261f28..9e47510 100644 --- a/llvm/lib/CodeGen/InterleavedAccessPass.cpp +++ b/llvm/lib/CodeGen/InterleavedAccessPass.cpp @@ -349,7 +349,7 @@ bool InterleavedAccessImpl::lowerInterleavedLoad( return !Extracts.empty() || BinOpShuffleChanged; } - DeadInsts.insert(Shuffles.begin(), Shuffles.end()); + DeadInsts.insert_range(Shuffles); DeadInsts.insert(LI); return true; @@ -703,7 +703,7 @@ bool InterleavedAccessImpl::lowerDeinterleaveIntrinsic( return false; } - DeadInsts.insert(DeinterleaveDeadInsts.begin(), DeinterleaveDeadInsts.end()); + DeadInsts.insert_range(DeinterleaveDeadInsts); // We now have a target-specific load, so delete the old one. DeadInsts.insert(cast<Instruction>(LoadedVal)); return true; @@ -757,7 +757,7 @@ bool InterleavedAccessImpl::lowerInterleaveIntrinsic( // We now have a target-specific store, so delete the old one. DeadInsts.insert(cast<Instruction>(StoredBy)); - DeadInsts.insert(InterleaveDeadInsts.begin(), InterleaveDeadInsts.end()); + DeadInsts.insert_range(InterleaveDeadInsts); return true; } diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index b9da975..fb688a2 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -918,7 +918,7 @@ public: // Move set of active variables from one location to another. auto MovingVars = ActiveMLocs[Src]; - ActiveMLocs[Dst].insert(MovingVars.begin(), MovingVars.end()); + ActiveMLocs[Dst].insert_range(MovingVars); VarLocs[Dst.asU64()] = VarLocs[Src.asU64()]; // For each variable based on Src; create a location at Dst. @@ -2581,7 +2581,7 @@ void InstrRefBasedLDV::placeMLocPHIs( continue; } - RegUnitsToPHIUp.insert(FoundRegUnits.begin(), FoundRegUnits.end()); + RegUnitsToPHIUp.insert_range(FoundRegUnits); } // Lambda to fetch PHIs for a given location, and write into the PHIBlocks @@ -3087,7 +3087,7 @@ void InstrRefBasedLDV::getBlocksForScope( // VarLoc LiveDebugValues tracks variable locations that are defined in // blocks not in scope. This is something we could legitimately ignore, but // lets allow it for now for the sake of coverage. - BlocksToExplore.insert(AssignBlocks.begin(), AssignBlocks.end()); + BlocksToExplore.insert_range(AssignBlocks); // Storage for artificial blocks we intend to add to BlocksToExplore. DenseSet<const MachineBasicBlock *> ToAdd; @@ -3137,7 +3137,7 @@ void InstrRefBasedLDV::getBlocksForScope( } }; - BlocksToExplore.insert(ToAdd.begin(), ToAdd.end()); + BlocksToExplore.insert_range(ToAdd); } void InstrRefBasedLDV::buildVLocValueMap( diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp index 5102639..ff75b87 100644 --- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp +++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp @@ -173,8 +173,8 @@ public: auto Dest = TRI.regunits(CopyOperands->Destination->getReg().asMCReg()); auto Src = TRI.regunits(CopyOperands->Source->getReg().asMCReg()); - RegUnitsToInvalidate.insert(Dest.begin(), Dest.end()); - RegUnitsToInvalidate.insert(Src.begin(), Src.end()); + RegUnitsToInvalidate.insert_range(Dest); + RegUnitsToInvalidate.insert_range(Src); }; for (MCRegUnit Unit : TRI.regunits(Reg)) { diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index 19e8b44..9bd07da 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -2132,7 +2132,7 @@ void SwingSchedulerDAG::groupRemainingNodes(NodeSetType &NodeSets) { if (!Path.empty()) I.insert(Path.begin(), Path.end()); } - NodesAdded.insert(I.begin(), I.end()); + NodesAdded.insert_range(I); } // Create a new node set with the connected nodes of any successor of a node @@ -2246,12 +2246,12 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) { OrderKind Order; SmallSetVector<SUnit *, 8> N; if (pred_L(NodeOrder, N, DDG.get()) && llvm::set_is_subset(N, Nodes)) { - R.insert(N.begin(), N.end()); + R.insert_range(N); Order = BottomUp; LLVM_DEBUG(dbgs() << " Bottom up (preds) "); } else if (succ_L(NodeOrder, N, DDG.get()) && llvm::set_is_subset(N, Nodes)) { - R.insert(N.begin(), N.end()); + R.insert_range(N); Order = TopDown; LLVM_DEBUG(dbgs() << " Top down (succs) "); } else if (isIntersect(N, Nodes, R)) { @@ -2330,7 +2330,7 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) { LLVM_DEBUG(dbgs() << "\n Switching order to bottom up "); SmallSetVector<SUnit *, 8> N; if (pred_L(NodeOrder, N, DDG.get(), &Nodes)) - R.insert(N.begin(), N.end()); + R.insert_range(N); } else { // Choose the node with the maximum depth. If more than one, choose // the node with the maximum ZeroLatencyDepth. If still more than one, @@ -2385,7 +2385,7 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) { LLVM_DEBUG(dbgs() << "\n Switching order to top down "); SmallSetVector<SUnit *, 8> N; if (succ_L(NodeOrder, N, DDG.get(), &Nodes)) - R.insert(N.begin(), N.end()); + R.insert_range(N); } } LLVM_DEBUG(dbgs() << "\nDone with Nodeset\n"); diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 735e1f5..754c265 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -3286,7 +3286,7 @@ void MachineVerifier::calcRegsPassed() { VRegs.add(PredInfo.vregsPassed); } Info.vregsPassed.reserve(VRegs.size()); - Info.vregsPassed.insert(VRegs.begin(), VRegs.end()); + Info.vregsPassed.insert_range(VRegs); } } diff --git a/llvm/lib/CodeGen/RDFGraph.cpp b/llvm/lib/CodeGen/RDFGraph.cpp index 805b0ee..6d836af 100644 --- a/llvm/lib/CodeGen/RDFGraph.cpp +++ b/llvm/lib/CodeGen/RDFGraph.cpp @@ -1419,7 +1419,7 @@ void DataFlowGraph::recordDefsForDF(BlockRefsMap &PhiM, for (unsigned i = 0; i < IDF.size(); ++i) { auto F = MDF.find(IDF[i]); if (F != MDF.end()) - IDF.insert(F->second.begin(), F->second.end()); + IDF.insert_range(F->second); } // Finally, add the set of defs to each block in the iterated dominance diff --git a/llvm/lib/CodeGen/RDFLiveness.cpp b/llvm/lib/CodeGen/RDFLiveness.cpp index e4e21bb..3502e4b 100644 --- a/llvm/lib/CodeGen/RDFLiveness.cpp +++ b/llvm/lib/CodeGen/RDFLiveness.cpp @@ -763,7 +763,7 @@ void Liveness::computeLiveIns() { for (unsigned i = 0; i < IDFB.size(); ++i) { auto F2 = MDF.find(IDFB[i]); if (F2 != MDF.end()) - IDFB.insert(F2->second.begin(), F2->second.end()); + IDFB.insert_range(F2->second); } // Add B to the IDF(B). This will put B in the IIDF(B). IDFB.insert(&B); diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index e08c8b7..4a2d135 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -876,7 +876,7 @@ bool TailDuplicator::tailDuplicate(bool IsSimple, MachineBasicBlock *TailBB, bool Changed = false; SmallSetVector<MachineBasicBlock *, 8> Preds; if (CandidatePtr) - Preds.insert(CandidatePtr->begin(), CandidatePtr->end()); + Preds.insert_range(*CandidatePtr); else Preds.insert(TailBB->pred_begin(), TailBB->pred_end()); diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index ce6f6c73..9ac6e9c 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -606,7 +606,7 @@ PMTopLevelManager::setLastUser(ArrayRef<Pass*> AnalysisPasses, Pass *P) { auto &LastUsedByAP = InversedLastUser[AP]; for (Pass *L : LastUsedByAP) LastUser[L] = P; - InversedLastUser[P].insert(LastUsedByAP.begin(), LastUsedByAP.end()); + InversedLastUser[P].insert_range(LastUsedByAP); LastUsedByAP.clear(); } } diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index 6fb7494..f3b0b86 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -1636,7 +1636,7 @@ void Instruction::dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs) { return; // Nothing to remove! SmallSet<unsigned, 32> KnownSet; - KnownSet.insert(KnownIDs.begin(), KnownIDs.end()); + KnownSet.insert_range(KnownIDs); // A DIAssignID attachment is debug metadata, don't drop it. KnownSet.insert(LLVMContext::MD_DIAssignID); diff --git a/llvm/lib/IR/ReplaceConstant.cpp b/llvm/lib/IR/ReplaceConstant.cpp index c55a80a..a31cfe6 100644 --- a/llvm/lib/IR/ReplaceConstant.cpp +++ b/llvm/lib/IR/ReplaceConstant.cpp @@ -105,7 +105,7 @@ bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts, auto NewInsts = expandUser(BI, C); for (auto *NI : NewInsts) NI->setDebugLoc(Loc); - InstructionWorklist.insert(NewInsts.begin(), NewInsts.end()); + InstructionWorklist.insert_range(NewInsts); U.set(NewInsts.back()); } } diff --git a/llvm/lib/IR/SafepointIRVerifier.cpp b/llvm/lib/IR/SafepointIRVerifier.cpp index d32852b..f649f8f 100644 --- a/llvm/lib/IR/SafepointIRVerifier.cpp +++ b/llvm/lib/IR/SafepointIRVerifier.cpp @@ -171,7 +171,7 @@ protected: // Do not need to mark all in and out edges dead // because BB is marked dead and this is enough // to run further. - DeadBlocks.insert(Dom.begin(), Dom.end()); + DeadBlocks.insert_range(Dom); // Figure out the dominance-frontier(D). for (BasicBlock *B : Dom) @@ -750,7 +750,7 @@ void GCPtrTracker::gatherDominatingDefs(const BasicBlock *BB, auto BBS = getBasicBlockState(DTN->getBlock()); assert(BBS && "immediate dominator cannot be dead for a live block"); const auto &Defs = BBS->Contribution; - Result.insert(Defs.begin(), Defs.end()); + Result.insert_range(Defs); // If this block is 'Cleared', then nothing LiveIn to this block can be // available after this block completes. Note: This turns out to be // really important for reducing memory consuption of the initial available diff --git a/llvm/lib/TableGen/SetTheory.cpp b/llvm/lib/TableGen/SetTheory.cpp index ac7ae2c..22ebff7 100644 --- a/llvm/lib/TableGen/SetTheory.cpp +++ b/llvm/lib/TableGen/SetTheory.cpp @@ -228,7 +228,7 @@ struct SequenceOp : public SetTheory::Operator { Expr->getAsString()); // Try to reevaluate Rec in case it is a set. if (const RecVec *Result = ST.expand(Rec)) - Elts.insert(Result->begin(), Result->end()); + Elts.insert_range(*Result); else Elts.insert(Rec); @@ -283,7 +283,7 @@ void SetTheory::evaluate(const Init *Expr, RecSet &Elts, ArrayRef<SMLoc> Loc) { // A def in a list can be a just an element, or it may expand. if (const auto *Def = dyn_cast<DefInit>(Expr)) { if (const RecVec *Result = expand(Def->getDef())) - return Elts.insert(Result->begin(), Result->end()); + return Elts.insert_range(*Result); Elts.insert(Def->getDef()); return; } diff --git a/llvm/tools/llvm-exegesis/lib/Clustering.cpp b/llvm/tools/llvm-exegesis/lib/Clustering.cpp index fc79718..8f74dbf 100644 --- a/llvm/tools/llvm-exegesis/lib/Clustering.cpp +++ b/llvm/tools/llvm-exegesis/lib/Clustering.cpp @@ -149,7 +149,7 @@ void BenchmarkClustering::clusterizeDbScan(const size_t MinPts) { // Process P's neighbors. SetVector<size_t, std::deque<size_t>> ToProcess; - ToProcess.insert(Neighbors.begin(), Neighbors.end()); + ToProcess.insert_range(Neighbors); while (!ToProcess.empty()) { // Retrieve a point from the set. const size_t Q = *ToProcess.begin(); @@ -170,7 +170,7 @@ void BenchmarkClustering::clusterizeDbScan(const size_t MinPts) { // And extend to the neighbors of Q if the region is dense enough. rangeQuery(Q, Neighbors); if (Neighbors.size() + 1 >= MinPts) { - ToProcess.insert(Neighbors.begin(), Neighbors.end()); + ToProcess.insert_range(Neighbors); } } } diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index beed2dd..8b6f58a 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -3743,7 +3743,7 @@ int llvm_objdump_main(int argc, char **argv, const llvm::ToolContext &) { return 2; } - DisasmSymbolSet.insert(DisassembleSymbols.begin(), DisassembleSymbols.end()); + DisasmSymbolSet.insert_range(DisassembleSymbols); llvm::for_each(InputFilenames, dumpInput); diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp index e4fc381..472e49a 100644 --- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -242,8 +242,7 @@ void ProfiledBinary::load() { loadSymbolsFromDWARF(*cast<ObjectFile>(&ExeBinary)); } - DisassembleFunctionSet.insert(DisassembleFunctions.begin(), - DisassembleFunctions.end()); + DisassembleFunctionSet.insert_range(DisassembleFunctions); if (auto *ELFObj = dyn_cast<ELFObjectFileBase>(Obj)) { checkPseudoProbe(ELFObj); diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp index ed3ec92..7fc3797 100644 --- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp @@ -3322,7 +3322,7 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) { // Copy the args so we can take StringRefs to them. auto ArgsCopy = Args; SmallDenseSet<StringRef, 4> OperandsSet; - OperandsSet.insert(ArgsCopy.begin(), ArgsCopy.end()); + OperandsSet.insert_range(ArgsCopy); if (OperandsSet.count("")) P->error("Cannot have unnamed 'node' values in pattern fragment!"); diff --git a/llvm/utils/TableGen/OptionParserEmitter.cpp b/llvm/utils/TableGen/OptionParserEmitter.cpp index d17cad4..b1ca8de 100644 --- a/llvm/utils/TableGen/OptionParserEmitter.cpp +++ b/llvm/utils/TableGen/OptionParserEmitter.cpp @@ -281,7 +281,7 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) { DenseSet<StringRef> PrefixesUnionSet; for (const auto &[Prefix, _] : Prefixes) - PrefixesUnionSet.insert(Prefix.begin(), Prefix.end()); + PrefixesUnionSet.insert_range(Prefix); SmallVector<StringRef> PrefixesUnion(PrefixesUnionSet.begin(), PrefixesUnionSet.end()); array_pod_sort(PrefixesUnion.begin(), PrefixesUnion.end()); |