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
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/CodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7576,8 +7576,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
else if (FalseBlock == nullptr)
FalseBlock = StartBlock;

SmallPtrSet<const Instruction *, 2> INS;
INS.insert_range(ASI);
SmallPtrSet<const Instruction *, 2> INS(llvm::from_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.
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/IR/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1635,8 +1635,7 @@ void Instruction::dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs) {
if (!Value::hasMetadata())
return; // Nothing to remove!

SmallSet<unsigned, 32> KnownSet;
KnownSet.insert_range(KnownIDs);
SmallSet<unsigned, 32> KnownSet(llvm::from_range, KnownIDs);

// A DIAssignID attachment is debug metadata, don't drop it.
KnownSet.insert(LLVMContext::MD_DIAssignID);
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/AArch64/AArch64Subtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,7 @@ AArch64Subtarget::AArch64Subtarget(const Triple &TT, StringRef CPU,
RegBankInfo.reset(RBI);

auto TRI = getRegisterInfo();
StringSet<> ReservedRegNames;
ReservedRegNames.insert_range(ReservedRegsForRA);
StringSet<> ReservedRegNames(llvm::from_range, ReservedRegsForRA);
for (unsigned i = 0; i < 29; ++i) {
if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
ReserveXRegisterForRA.set(i);
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,7 @@ bool LowOverheadLoop::ValidateTailPredicate() {
!RDA.hasLocalDefBefore(VCTP, VCTP->getOperand(1).getReg())) {
if (auto *Def = RDA.getUniqueReachingMIDef(
&Preheader->back(), VCTP->getOperand(1).getReg().asMCReg())) {
SmallPtrSet<MachineInstr*, 2> Ignore;
Ignore.insert_range(VCTPs);
SmallPtrSet<MachineInstr *, 2> Ignore(llvm::from_range, VCTPs);
TryRemove(Def, RDA, ToRemove, Ignore);
}
}
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ static void addHints(ArrayRef<MCPhysReg> Order,
SmallVectorImpl<MCPhysReg> &Hints,
const TargetRegisterClass *RC,
const MachineRegisterInfo *MRI) {
SmallSet<unsigned, 4> CopyHints;
CopyHints.insert_range(Hints);
SmallSet<unsigned, 4> CopyHints(llvm::from_range, Hints);
Hints.clear();
for (MCPhysReg Reg : Order)
if (CopyHints.count(Reg) &&
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/X86/X86RegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,7 @@ bool X86RegisterInfo::getRegAllocationHints(Register VirtReg,
Hints.push_back(PhysReg);
};

SmallSet<MCPhysReg, 4> CopyHints;
CopyHints.insert_range(Hints);
SmallSet<MCPhysReg, 4> CopyHints(llvm::from_range, Hints);
Hints.clear();
for (auto Hint : CopyHints) {
if (RC.contains(Hint) && !MRI->isReserved(Hint))
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,7 @@ void FunctionInstrumenter::instrument() {
InstrumentBBs.size() + FuncInfo.SIVisitor.getNumOfSelectInsts();

if (IsCtxProf) {
StringSet<> SkipCSInstr;
SkipCSInstr.insert(CtxPGOSkipCallsiteInstrument.begin(),
CtxPGOSkipCallsiteInstrument.end());
StringSet<> SkipCSInstr(llvm::from_range, CtxPGOSkipCallsiteInstrument);

auto *CSIntrinsic =
Intrinsic::getOrInsertDeclaration(&M, Intrinsic::instrprof_callsite);
Expand Down
7 changes: 4 additions & 3 deletions llvm/lib/Transforms/Scalar/LICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,10 @@ class ControlFlowHoister {
// intersection of their successors is non-empty.
// TODO: This could be expanded to allowing branches where both ends
// eventually converge to a single block.
SmallPtrSet<BasicBlock *, 4> TrueDestSucc, FalseDestSucc;
TrueDestSucc.insert_range(successors(TrueDest));
FalseDestSucc.insert_range(successors(FalseDest));
SmallPtrSet<BasicBlock *, 4> TrueDestSucc(llvm::from_range,
successors(TrueDest));
SmallPtrSet<BasicBlock *, 4> FalseDestSucc(llvm::from_range,
successors(FalseDest));
BasicBlock *CommonSucc = nullptr;
if (TrueDestSucc.count(FalseDest)) {
CommonSucc = FalseDest;
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Utils/LoopUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,7 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
// Finally, the blocks from loopinfo. This has to happen late because
// otherwise our loop iterators won't work.

SmallPtrSet<BasicBlock *, 8> blocks;
blocks.insert_range(L->blocks());
SmallPtrSet<BasicBlock *, 8> blocks(llvm::from_range, L->blocks());
for (BasicBlock *BB : blocks)
LI->removeBlock(BB);

Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-exegesis/lib/Clustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ void BenchmarkClustering::clusterizeDbScan(const size_t MinPts) {
CurrentCluster.PointIndices.push_back(P);

// Process P's neighbors.
SetVector<size_t, std::deque<size_t>> ToProcess;
ToProcess.insert_range(Neighbors);
SetVector<size_t, std::deque<size_t>> ToProcess(llvm::from_range,
Neighbors);
while (!ToProcess.empty()) {
// Retrieve a point from the set.
const size_t Q = *ToProcess.begin();
Expand Down
3 changes: 1 addition & 2 deletions llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3321,8 +3321,7 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) {
std::vector<std::string> &Args = P->getArgList();
// Copy the args so we can take StringRefs to them.
auto ArgsCopy = Args;
SmallDenseSet<StringRef, 4> OperandsSet;
OperandsSet.insert_range(ArgsCopy);
SmallDenseSet<StringRef, 4> OperandsSet(llvm::from_range, ArgsCopy);

if (OperandsSet.count(""))
P->error("Cannot have unnamed 'node' values in pattern fragment!");
Expand Down