[llvm] r312845 - RegAllocFast: Move vector to class level to avoid reallocation; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 8 17:52:45 PDT 2017
Author: matze
Date: Fri Sep 8 17:52:45 2017
New Revision: 312845
URL: http://llvm.org/viewvc/llvm-project?rev=312845&view=rev
Log:
RegAllocFast: Move vector to class level to avoid reallocation; NFC
Modified:
llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=312845&r1=312844&r2=312845&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Fri Sep 8 17:52:45 2017
@@ -112,6 +112,9 @@ namespace {
// 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 @@ void RAFast::AllocateBasicBlock() {
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()) {
More information about the llvm-commits
mailing list