diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-04-25 22:13:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-04-25 22:13:27 +0000 |
commit | 0ba174534c82369dbea4b9e4c715ca6df27e67c7 (patch) | |
tree | 701ace8dc871d49f6526a8b17626a8f27ce21012 /llvm/lib/CodeGen/RegAllocLocal.cpp | |
parent | d21968d11a715b60091cc26ffb8f92f7983ae263 (diff) | |
download | bcm5719-llvm-0ba174534c82369dbea4b9e4c715ca6df27e67c7.tar.gz bcm5719-llvm-0ba174534c82369dbea4b9e4c715ca6df27e67c7.zip |
Match MachineFunction::UsedPhysRegs changes.
llvm-svn: 36452
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocLocal.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp index f862023e8f8..d3d5796e851 100644 --- a/llvm/lib/CodeGen/RegAllocLocal.cpp +++ b/llvm/lib/CodeGen/RegAllocLocal.cpp @@ -47,7 +47,6 @@ namespace { MachineFunction *MF; const MRegisterInfo *RegInfo; LiveVariables *LV; - bool *PhysRegsEverUsed; // StackSlotForVirtReg - Maps virtual regs to the frame index where these // values are spilled. @@ -511,7 +510,7 @@ MachineInstr *RA::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI, RegInfo->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC); ++NumLoads; // Update statistics - PhysRegsEverUsed[PhysReg] = true; + MF->setPhysRegUsed(PhysReg); MI->getOperand(OpNum).setReg(PhysReg); // Assign the input register return MI; } @@ -532,7 +531,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { for (MachineFunction::livein_iterator I = MF->livein_begin(), E = MF->livein_end(); I != E; ++I) { unsigned Reg = I->first; - PhysRegsEverUsed[Reg] = true; + MF->setPhysRegUsed(Reg); PhysRegsUsed[Reg] = 0; // It is free and reserved now PhysRegsUseOrder.push_back(Reg); for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg); @@ -540,7 +539,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { if (PhysRegsUsed[*AliasSet] != -2) { PhysRegsUseOrder.push_back(*AliasSet); PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now - PhysRegsEverUsed[*AliasSet] = true; + MF->setPhysRegUsed(*AliasSet); } } } @@ -630,7 +629,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { unsigned Reg = MO.getReg(); if (PhysRegsUsed[Reg] == -2) continue; // Something like ESP. - PhysRegsEverUsed[Reg] = true; + MF->setPhysRegUsed(Reg); spillPhysReg(MBB, MI, Reg, true); // Spill any existing value in reg PhysRegsUsed[Reg] = 0; // It is free and reserved now PhysRegsUseOrder.push_back(Reg); @@ -639,7 +638,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { if (PhysRegsUsed[*AliasSet] != -2) { PhysRegsUseOrder.push_back(*AliasSet); PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now - PhysRegsEverUsed[*AliasSet] = true; + MF->setPhysRegUsed(*AliasSet); } } } @@ -656,7 +655,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { PhysRegsUseOrder.push_back(Reg); PhysRegsUsed[Reg] = 0; // It is free and reserved now } - PhysRegsEverUsed[Reg] = true; + MF->setPhysRegUsed(Reg); for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg); *AliasSet; ++AliasSet) { @@ -665,7 +664,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { PhysRegsUseOrder.push_back(*AliasSet); PhysRegsUsed[*AliasSet] = 0; // It is free and reserved now } - PhysRegsEverUsed[*AliasSet] = true; + MF->setPhysRegUsed(*AliasSet); } } } @@ -693,7 +692,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { // If DestVirtReg already has a value, use it. if (!(DestPhysReg = getVirt2PhysRegMapSlot(DestVirtReg))) DestPhysReg = getReg(MBB, MI, DestVirtReg); - PhysRegsEverUsed[DestPhysReg] = true; + MF->setPhysRegUsed(DestPhysReg); markVirtRegModified(DestVirtReg); MI->getOperand(i).setReg(DestPhysReg); // Assign the output register } @@ -779,10 +778,6 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) { RegInfo = TM->getRegisterInfo(); LV = &getAnalysis<LiveVariables>(); - PhysRegsEverUsed = new bool[RegInfo->getNumRegs()]; - std::fill(PhysRegsEverUsed, PhysRegsEverUsed+RegInfo->getNumRegs(), false); - Fn.setUsedPhysRegs(PhysRegsEverUsed); - PhysRegsUsed.assign(RegInfo->getNumRegs(), -1); // At various places we want to efficiently check to see whether a register |