mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
Targets sometimes assign fixed stack object to spill certain callee-saved
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as frame register has to be spilled in the first fixed object. It should inform PEI this so it doesn't get allocated another stack object. Also, it should not be spilled as other callee-saved registers but rather its spilling and restoring are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -210,6 +210,12 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
|
||||
unsigned Reg = I->getReg();
|
||||
const TargetRegisterClass *RC = I->getRegClass();
|
||||
|
||||
int FrameIdx;
|
||||
if (RegInfo->hasReservedSpillSlot(Fn, Reg, FrameIdx)) {
|
||||
I->setFrameIdx(FrameIdx);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check to see if this physreg must be spilled to a particular stack slot
|
||||
// on this target.
|
||||
const std::pair<unsigned,int> *FixedSlot = FixedSpillSlots;
|
||||
@ -217,7 +223,6 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
|
||||
FixedSlot->first != Reg)
|
||||
++FixedSlot;
|
||||
|
||||
int FrameIdx;
|
||||
if (FixedSlot == FixedSpillSlots + NumFixedSpillSlots) {
|
||||
// Nope, just spill it anywhere convenient.
|
||||
unsigned Align = RC->getAlignment();
|
||||
|
Reference in New Issue
Block a user