diff options
author | Kazu Hirata <kazu@google.com> | 2025-03-20 22:24:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-20 22:24:06 -0700 |
commit | 599005686a1c27ffe97bb4eb07fcd98359a2af99 (patch) | |
tree | 044944abd13d5134772d7507fef23ac7a6a52a21 /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | 13bb2f450ef9f64f393fe5527e5ac68362af8ccd (diff) | |
download | llvm-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.cpp | 10 |
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"); |