Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions llvm/lib/Transforms/IPO/Attributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ static bool getPotentialCopiesOfMemoryValue(
UsedAssumedInformation = true;
A.recordDependence(*PI, QueryingAA, DepClassTy::OPTIONAL);
}
PotentialCopies.insert(NewCopies.begin(), NewCopies.end());
PotentialCopies.insert_range(NewCopies);
if (PotentialValueOrigins)
PotentialValueOrigins->insert(NewCopyOrigins.begin(), NewCopyOrigins.end());
PotentialValueOrigins->insert_range(NewCopyOrigins);

return true;
}
Expand Down Expand Up @@ -2123,7 +2123,7 @@ void Attributor::runTillFixpoint() {

SmallVector<AbstractAttribute *, 32> ChangedAAs;
SetVector<AbstractAttribute *> Worklist, InvalidAAs;
Worklist.insert(DG.SyntheticRoot.begin(), DG.SyntheticRoot.end());
Worklist.insert_range(DG.SyntheticRoot);

do {
// Remember the size to determine new attributes.
Expand Down Expand Up @@ -2200,9 +2200,8 @@ void Attributor::runTillFixpoint() {
// Reset the work list and repopulate with the changed abstract attributes.
// Note that dependent ones are added above.
Worklist.clear();
Worklist.insert(ChangedAAs.begin(), ChangedAAs.end());
Worklist.insert(QueryAAsAwaitingUpdate.begin(),
QueryAAsAwaitingUpdate.end());
Worklist.insert_range(ChangedAAs);
Worklist.insert_range(QueryAAsAwaitingUpdate);
QueryAAsAwaitingUpdate.clear();

} while (!Worklist.empty() && (IterationCounter++ < MaxIterations));
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3735,7 +3735,7 @@ struct AAIntraFnReachabilityFunction final
}
}

DeadEdges.insert(LocalDeadEdges.begin(), LocalDeadEdges.end());
DeadEdges.insert_range(LocalDeadEdges);
return rememberResult(A, RQITy::Reachable::No, RQI, UsedExclusionSet,
IsTemporaryRQI);
}
Expand Down Expand Up @@ -12221,8 +12221,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
} else if (A.isClosedWorldModule()) {
ArrayRef<Function *> IndirectlyCallableFunctions =
A.getInfoCache().getIndirectlyCallableFunctions(A);
PotentialCallees.insert(IndirectlyCallableFunctions.begin(),
IndirectlyCallableFunctions.end());
PotentialCallees.insert_range(IndirectlyCallableFunctions);
}

if (PotentialCallees.empty())
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/FunctionImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ void llvm::ComputeCrossModuleImport(
else
++EI;
}
ELI.second.insert(NewExports.begin(), NewExports.end());
ELI.second.insert_range(NewExports);
}

assert(checkVariableImport(Index, ImportLists, ExportLists));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/GlobalDCE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void GlobalDCEPass::ComputeDependencies(Value *V,
for (User *CEUser : CE->users())
ComputeDependencies(CEUser, LocalDeps);
}
Deps.insert(LocalDeps.begin(), LocalDeps.end());
Deps.insert_range(LocalDeps);
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/HotColdSplitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ bool HotColdSplitting::outlineColdRegions(Function &F, bool HasProfileSummary) {
none_of(SubRegion, [&](BasicBlock *Block) {
return ColdBlocks.contains(Block);
})) {
ColdBlocks.insert(SubRegion.begin(), SubRegion.end());
ColdBlocks.insert_range(SubRegion);

LLVM_DEBUG({
for (auto *Block : SubRegion)
Expand Down
26 changes: 10 additions & 16 deletions llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ class CallsiteContextGraph {
? CallerEdges
: std::vector<std::shared_ptr<ContextEdge>>());
for (const auto &Edge : Edges)
ContextIds.insert(Edge->getContextIds().begin(),
Edge->getContextIds().end());
ContextIds.insert_range(Edge->getContextIds());
return ContextIds;
}

Expand Down Expand Up @@ -1372,7 +1371,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
for (auto Id : ContextIds)
if (auto NewId = OldToNewContextIds.find(Id);
NewId != OldToNewContextIds.end())
NewIds.insert(NewId->second.begin(), NewId->second.end());
NewIds.insert_range(NewId->second);
return NewIds;
};

Expand All @@ -1389,7 +1388,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
// Only need to recursively iterate to NextNode via this caller edge if
// it resulted in any added ids to NextNode.
if (!NewIdsToAdd.empty()) {
Edge->getContextIds().insert(NewIdsToAdd.begin(), NewIdsToAdd.end());
Edge->getContextIds().insert_range(NewIdsToAdd);
UpdateCallers(NextNode, Visited, UpdateCallers);
}
}
Expand Down Expand Up @@ -2534,8 +2533,7 @@ bool CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::calleesMatch(
// If there is already an edge between these nodes, simply update it and
// return.
if (CurEdge) {
CurEdge->ContextIds.insert(Edge->ContextIds.begin(),
Edge->ContextIds.end());
CurEdge->ContextIds.insert_range(Edge->ContextIds);
CurEdge->AllocTypes |= Edge->AllocTypes;
return;
}
Expand Down Expand Up @@ -3281,8 +3279,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
if (ExistingEdgeToNewCallee) {
// Since we already have an edge to NewCallee, simply move the ids
// onto it, and remove the existing Edge.
ExistingEdgeToNewCallee->getContextIds().insert(ContextIdsToMove.begin(),
ContextIdsToMove.end());
ExistingEdgeToNewCallee->getContextIds().insert_range(ContextIdsToMove);
ExistingEdgeToNewCallee->AllocTypes |= Edge->AllocTypes;
assert(Edge->ContextIds == ContextIdsToMove);
removeEdgeFromGraph(Edge.get());
Expand All @@ -3302,8 +3299,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
if (ExistingEdgeToNewCallee) {
// Since we already have an edge to NewCallee, simply move the ids
// onto it.
ExistingEdgeToNewCallee->getContextIds().insert(ContextIdsToMove.begin(),
ContextIdsToMove.end());
ExistingEdgeToNewCallee->getContextIds().insert_range(ContextIdsToMove);
ExistingEdgeToNewCallee->AllocTypes |= CallerEdgeAllocType;
} else {
// Otherwise, create a new edge to NewCallee for the ids being moved.
Expand Down Expand Up @@ -3350,8 +3346,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
// removed none type edges after creating the clone. If we can't find
// a corresponding edge there, fall through to the cloning below.
if (auto *NewCalleeEdge = NewCallee->findEdgeFromCallee(CalleeToUse)) {
NewCalleeEdge->getContextIds().insert(EdgeContextIdsToMove.begin(),
EdgeContextIdsToMove.end());
NewCalleeEdge->getContextIds().insert_range(EdgeContextIdsToMove);
NewCalleeEdge->AllocTypes |= computeAllocType(EdgeContextIdsToMove);
continue;
}
Expand Down Expand Up @@ -3402,8 +3397,8 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
if (ExistingEdgeToNewCaller) {
// Since we already have an edge to NewCaller, simply move the ids
// onto it, and remove the existing Edge.
ExistingEdgeToNewCaller->getContextIds().insert(
Edge->getContextIds().begin(), Edge->getContextIds().end());
ExistingEdgeToNewCaller->getContextIds().insert_range(
Edge->getContextIds());
ExistingEdgeToNewCaller->AllocTypes |= Edge->AllocTypes;
Edge->ContextIds.clear();
Edge->AllocTypes = (uint8_t)AllocationType::None;
Expand Down Expand Up @@ -3465,8 +3460,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
// edge, this may not hold true when recursive handling enabled.
assert(IsNewNode || ExistingCallerEdge || AllowRecursiveCallsites);
if (ExistingCallerEdge) {
ExistingCallerEdge->getContextIds().insert(EdgeContextIdsToMove.begin(),
EdgeContextIdsToMove.end());
ExistingCallerEdge->getContextIds().insert_range(EdgeContextIdsToMove);
ExistingCallerEdge->AllocTypes |=
computeAllocType(EdgeContextIdsToMove);
continue;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/MergeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ bool MergeFunctionsPass::runOnModule(Module &M) {
SmallVector<GlobalValue *, 4> UsedV;
collectUsedGlobalVariables(M, UsedV, /*CompilerUsed=*/false);
collectUsedGlobalVariables(M, UsedV, /*CompilerUsed=*/true);
MF.getUsed().insert(UsedV.begin(), UsedV.end());
MF.getUsed().insert_range(UsedV);
return MF.run(M);
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ struct BooleanStateWithSetVector : public BooleanState {
/// "Clamp" this state with \p RHS.
BooleanStateWithSetVector &operator^=(const BooleanStateWithSetVector &RHS) {
BooleanState::operator^=(RHS);
Set.insert(RHS.Set.begin(), RHS.Set.end());
Set.insert_range(RHS.Set);
return *this;
}

Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ void SampleProfileProber::computeBlocksToIgnore(
computeEHOnlyBlocks(*F, BlocksAndCallsToIgnore);
findUnreachableBlocks(BlocksAndCallsToIgnore);

BlocksToIgnore.insert(BlocksAndCallsToIgnore.begin(),
BlocksAndCallsToIgnore.end());
BlocksToIgnore.insert_range(BlocksAndCallsToIgnore);

// Handle the call-to-invoke conversion case: make sure that the probe id and
// callsite id are consistent before and after the block split. For block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ void BlockCoverageInference::getReachableAvoiding(const BasicBlock &Start,
Visited.insert(&Avoid);
if (IsForward) {
auto Range = depth_first_ext(&Start, Visited);
Reachable.insert(Range.begin(), Range.end());
Reachable.insert_range(Range);
} else {
auto Range = inverse_depth_first_ext(&Start, Visited);
Reachable.insert(Range.begin(), Range.end());
Reachable.insert_range(Range);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ checkHoistValue(Value *V, Instruction *InsertPoint, DominatorTree &DT,
if (AllOpsHoisted) {
CHR_DEBUG(dbgs() << "checkHoistValue " << *I << "\n");
if (HoistStops)
HoistStops->insert(OpsHoistStops.begin(), OpsHoistStops.end());
HoistStops->insert_range(OpsHoistStops);
Visited[I] = true;
return true;
}
Expand Down Expand Up @@ -1176,8 +1176,7 @@ SmallVector<CHRScope *, 8> CHR::splitScope(
// point. Union the bases.
PrevSplitFromOuter = false;
PrevConditionValues = *OuterConditionValues;
PrevConditionValues.insert(ConditionValues.begin(),
ConditionValues.end());
PrevConditionValues.insert_range(ConditionValues);
PrevInsertPoint = OuterInsertPoint;
}
} else {
Expand Down Expand Up @@ -1209,7 +1208,7 @@ SmallVector<CHRScope *, 8> CHR::splitScope(
});
} else {
// Not splitting. Union the bases. Keep the hoist point.
PrevConditionValues.insert(ConditionValues.begin(), ConditionValues.end());
PrevConditionValues.insert_range(ConditionValues);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ bool SanitizerBinaryMetadata::runOn(Instruction &I, MetadataInfoSet &MIS,

// Attach MD_pcsections to instruction.
if (!InstMetadata.empty()) {
MIS.insert(InstMetadata.begin(), InstMetadata.end());
MIS.insert_range(InstMetadata);
SmallVector<MDBuilder::PCSection, 1> Sections;
for (const auto &MI : InstMetadata)
Sections.push_back({getSectionName(MI->SectionSuffix), {}});
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/ObjCARC/PtrState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool RRInfo::Merge(const RRInfo &Other) {
CFGHazardAfflicted |= Other.CFGHazardAfflicted;

// Merge the call sets.
Calls.insert(Other.Calls.begin(), Other.Calls.end());
Calls.insert_range(Other.Calls);

// Merge the insert point sets. If there are any differences,
// that makes this a partial merge.
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static void findBestInsertionSet(DominatorTree &DT, BlockFrequencyInfo &BFI,
continue;

// Add nodes on the Path into Candidates.
Candidates.insert(Path.begin(), Path.end());
Candidates.insert_range(Path);
}

// Sort the nodes in Candidates in top-down order and save the nodes
Expand Down Expand Up @@ -283,7 +283,7 @@ static void findBestInsertionSet(DominatorTree &DT, BlockFrequencyInfo &BFI,
(InsertPtsFreq == BFI.getBlockFreq(Node) && InsertPts.size() > 1))
BBs.insert(Entry);
else
BBs.insert(InsertPts.begin(), InsertPts.end());
BBs.insert_range(InsertPts);
break;
}

Expand All @@ -304,7 +304,7 @@ static void findBestInsertionSet(DominatorTree &DT, BlockFrequencyInfo &BFI,
ParentInsertPts.insert(Node);
ParentPtsFreq += BFI.getBlockFreq(Node);
} else {
ParentInsertPts.insert(InsertPts.begin(), InsertPts.end());
ParentInsertPts.insert_range(InsertPts);
ParentPtsFreq += InsertPtsFreq;
}
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/GVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3194,7 +3194,7 @@ void GVNPass::addDeadBlock(BasicBlock *BB) {
// All blocks dominated by D are dead.
SmallVector<BasicBlock *, 8> Dom;
DT->getDescendants(D, Dom);
DeadBlocks.insert(Dom.begin(), Dom.end());
DeadBlocks.insert_range(Dom);

// Figure out the dominance-frontier(D).
for (BasicBlock *B : Dom) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/GVNSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ GVNSink::analyzeInstructionForSinking(LockstepReverseIterator<false> &LRI,
// values.
PHIContents.clear();
for (auto &PHI : NeededPHIs)
PHIContents.insert(PHI.getValues().begin(), PHI.getValues().end());
PHIContents.insert_range(PHI.getValues());
}

// Is this instruction required by a later PHI that doesn't match this PHI?
Expand Down Expand Up @@ -705,7 +705,7 @@ GVNSink::analyzeInstructionForSinking(LockstepReverseIterator<false> &LRI,

NeededPHIs.reserve(NeededPHIs.size());
NeededPHIs.insert(PHI);
PHIContents.insert(PHI.getValues().begin(), PHI.getValues().end());
PHIContents.insert_range(PHI.getValues());
}

if (isMemoryInst(NewInsts[0]))
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/LoopDistribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class InstPartition {
/// Moves this partition into \p Other. This partition becomes empty
/// after this.
void moveTo(InstPartition &Other) {
Other.Set.insert(Set.begin(), Set.end());
Other.Set.insert_range(Set);
Set.clear();
Other.DepCycle |= DepCycle;
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ bool LoopIdiomRecognize::processLoopStores(SmallVectorImpl<StoreInst *> &SL,
MaybeAlign(HeadStore->getAlign()), StoredVal,
HeadStore, AdjacentStores, StoreEv, BECount,
IsNegStride)) {
TransformedStores.insert(AdjacentStores.begin(), AdjacentStores.end());
TransformedStores.insert_range(AdjacentStores);
Changed = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/LoopSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ findBBsToSinkInto(const Loop &L, const SmallPtrSetImpl<BasicBlock *> &UseBBs,
if (UseBBs.size() == 0)
return BBsToSinkInto;

BBsToSinkInto.insert(UseBBs.begin(), UseBBs.end());
BBsToSinkInto.insert_range(UseBBs);
SmallPtrSet<BasicBlock *, 2> BBsDominatedByColdestBB;

// For every iteration:
Expand Down
9 changes: 4 additions & 5 deletions llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ bool LSRUse::InsertFormula(const Formula &F, const Loop &L) {
Formulae.push_back(F);

// Record registers now being used by this use.
Regs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
Regs.insert_range(F.BaseRegs);
if (F.ScaledReg)
Regs.insert(F.ScaledReg);

Expand All @@ -1759,7 +1759,7 @@ void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) {
Regs.clear();
for (const Formula &F : Formulae) {
if (F.ScaledReg) Regs.insert(F.ScaledReg);
Regs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
Regs.insert_range(F.BaseRegs);
}

// Update the RegTracker.
Expand Down Expand Up @@ -3215,8 +3215,7 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
SmallPtrSet<Instruction*,4> &NearUsers = ChainUsersVec[ChainIdx].NearUsers;
// This chain's NearUsers become FarUsers.
if (!LastIncExpr->isZero()) {
ChainUsersVec[ChainIdx].FarUsers.insert(NearUsers.begin(),
NearUsers.end());
ChainUsersVec[ChainIdx].FarUsers.insert_range(NearUsers);
NearUsers.clear();
}

Expand Down Expand Up @@ -5294,7 +5293,7 @@ void LSRInstance::NarrowSearchSpaceByDeletingCostlyFormulas() {
Formula &F = LU.Formulae[0];
LLVM_DEBUG(dbgs() << " Leaving only "; F.print(dbgs()); dbgs() << '\n');
// When we choose the formula, the regs become unique.
UniqRegs.insert(F.BaseRegs.begin(), F.BaseRegs.end());
UniqRegs.insert_range(F.BaseRegs);
if (F.ScaledReg)
UniqRegs.insert(F.ScaledReg);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,9 +1517,9 @@ PreservedAnalyses LoopFullUnrollPass::run(Loop &L, LoopAnalysisManager &AM,
Loop *ParentL = L.getParentLoop();
SmallPtrSet<Loop *, 4> OldLoops;
if (ParentL)
OldLoops.insert(ParentL->begin(), ParentL->end());
OldLoops.insert_range(*ParentL);
else
OldLoops.insert(AR.LI.begin(), AR.LI.end());
OldLoops.insert_range(AR.LI);

std::string LoopName = std::string(L.getName());

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/NewGVN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ NewGVN::makePossiblePHIOfOps(Instruction *I,

return nullptr;
}
Deps.insert(CurrentDeps.begin(), CurrentDeps.end());
Deps.insert_range(CurrentDeps);
} else {
LLVM_DEBUG(dbgs() << "Skipping phi of ops operand for incoming block "
<< getBlockName(PredBB)
Expand Down
Loading