mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
Provide the register scavenger to processFunctionBeforeFrameFinalized
Add the current PEI register scavenger as a parameter to the processFunctionBeforeFrameFinalized callback. This change is necessary in order to allow the PowerPC target code to set the register scavenger frame index after the save-area offset adjustments performed by processFunctionBeforeFrameFinalized. Only after these adjustments have been made is it possible to estimate the size of the stack frame. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -194,7 +194,8 @@ public:
|
|||||||
/// finalized. Once the frame is finalized, MO_FrameIndex operands are
|
/// finalized. Once the frame is finalized, MO_FrameIndex operands are
|
||||||
/// replaced with direct constants. This method is optional.
|
/// replaced with direct constants. This method is optional.
|
||||||
///
|
///
|
||||||
virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
|
virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// eliminateCallFramePseudoInstr - This method is called during prolog/epilog
|
/// eliminateCallFramePseudoInstr - This method is called during prolog/epilog
|
||||||
|
@ -101,7 +101,7 @@ bool PEI::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
|
|
||||||
// Allow the target machine to make final modifications to the function
|
// Allow the target machine to make final modifications to the function
|
||||||
// before the frame layout is finalized.
|
// before the frame layout is finalized.
|
||||||
TFI->processFunctionBeforeFrameFinalized(Fn);
|
TFI->processFunctionBeforeFrameFinalized(Fn, RS);
|
||||||
|
|
||||||
// Calculate actual frame offsets for all abstract stack objects...
|
// Calculate actual frame offsets for all abstract stack objects...
|
||||||
calculateFrameObjectOffsets(Fn);
|
calculateFrameObjectOffsets(Fn);
|
||||||
|
@ -122,7 +122,7 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MBlazeRegisterInfo::
|
void MBlazeRegisterInfo::
|
||||||
processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
|
processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *) const {
|
||||||
// Set the stack offset where GP must be saved/loaded from.
|
// Set the stack offset where GP must be saved/loaded from.
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
|
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
|
||||||
|
@ -55,7 +55,8 @@ struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
|
|||||||
int SPAdj, unsigned FIOperandNum,
|
int SPAdj, unsigned FIOperandNum,
|
||||||
RegScavenger *RS = NULL) const;
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
/// Debug information queries.
|
/// Debug information queries.
|
||||||
unsigned getFrameRegister(const MachineFunction &MF) const;
|
unsigned getFrameRegister(const MachineFunction &MF) const;
|
||||||
|
@ -285,8 +285,8 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MSP430FrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF)
|
MSP430FrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
const {
|
RegScavenger *) const {
|
||||||
// Create a frame entry for the FPW register that must be saved.
|
// Create a frame entry for the FPW register that must be saved.
|
||||||
if (hasFP(MF)) {
|
if (hasFP(MF)) {
|
||||||
int FrameIdx = MF.getFrameInfo()->CreateFixedObject(2, -4, true);
|
int FrameIdx = MF.getFrameInfo()->CreateFixedObject(2, -4, true);
|
||||||
|
@ -50,7 +50,8 @@ public:
|
|||||||
|
|
||||||
bool hasFP(const MachineFunction &MF) const;
|
bool hasFP(const MachineFunction &MF) const;
|
||||||
bool hasReservedCallFrame(const MachineFunction &MF) const;
|
bool hasReservedCallFrame(const MachineFunction &MF) const;
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
@ -58,7 +58,8 @@ public:
|
|||||||
int SPAdj, unsigned FIOperandNum,
|
int SPAdj, unsigned FIOperandNum,
|
||||||
RegScavenger *RS = NULL) const;
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
/// Debug information queries.
|
/// Debug information queries.
|
||||||
unsigned getFrameRegister(const MachineFunction &MF) const;
|
unsigned getFrameRegister(const MachineFunction &MF) const;
|
||||||
|
@ -841,8 +841,8 @@ PPCFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF)
|
void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
const {
|
RegScavenger *) const {
|
||||||
// Early exit if not using the SVR4 ABI.
|
// Early exit if not using the SVR4 ABI.
|
||||||
if (!Subtarget.isSVR4ABI())
|
if (!Subtarget.isSVR4ABI())
|
||||||
return;
|
return;
|
||||||
|
@ -44,7 +44,8 @@ public:
|
|||||||
|
|
||||||
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
RegScavenger *RS = NULL) const;
|
RegScavenger *RS = NULL) const;
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator MI,
|
MachineBasicBlock::iterator MI,
|
||||||
|
@ -40,7 +40,8 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
|
|||||||
int SPAdj, unsigned FIOperandNum,
|
int SPAdj, unsigned FIOperandNum,
|
||||||
RegScavenger *RS = NULL) const;
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
// Debug information queries.
|
// Debug information queries.
|
||||||
unsigned getFrameRegister(const MachineFunction &MF) const;
|
unsigned getFrameRegister(const MachineFunction &MF) const;
|
||||||
|
Reference in New Issue
Block a user