From baaab7f68363c54a7b5019ad59028c718d048ea4 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Sat, 9 Sep 2017 00:52:45 +0000 Subject: [PATCH] RegAllocFast: Move vector to class level to avoid reallocation; NFC llvm-svn: 312845 --- lib/CodeGen/RegAllocFast.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp index ae0114f326f..ef3cc16cd05 100644 --- a/lib/CodeGen/RegAllocFast.cpp +++ b/lib/CodeGen/RegAllocFast.cpp @@ -112,6 +112,9 @@ namespace { // PhysRegState - One of the RegState enums, or a virtreg. std::vector PhysRegState; + SmallVector VirtDead; + SmallVector Coalesced; + // Set of register units. typedef SparseSet UsedInInstrSet; @@ -810,8 +813,8 @@ void RAFast::AllocateBasicBlock() { if (MRI->isAllocatable(LI.PhysReg)) definePhysReg(*MII, LI.PhysReg, regReserved); - SmallVector VirtDead; - SmallVector Coalesced; + VirtDead.clear(); + Coalesced.clear(); // Otherwise, sequentially allocate each instruction in the MBB. while (MII != MBB->end()) {