diff options
author | Kazu Hirata <kazu@google.com> | 2025-04-27 15:59:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-27 15:59:57 -0700 |
commit | 5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9 (patch) | |
tree | bf1f97859ef5c2bf5c4b933e980905038092a06f /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | 25b05e0b234fe4d26f9717bf505566892479bee6 (diff) | |
download | llvm-5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9.zip llvm-5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9.tar.gz llvm-5cfd81b0cc9f92f3d4903f4e7b97769fe7b565b9.tar.bz2 |
[llvm] Use range constructors of *Set (NFC) (#137552)
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index bd777db..08fe3d4 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -1024,8 +1024,8 @@ bool MachineBlockPlacement::isTrellis( if (BB->succ_size() != 2 || ViableSuccs.size() != 2) return false; - SmallPtrSet<const MachineBasicBlock *, 2> Successors(BB->succ_begin(), - BB->succ_end()); + SmallPtrSet<const MachineBasicBlock *, 2> Successors(llvm::from_range, + BB->successors()); // To avoid reviewing the same predecessors twice. SmallPtrSet<const MachineBasicBlock *, 8> SeenPreds; @@ -1117,8 +1117,8 @@ MachineBlockPlacement::getBestTrellisSuccessor( const BlockFilterSet *BlockFilter) { BlockAndTailDupResult Result = {nullptr, false}; - SmallPtrSet<const MachineBasicBlock *, 4> Successors(BB->succ_begin(), - BB->succ_end()); + SmallPtrSet<const MachineBasicBlock *, 4> Successors(llvm::from_range, + BB->successors()); // We assume size 2 because it's common. For general n, we would have to do // the Hungarian algorithm, but it's not worth the complexity because more @@ -1209,8 +1209,8 @@ bool MachineBlockPlacement::canTailDuplicateUnplacedPreds( unsigned int NumDup = 0; // For CFG checking. - SmallPtrSet<const MachineBasicBlock *, 4> Successors(BB->succ_begin(), - BB->succ_end()); + SmallPtrSet<const MachineBasicBlock *, 4> Successors(llvm::from_range, + BB->successors()); for (MachineBasicBlock *Pred : Succ->predecessors()) { // Make sure all unplaced and unfiltered predecessors can be // tail-duplicated into. |