Match MachineFunction::UsedPhysRegs changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2007-04-25 22:13:27 +00:00
parent 505e5510a2
commit 6c087e5585
8 changed files with 38 additions and 66 deletions

View File

@@ -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)