Now that we have per-register spill size/alignment info, remove more uses

of getRegClass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-08-21 19:45:10 +00:00
parent 987b5cc557
commit fa1face30a

View File

@ -170,8 +170,6 @@ 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]; unsigned Reg = RegsToSave[i];
int FrameIdx;
const TargetRegisterClass *RC = RegInfo->getRegClass(Reg);
// 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.
@ -180,12 +178,15 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
FixedSlot->first != Reg) FixedSlot->first != Reg)
++FixedSlot; ++FixedSlot;
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(RC->getSize(), RC->getAlignment()); FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg),
RegInfo->getSpillAlignment(Reg));
} else { } else {
// Spill it to the stack where we must. // Spill it to the stack where we must.
FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second); FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg),
FixedSlot->second);
} }
StackSlots.push_back(FrameIdx); StackSlots.push_back(FrameIdx);
} }