-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
[CodeGen] Use llvm::append_range (NFC) #135567
Conversation
@llvm/pr-subscribers-llvm-regalloc Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135567.diff 6 Files Affected:
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 062283975851a..55d1350e446ab 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -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());
}
}
@@ -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
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index ac68eb55a6fd5..ee271234d3119 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 1ac1a770ae72f..df3dd41965485 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index dbd354f2ca2c4..c27435aa2dae0 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -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});
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 5210372dd935f..83fade45d1892 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -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);
}
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 083b984444bcb..598de6b207754 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -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;
}
}
|
@llvm/pr-subscribers-llvm-selectiondag Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135567.diff 6 Files Affected:
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 062283975851a..55d1350e446ab 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -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());
}
}
@@ -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
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index ac68eb55a6fd5..ee271234d3119 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 1ac1a770ae72f..df3dd41965485 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index dbd354f2ca2c4..c27435aa2dae0 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -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});
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 5210372dd935f..83fade45d1892 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -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);
}
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 083b984444bcb..598de6b207754 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -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;
}
}
|
@llvm/pr-subscribers-llvm-globalisel Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135567.diff 6 Files Affected:
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 062283975851a..55d1350e446ab 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -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());
}
}
@@ -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
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index ac68eb55a6fd5..ee271234d3119 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 1ac1a770ae72f..df3dd41965485 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -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
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index dbd354f2ca2c4..c27435aa2dae0 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -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});
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index 5210372dd935f..83fade45d1892 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -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);
}
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 083b984444bcb..598de6b207754 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -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;
}
}
|
No description provided.