mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Fix PR14364.
This removes a const_cast hack from PPCRegisterInfo::hasReservedSpillSlot(). The proper place to save the frame index for the CR spill slot is in the PPCFunctionInfo object, not the PPCRegisterInfo object. No new test cases, as this just reimplements existing function. Existing tests such as test/CodeGen/PowerPC/crsave.ll are sufficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -786,7 +786,8 @@ PPCFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
|
||||
unsigned LR = RegInfo->getRARegister();
|
||||
FI->setMustSaveLR(MustSaveLR(MF, LR));
|
||||
MF.getRegInfo().setPhysRegUnused(LR);
|
||||
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||
MRI.setPhysRegUnused(LR);
|
||||
|
||||
// Save R31 if necessary
|
||||
int FPSI = FI->getFramePointerSaveIndex();
|
||||
@@ -811,6 +812,16 @@ PPCFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
MFI->CreateFixedObject(-1 * TCSPDelta, TCSPDelta, true);
|
||||
}
|
||||
|
||||
// For 32-bit SVR4, allocate the nonvolatile CR spill slot iff the
|
||||
// function uses CR 2, 3, or 4.
|
||||
if (!isPPC64 && !isDarwinABI &&
|
||||
(MRI.isPhysRegUsed(PPC::CR2) ||
|
||||
MRI.isPhysRegUsed(PPC::CR3) ||
|
||||
MRI.isPhysRegUsed(PPC::CR4))) {
|
||||
int FrameIdx = MFI->CreateFixedObject((uint64_t)4, (int64_t)-4, true);
|
||||
FI->setCRSpillFrameIndex(FrameIdx);
|
||||
}
|
||||
|
||||
// Reserve a slot closest to SP or frame pointer if we have a dynalloc or
|
||||
// a large stack, which will require scavenging a register to materialize a
|
||||
// large offset.
|
||||
|
Reference in New Issue
Block a user