Skip to content

Commit

Permalink
[CodeGen] Construct SmallVector with iterator ranges (NFC) (llvm#105622)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored and cjdb committed Aug 23, 2024
1 parent 90d12e9 commit fdcde88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/MachineSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,7 @@ bool MachineSinking::runOnMachineFunction(MachineFunction &MF) {
}

if (SinkInstsIntoCycle) {
SmallVector<MachineCycle *, 8> Cycles(CI->toplevel_begin(),
CI->toplevel_end());
SmallVector<MachineCycle *, 8> Cycles(CI->toplevel_cycles());
for (auto *Cycle : Cycles) {
MachineBasicBlock *Preheader = Cycle->getCyclePreheader();
if (!Preheader) {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/ShrinkWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,7 @@ hasDirtyPred(const DenseSet<const MachineBasicBlock *> &ReachableByDirty,
/// Derives the list of all the basic blocks reachable from MBB.
static void markAllReachable(DenseSet<const MachineBasicBlock *> &Visited,
const MachineBasicBlock &MBB) {
SmallVector<MachineBasicBlock *, 4> Worklist(MBB.succ_begin(),
MBB.succ_end());
SmallVector<MachineBasicBlock *, 4> Worklist(MBB.successors());
Visited.insert(&MBB);
while (!Worklist.empty()) {
MachineBasicBlock *SuccMBB = Worklist.pop_back_val();
Expand Down

0 comments on commit fdcde88

Please sign in to comment.