[MachineSink] Construct SmallVector with iterator ranges (NFC)

This commit is contained in:
Kazu Hirata 2021-01-05 21:15:57 -08:00
parent 441650d589
commit cea1c63756
1 changed files with 2 additions and 3 deletions

View File

@ -1588,7 +1588,6 @@ bool PostRAMachineSinking::tryToSinkCopy(MachineBasicBlock &CurBB,
// recorded which reg units that DBG_VALUEs read, if this instruction
// writes any of those units then the corresponding DBG_VALUEs must sink.
SetVector<MachineInstr *> DbgValsToSinkSet;
SmallVector<MachineInstr *, 4> DbgValsToSink;
for (auto &MO : MI->operands()) {
if (!MO.isReg() || !MO.isDef())
continue;
@ -1598,8 +1597,8 @@ bool PostRAMachineSinking::tryToSinkCopy(MachineBasicBlock &CurBB,
for (auto *MI : SeenDbgInstrs.lookup(Reg))
DbgValsToSinkSet.insert(MI);
}
DbgValsToSink.insert(DbgValsToSink.begin(), DbgValsToSinkSet.begin(),
DbgValsToSinkSet.end());
SmallVector<MachineInstr *, 4> DbgValsToSink(DbgValsToSinkSet.begin(),
DbgValsToSinkSet.end());
// Clear the kill flag if SrcReg is killed between MI and the end of the
// block.