aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocLocal.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-04-25 22:13:27 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-04-25 22:13:27 +0000
commit6c087e5585b227f3c1d8278304c7cfbc7cd4f6e8 (patch)
tree9e63ac47ddf6aed310f4dbb7a794f1ca9b221f0c /lib/CodeGen/RegAllocLocal.cpp
parent505e5510a258699d1fb267142c247079a4b3d796 (diff)
downloadexternal_llvm-6c087e5585b227f3c1d8278304c7cfbc7cd4f6e8.tar.gz
external_llvm-6c087e5585b227f3c1d8278304c7cfbc7cd4f6e8.tar.bz2
external_llvm-6c087e5585b227f3c1d8278304c7cfbc7cd4f6e8.zip
Match MachineFunction::UsedPhysRegs changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLocal.cpp')
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index f862023e8f..d3d5796e85 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/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