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
6 changes: 3 additions & 3 deletions llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ FunctionPropertiesUpdater::FunctionPropertiesUpdater(
// The successors may become unreachable in the case of `invoke` inlining.
// We track successors separately, too, because they form a boundary, together
// with the CB BB ('Entry') between which the inlined callee will be pasted.
Successors.insert(succ_begin(&CallSiteBB), succ_end(&CallSiteBB));
Successors.insert_range(successors(&CallSiteBB));

// the outcome of the inlining may be that some edges get lost (DCEd BBs
// because inlining brought some constant, for example). We don't know which
Expand All @@ -349,7 +349,7 @@ FunctionPropertiesUpdater::FunctionPropertiesUpdater(
// discounted BBs will be checked if reachable and re-added.
if (const auto *II = dyn_cast<InvokeInst>(&CB)) {
const auto *UnwindDest = II->getUnwindDest();
Successors.insert(succ_begin(UnwindDest), succ_end(UnwindDest));
Successors.insert_range(successors(UnwindDest));
// Same idea as above, we pretend we lose all these edges.
for (auto *Succ : successors(UnwindDest))
if (Inserted.insert(Succ).second)
Expand Down Expand Up @@ -454,7 +454,7 @@ void FunctionPropertiesUpdater::finish(FunctionAnalysisManager &FAM) const {
const auto *BB = Reinclude[I];
FPI.reIncludeBB(*BB);
if (I >= IncludeSuccessorsMark)
Reinclude.insert(succ_begin(BB), succ_end(BB));
Reinclude.insert_range(successors(BB));
}

// For exclusion, we don't need to exclude the set of BBs that were successors
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/CodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ bool CodeGenPrepare::canMergeBlocks(const BasicBlock *BB,
for (unsigned i = 0, e = BBPN->getNumIncomingValues(); i != e; ++i)
BBPreds.insert(BBPN->getIncomingBlock(i));
} else {
BBPreds.insert(pred_begin(BB), pred_end(BB));
BBPreds.insert_range(predecessors(BB));
}

// Walk the preds of DestBB.
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,11 @@ void MachineVerifier::visitMachineFunctionBefore() {
FunctionBlocks.insert(&MBB);
BBInfo &MInfo = MBBInfoMap[&MBB];

MInfo.Preds.insert(MBB.pred_begin(), MBB.pred_end());
MInfo.Preds.insert_range(MBB.predecessors());
if (MInfo.Preds.size() != MBB.pred_size())
report("MBB has duplicate entries in its predecessor list.", &MBB);

MInfo.Succs.insert(MBB.succ_begin(), MBB.succ_end());
MInfo.Succs.insert_range(MBB.successors());
if (MInfo.Succs.size() != MBB.succ_size())
report("MBB has duplicate entries in its successor list.", &MBB);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/TailDuplicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ bool TailDuplicator::tailDuplicate(bool IsSimple, MachineBasicBlock *TailBB,
if (CandidatePtr)
Preds.insert_range(*CandidatePtr);
else
Preds.insert(TailBB->pred_begin(), TailBB->pred_end());
Preds.insert_range(TailBB->predecessors());

for (MachineBasicBlock *PredBB : Preds) {
assert(TailBB != PredBB &&
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/SafepointIRVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void GCPtrTracker::recalculateBBsStates() {
transferBlock(BB, *BBS, ContributionChanged);
if (OldOutCount != BBS->AvailableOut.size()) {
assert(OldOutCount > BBS->AvailableOut.size() && "invariant!");
Worklist.insert(succ_begin(BB), succ_end(BB));
Worklist.insert_range(successors(BB));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ class AMDGPUInsertDelayAlu {
auto &MBB = *WorkList.pop_back_val();
bool Changed = runOnMachineBasicBlock(MBB, false);
if (Changed)
WorkList.insert(MBB.succ_begin(), MBB.succ_end());
WorkList.insert_range(MBB.successors());
}

LLVM_DEBUG(dbgs() << "Final pass over all BBs\n");
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/ARMISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11045,7 +11045,7 @@ void ARMTargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
SmallVectorImpl<MachineBasicBlock*> &MBBList = CallSiteNumToLPad[I];
for (MachineBasicBlock *MBB : MBBList) {
LPadList.push_back(MBB);
InvokeBBs.insert(MBB->pred_begin(), MBB->pred_end());
InvokeBBs.insert_range(MBB->predecessors());
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/VE/VEISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@ VETargetLowering::emitSjLjDispatchBlock(MachineInstr &MI,
for (unsigned CSI = 1; CSI <= MaxCSNum; ++CSI) {
for (auto &LP : CallSiteNumToLPad[CSI]) {
LPadList.push_back(LP);
InvokeBBs.insert(LP->pred_begin(), LP->pred_end());
InvokeBBs.insert_range(LP->predecessors());
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37269,7 +37269,7 @@ X86TargetLowering::EmitSjLjDispatchBlock(MachineInstr &MI,
for (unsigned CSI = 1; CSI <= MaxCSNum; ++CSI) {
for (auto &LP : CallSiteNumToLPad[CSI]) {
LPadList.push_back(LP);
InvokeBBs.insert(LP->pred_begin(), LP->pred_end());
InvokeBBs.insert_range(LP->predecessors());
}
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/LICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ class ControlFlowHoister {
// TODO: This could be expanded to allowing branches where both ends
// eventually converge to a single block.
SmallPtrSet<BasicBlock *, 4> TrueDestSucc, FalseDestSucc;
TrueDestSucc.insert(succ_begin(TrueDest), succ_end(TrueDest));
FalseDestSucc.insert(succ_begin(FalseDest), succ_end(FalseDest));
TrueDestSucc.insert_range(successors(TrueDest));
FalseDestSucc.insert_range(successors(FalseDest));
BasicBlock *CommonSucc = nullptr;
if (TrueDestSucc.count(FalseDest)) {
CommonSucc = FalseDest;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3302,7 +3302,7 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
Data.LiveIn[&BB].set_union(Data.LiveOut[&BB]);
Data.LiveIn[&BB].set_subtract(Data.KillSet[&BB]);
if (!Data.LiveIn[&BB].empty())
Worklist.insert(pred_begin(&BB), pred_end(&BB));
Worklist.insert_range(predecessors(&BB));
}

// Propagate that liveness until stable
Expand Down Expand Up @@ -3336,7 +3336,7 @@ static void computeLiveInValues(DominatorTree &DT, Function &F,
// assert: OldLiveIn is a subset of LiveTmp
if (OldLiveIn.size() != LiveTmp.size()) {
Data.LiveIn[BB] = LiveTmp;
Worklist.insert(pred_begin(BB), pred_end(BB));
Worklist.insert_range(predecessors(BB));
}
} // while (!Worklist.empty())

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ void llvm::SplitBlockAndInsertIfThenElse(
SmallPtrSet<BasicBlock *, 8> UniqueOrigSuccessors;
BasicBlock *Head = SplitBefore->getParent();
if (DTU) {
UniqueOrigSuccessors.insert(succ_begin(Head), succ_end(Head));
UniqueOrigSuccessors.insert_range(successors(Head));
Updates.reserve(4 + 2 * UniqueOrigSuccessors.size());
}

Expand Down