[llvm] cea1c63 - [MachineSink] Construct SmallVector with iterator ranges (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 21:17:02 PST 2021


Author: Kazu Hirata
Date: 2021-01-05T21:15:57-08:00
New Revision: cea1c63756f92f29595251943262b73f7f290f45

URL: https://github.com/llvm/llvm-project/commit/cea1c63756f92f29595251943262b73f7f290f45
DIFF: https://github.com/llvm/llvm-project/commit/cea1c63756f92f29595251943262b73f7f290f45.diff

LOG: [MachineSink] Construct SmallVector with iterator ranges (NFC)

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineSink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 42ab961b12e8..cede18b658ef 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -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.


        


More information about the llvm-commits mailing list