diff options
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocSimple.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp index e632e3599a..576d2b421c 100644 --- a/lib/CodeGen/RegAllocSimple.cpp +++ b/lib/CodeGen/RegAllocSimple.cpp @@ -41,7 +41,6 @@ namespace { MachineFunction *MF; const TargetMachine *TM; const MRegisterInfo *RegInfo; - bool *PhysRegsEverUsed; // StackSlotForVirtReg - Maps SSA Regs => frame index on the stack where // these values are spilled @@ -126,7 +125,7 @@ unsigned RegAllocSimple::getFreeReg(unsigned virtualReg) { unsigned PhysReg = *(RI+regIdx); if (!RegsUsed[PhysReg]) { - PhysRegsEverUsed[PhysReg] = true; + MF->setPhysRegUsed(PhysReg); return PhysReg; } } @@ -178,7 +177,7 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) { if (Desc.ImplicitDefs) { for (Regs = Desc.ImplicitDefs; *Regs; ++Regs) { RegsUsed[*Regs] = true; - PhysRegsEverUsed[*Regs] = true; + MF->setPhysRegUsed(*Regs); } } @@ -236,10 +235,6 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) { TM = &MF->getTarget(); RegInfo = TM->getRegisterInfo(); - PhysRegsEverUsed = new bool[RegInfo->getNumRegs()]; - std::fill(PhysRegsEverUsed, PhysRegsEverUsed+RegInfo->getNumRegs(), false); - Fn.setUsedPhysRegs(PhysRegsEverUsed); - // Loop over all of the basic blocks, eliminating virtual register references for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); MBB != MBBe; ++MBB) |