diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-01-17 00:35:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-17 00:35:26 +0000 |
commit | 9e66d8c6f8e2ff23fa0bfc04ea61c4a323784ced (patch) | |
tree | 2cc06572640a2b3f7e2a3cb1caa250b17f266736 /lib/CodeGen/RegAllocLocal.cpp | |
parent | e8b886aa842369e1e1d5ab25c16e05690adbaa33 (diff) | |
download | external_llvm-9e66d8c6f8e2ff23fa0bfc04ea61c4a323784ced.zip external_llvm-9e66d8c6f8e2ff23fa0bfc04ea61c4a323784ced.tar.gz external_llvm-9e66d8c6f8e2ff23fa0bfc04ea61c4a323784ced.tar.bz2 |
Replace std::vector<bool> with BitVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 2941824..3654efd 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -91,13 +91,15 @@ namespace { // scavenged. If a virtual register has simply been rematerialized, there // is no reason to spill it to memory when we need the register back. // - std::vector<bool> VirtRegModified; + BitVector VirtRegModified; void markVirtRegModified(unsigned Reg, bool Val = true) { assert(MRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!"); Reg -= MRegisterInfo::FirstVirtualRegister; - if (VirtRegModified.size() <= Reg) VirtRegModified.resize(Reg+1); - VirtRegModified[Reg] = Val; + if (Val) + VirtRegModified.set(Reg); + else + VirtRegModified.reset(Reg); } bool isVirtRegModified(unsigned Reg) const { @@ -819,7 +821,9 @@ bool RALocal::runOnMachineFunction(MachineFunction &Fn) { // initialize the virtual->physical register map to have a 'null' // mapping for all virtual registers - Virt2PhysRegMap.grow(MF->getRegInfo().getLastVirtReg()); + unsigned LastVirtReg = MF->getRegInfo().getLastVirtReg(); + Virt2PhysRegMap.grow(LastVirtReg); + VirtRegModified.resize(LastVirtReg-MRegisterInfo::FirstVirtualRegister); // Loop over all of the basic blocks, eliminating virtual register references for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); |