Skip to content

[CodeGen] Use llvm::append_range (NFC) #135567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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: 2 additions & 4 deletions llvm/lib/CodeGen/AsmPrinter/WinException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ void WinException::endFunction(const MachineFunction *MF) {

if (!MF->getEHContTargets().empty()) {
// Copy the function's EH Continuation targets to a module-level list.
EHContTargets.insert(EHContTargets.end(), MF->getEHContTargets().begin(),
MF->getEHContTargets().end());
llvm::append_range(EHContTargets, MF->getEHContTargets());
}
}

Expand Down Expand Up @@ -292,8 +291,7 @@ void WinException::endFuncletImpl() {

if (!MF->getEHContTargets().empty()) {
// Copy the function's EH Continuation targets to a module-level list.
EHContTargets.insert(EHContTargets.end(), MF->getEHContTargets().begin(),
MF->getEHContTargets().end());
llvm::append_range(EHContTargets, MF->getEHContTargets());
}

// Switch back to the funclet start .text section now that we are done
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::narrowScalar(MachineInstr &MI,
LLT GCDTy = extractGCDType(WidenedXors, NarrowTy, LeftoverTy, Xor);
buildLCMMergePieces(LeftoverTy, NarrowTy, GCDTy, WidenedXors,
/* PadStrategy = */ TargetOpcode::G_ZEXT);
Xors.insert(Xors.end(), WidenedXors.begin(), WidenedXors.end());
llvm::append_range(Xors, WidenedXors);
}

// Now, for each part we broke up, we know if they are equal/not equal
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/MachineLICM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,7 @@ void MachineLICMImpl::InitializeLoadsHoistableLoops() {
auto *L = Worklist.pop_back_val();
AllowedToHoistLoads[L] = true;
LoopsInPreOrder.push_back(L);
Worklist.insert(Worklist.end(), L->getSubLoops().begin(),
L->getSubLoops().end());
llvm::append_range(Worklist, L->getSubLoops());
}

// Going from the innermost to outermost loops, check if a loop has
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/RegisterCoalescer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3814,8 +3814,7 @@ bool RegisterCoalescer::joinVirtRegs(CoalescerPair &CP) {
// into an existing tracking collection, or insert a new one.
RegIt = RegToPHIIdx.find(CP.getDstReg());
if (RegIt != RegToPHIIdx.end())
RegIt->second.insert(RegIt->second.end(), InstrNums.begin(),
InstrNums.end());
llvm::append_range(RegIt->second, InstrNums);
else
RegToPHIIdx.insert({CP.getDstReg(), InstrNums});
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ SDNode *DAGTypeLegalizer::AnalyzeNewNode(SDNode *N) {
NewOps.push_back(Op);
} else if (Op != OrigOp) {
// This is the first operand to change - add all operands so far.
NewOps.insert(NewOps.end(), N->op_begin(), N->op_begin() + i);
llvm::append_range(NewOps, N->ops().take_front(i));
NewOps.push_back(Op);
}
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ void SelectionDAGISel::SelectInlineAsmMemoryOperands(std::vector<SDValue> &Ops,
SelOps.size());
Flags.setMemConstraint(ConstraintID);
Handles.emplace_back(CurDAG->getTargetConstant(Flags, DL, MVT::i32));
Handles.insert(Handles.end(), SelOps.begin(), SelOps.end());
llvm::append_range(Handles, SelOps);
i += 2;
}
}
Expand Down
Loading