now that we have a reg class to spill with, get this info from the regclass

llvm-svn: 23559
This commit is contained in:
Chris Lattner 2005-09-30 17:19:22 +00:00
parent 88025e17c5
commit 2e794c9198
1 changed files with 3 additions and 4 deletions

View File

@ -165,6 +165,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
// stack slots for them. // stack slots for them.
for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) { for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
unsigned Reg = RegsToSave[i].first; unsigned Reg = RegsToSave[i].first;
const TargetRegisterClass *RC = RegsToSave[i].second;
// Check to see if this physreg must be spilled to a particular stack slot // Check to see if this physreg must be spilled to a particular stack slot
// on this target. // on this target.
@ -176,12 +177,10 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
int FrameIdx; int FrameIdx;
if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) { if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
// Nope, just spill it anywhere convenient. // Nope, just spill it anywhere convenient.
FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg)/8, FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
RegInfo->getSpillAlignment(Reg)/8);
} else { } else {
// Spill it to the stack where we must. // Spill it to the stack where we must.
FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg)/8, FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second);
FixedSlot->second);
} }
StackSlots.push_back(FrameIdx); StackSlots.push_back(FrameIdx);
} }