aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachinePipeliner.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-03-20 22:24:06 -0700
committerGitHub <noreply@github.com>2025-03-20 22:24:06 -0700
commit599005686a1c27ffe97bb4eb07fcd98359a2af99 (patch)
tree044944abd13d5134772d7507fef23ac7a6a52a21 /llvm/lib/CodeGen/MachinePipeliner.cpp
parent13bb2f450ef9f64f393fe5527e5ac68362af8ccd (diff)
downloadllvm-599005686a1c27ffe97bb4eb07fcd98359a2af99.zip
llvm-599005686a1c27ffe97bb4eb07fcd98359a2af99.tar.gz
llvm-599005686a1c27ffe97bb4eb07fcd98359a2af99.tar.bz2
[llvm] Use *Set::insert_range (NFC) (#132325)
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently gained C++23-style insert_range. This patch replaces: Dest.insert(Src.begin(), Src.end()); with: Dest.insert_range(Src); This patch does not touch custom begin like succ_begin for now.
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachinePipeliner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 19e8b44..9bd07da 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -2132,7 +2132,7 @@ void SwingSchedulerDAG::groupRemainingNodes(NodeSetType &NodeSets) {
if (!Path.empty())
I.insert(Path.begin(), Path.end());
}
- NodesAdded.insert(I.begin(), I.end());
+ NodesAdded.insert_range(I);
}
// Create a new node set with the connected nodes of any successor of a node
@@ -2246,12 +2246,12 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) {
OrderKind Order;
SmallSetVector<SUnit *, 8> N;
if (pred_L(NodeOrder, N, DDG.get()) && llvm::set_is_subset(N, Nodes)) {
- R.insert(N.begin(), N.end());
+ R.insert_range(N);
Order = BottomUp;
LLVM_DEBUG(dbgs() << " Bottom up (preds) ");
} else if (succ_L(NodeOrder, N, DDG.get()) &&
llvm::set_is_subset(N, Nodes)) {
- R.insert(N.begin(), N.end());
+ R.insert_range(N);
Order = TopDown;
LLVM_DEBUG(dbgs() << " Top down (succs) ");
} else if (isIntersect(N, Nodes, R)) {
@@ -2330,7 +2330,7 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) {
LLVM_DEBUG(dbgs() << "\n Switching order to bottom up ");
SmallSetVector<SUnit *, 8> N;
if (pred_L(NodeOrder, N, DDG.get(), &Nodes))
- R.insert(N.begin(), N.end());
+ R.insert_range(N);
} else {
// Choose the node with the maximum depth. If more than one, choose
// the node with the maximum ZeroLatencyDepth. If still more than one,
@@ -2385,7 +2385,7 @@ void SwingSchedulerDAG::computeNodeOrder(NodeSetType &NodeSets) {
LLVM_DEBUG(dbgs() << "\n Switching order to top down ");
SmallSetVector<SUnit *, 8> N;
if (succ_L(NodeOrder, N, DDG.get(), &Nodes))
- R.insert(N.begin(), N.end());
+ R.insert_range(N);
}
}
LLVM_DEBUG(dbgs() << "\nDone with Nodeset\n");