Skip to content

Commit fdcde88

Browse files
kazutakahiratacjdb
authored andcommitted
[CodeGen] Construct SmallVector with iterator ranges (NFC) (llvm#105622)
1 parent 90d12e9 commit fdcde88

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/CodeGen/MachineSink.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,7 @@ bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
766766
}
767767

768768
if (SinkInstsIntoCycle) {
769-
SmallVector<MachineCycle *, 8> Cycles(CI->toplevel_begin(),
770-
CI->toplevel_end());
769+
SmallVector<MachineCycle *, 8> Cycles(CI->toplevel_cycles());
771770
for (auto *Cycle : Cycles) {
772771
MachineBasicBlock *Preheader = Cycle->getCyclePreheader();
773772
if (!Preheader) {

llvm/lib/CodeGen/ShrinkWrap.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@ hasDirtyPred(const DenseSet<const MachineBasicBlock *> &ReachableByDirty,
411411
/// Derives the list of all the basic blocks reachable from MBB.
412412
static void markAllReachable(DenseSet<const MachineBasicBlock *> &Visited,
413413
const MachineBasicBlock &MBB) {
414-
SmallVector<MachineBasicBlock *, 4> Worklist(MBB.succ_begin(),
415-
MBB.succ_end());
414+
SmallVector<MachineBasicBlock *, 4> Worklist(MBB.successors());
416415
Visited.insert(&MBB);
417416
while (!Worklist.empty()) {
418417
MachineBasicBlock *SuccMBB = Worklist.pop_back_val();

0 commit comments

Comments
 (0)