[llvm] Use *Set::insert_range (NFC) (#138237)
This commit is contained in:
@@ -287,8 +287,7 @@ void LexicalScopes::getMachineBasicBlocks(
|
||||
return;
|
||||
|
||||
if (Scope == CurrentFnLexicalScope) {
|
||||
for (const auto &MBB : *MF)
|
||||
MBBs.insert(&MBB);
|
||||
MBBs.insert_range(llvm::make_pointer_range(*MF));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1330,8 +1330,8 @@ RISCVVLOptimizer::checkUsers(const MachineInstr &MI) const {
|
||||
UserMI.getOperand(0).getSubReg() == RISCV::NoSubRegister &&
|
||||
UserMI.getOperand(1).getSubReg() == RISCV::NoSubRegister) {
|
||||
LLVM_DEBUG(dbgs() << " Peeking through uses of COPY\n");
|
||||
for (auto &CopyUse : MRI->use_operands(UserMI.getOperand(0).getReg()))
|
||||
Worklist.insert(&CopyUse);
|
||||
Worklist.insert_range(llvm::make_pointer_range(
|
||||
MRI->use_operands(UserMI.getOperand(0).getReg())));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1340,8 +1340,8 @@ RISCVVLOptimizer::checkUsers(const MachineInstr &MI) const {
|
||||
if (!PHISeen.insert(&UserMI).second)
|
||||
continue;
|
||||
LLVM_DEBUG(dbgs() << " Peeking through uses of PHI\n");
|
||||
for (auto &PhiUse : MRI->use_operands(UserMI.getOperand(0).getReg()))
|
||||
Worklist.insert(&PhiUse);
|
||||
Worklist.insert_range(llvm::make_pointer_range(
|
||||
MRI->use_operands(UserMI.getOperand(0).getReg())));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -626,8 +626,7 @@ static void followUsesInContext(AAType &AA, Attributor &A,
|
||||
if (const Instruction *UserI = dyn_cast<Instruction>(U->getUser())) {
|
||||
bool Found = Explorer.findInContextOf(UserI, EIt, EEnd);
|
||||
if (Found && AA.followUseInMBEC(A, U, UserI, State))
|
||||
for (const Use &Us : UserI->uses())
|
||||
Uses.insert(&Us);
|
||||
Uses.insert_range(llvm::make_pointer_range(UserI->uses()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7557,8 +7557,7 @@ bool SimplifyCFGOpt::simplifyDuplicateSwitchArms(SwitchInst *SI,
|
||||
if (Seen.insert(BB).second) {
|
||||
// Keep track of which PHIs we need as keys in PhiPredIVs below.
|
||||
for (BasicBlock *Succ : BI->successors())
|
||||
for (PHINode &Phi : Succ->phis())
|
||||
Phis.insert(&Phi);
|
||||
Phis.insert_range(llvm::make_pointer_range(Succ->phis()));
|
||||
// Add the successor only if not previously visited.
|
||||
Cases.emplace_back(SwitchSuccWrapper{BB, &PhiPredIVs});
|
||||
}
|
||||
|
||||
@@ -150,8 +150,7 @@ opportunities(Function &F,
|
||||
// Regardless whether referenced, add the function arguments as
|
||||
// replacement possibility with the goal of reducing the number of (used)
|
||||
// function arguments, possibly created by the operands-to-args.
|
||||
for (Argument &Arg : F.args())
|
||||
ReferencedVals.insert(&Arg);
|
||||
ReferencedVals.insert_range(llvm::make_pointer_range(F.args()));
|
||||
|
||||
// After all candidates have been added, it doesn't need to be a set
|
||||
// anymore.
|
||||
|
||||
Reference in New Issue
Block a user