RegAllocFast: Move vector to class level to avoid reallocation; NFC
llvm-svn: 312845
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index ae0114f..ef3cc16 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -112,6 +112,9 @@
// PhysRegState - One of the RegState enums, or a virtreg.
std::vector<unsigned> PhysRegState;
+ SmallVector<unsigned, 16> VirtDead;
+ SmallVector<MachineInstr*, 32> Coalesced;
+
// Set of register units.
typedef SparseSet<unsigned> UsedInInstrSet;
@@ -810,8 +813,8 @@
if (MRI->isAllocatable(LI.PhysReg))
definePhysReg(*MII, LI.PhysReg, regReserved);
- SmallVector<unsigned, 8> VirtDead;
- SmallVector<MachineInstr*, 32> Coalesced;
+ VirtDead.clear();
+ Coalesced.clear();
// Otherwise, sequentially allocate each instruction in the MBB.
while (MII != MBB->end()) {