mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
Use the cached subtarget in PPCFrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
87dd120c6a
commit
dd5e9f624b
@ -372,7 +372,7 @@ unsigned PPCFrameLowering::determineFrameLayout(MachineFunction &MF,
|
|||||||
unsigned AlignMask = std::max(MaxAlign, TargetAlign) - 1;
|
unsigned AlignMask = std::max(MaxAlign, TargetAlign) - 1;
|
||||||
|
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
|
|
||||||
// If we are a leaf function, and use up to 224 bytes of stack space,
|
// If we are a leaf function, and use up to 224 bytes of stack space,
|
||||||
// don't have a frame pointer, calls, or dynamic alloca then we do not need
|
// don't have a frame pointer, calls, or dynamic alloca then we do not need
|
||||||
@ -461,7 +461,7 @@ void PPCFrameLowering::replaceFPWithRealFP(MachineFunction &MF) const {
|
|||||||
unsigned FP8Reg = is31 ? PPC::X31 : PPC::X1;
|
unsigned FP8Reg = is31 ? PPC::X31 : PPC::X1;
|
||||||
|
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
bool HasBP = RegInfo->hasBasePointer(MF);
|
bool HasBP = RegInfo->hasBasePointer(MF);
|
||||||
unsigned BPReg = HasBP ? (unsigned) RegInfo->getBaseRegister(MF) : FPReg;
|
unsigned BPReg = HasBP ? (unsigned) RegInfo->getBaseRegister(MF) : FPReg;
|
||||||
unsigned BP8Reg = HasBP ? (unsigned) PPC::X30 : FPReg;
|
unsigned BP8Reg = HasBP ? (unsigned) PPC::X30 : FPReg;
|
||||||
@ -499,9 +499,9 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const {
|
|||||||
MachineBasicBlock::iterator MBBI = MBB.begin();
|
MachineBasicBlock::iterator MBBI = MBB.begin();
|
||||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||||
const PPCInstrInfo &TII =
|
const PPCInstrInfo &TII =
|
||||||
*static_cast<const PPCInstrInfo *>(MF.getSubtarget().getInstrInfo());
|
*static_cast<const PPCInstrInfo *>(Subtarget.getInstrInfo());
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
|
|
||||||
MachineModuleInfo &MMI = MF.getMMI();
|
MachineModuleInfo &MMI = MF.getMMI();
|
||||||
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
|
const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo();
|
||||||
@ -864,9 +864,9 @@ void PPCFrameLowering::emitEpilogue(MachineFunction &MF,
|
|||||||
MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
|
MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
|
||||||
assert(MBBI != MBB.end() && "Returning block has no terminator");
|
assert(MBBI != MBB.end() && "Returning block has no terminator");
|
||||||
const PPCInstrInfo &TII =
|
const PPCInstrInfo &TII =
|
||||||
*static_cast<const PPCInstrInfo *>(MF.getSubtarget().getInstrInfo());
|
*static_cast<const PPCInstrInfo *>(Subtarget.getInstrInfo());
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
|
|
||||||
unsigned RetOpcode = MBBI->getOpcode();
|
unsigned RetOpcode = MBBI->getOpcode();
|
||||||
DebugLoc dl;
|
DebugLoc dl;
|
||||||
@ -1126,7 +1126,7 @@ void
|
|||||||
PPCFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
PPCFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
RegScavenger *) const {
|
RegScavenger *) const {
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
|
|
||||||
// Save and clear the LR state.
|
// Save and clear the LR state.
|
||||||
PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
|
PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
|
||||||
@ -1266,7 +1266,7 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PPCFunctionInfo *PFI = MF.getInfo<PPCFunctionInfo>();
|
PPCFunctionInfo *PFI = MF.getInfo<PPCFunctionInfo>();
|
||||||
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
|
const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();
|
||||||
|
|
||||||
int64_t LowerBound = 0;
|
int64_t LowerBound = 0;
|
||||||
|
|
||||||
@ -1310,7 +1310,7 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PPCRegisterInfo *RegInfo =
|
const PPCRegisterInfo *RegInfo =
|
||||||
static_cast<const PPCRegisterInfo *>(MF.getSubtarget().getRegisterInfo());
|
static_cast<const PPCRegisterInfo *>(Subtarget.getRegisterInfo());
|
||||||
if (RegInfo->hasBasePointer(MF)) {
|
if (RegInfo->hasBasePointer(MF)) {
|
||||||
HasGPSaveArea = true;
|
HasGPSaveArea = true;
|
||||||
|
|
||||||
@ -1458,7 +1458,7 @@ PPCFrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|||||||
|
|
||||||
MachineFunction *MF = MBB.getParent();
|
MachineFunction *MF = MBB.getParent();
|
||||||
const PPCInstrInfo &TII =
|
const PPCInstrInfo &TII =
|
||||||
*static_cast<const PPCInstrInfo *>(MF->getSubtarget().getInstrInfo());
|
*static_cast<const PPCInstrInfo *>(Subtarget.getInstrInfo());
|
||||||
DebugLoc DL;
|
DebugLoc DL;
|
||||||
bool CRSpilled = false;
|
bool CRSpilled = false;
|
||||||
MachineInstrBuilder CRMIB;
|
MachineInstrBuilder CRMIB;
|
||||||
@ -1552,8 +1552,7 @@ restoreCRs(bool isPPC64, bool is31,
|
|||||||
void PPCFrameLowering::
|
void PPCFrameLowering::
|
||||||
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator I) const {
|
MachineBasicBlock::iterator I) const {
|
||||||
const PPCInstrInfo &TII =
|
const TargetInstrInfo &TII = *Subtarget.getInstrInfo();
|
||||||
*static_cast<const PPCInstrInfo *>(MF.getSubtarget().getInstrInfo());
|
|
||||||
if (MF.getTarget().Options.GuaranteedTailCallOpt &&
|
if (MF.getTarget().Options.GuaranteedTailCallOpt &&
|
||||||
I->getOpcode() == PPC::ADJCALLSTACKUP) {
|
I->getOpcode() == PPC::ADJCALLSTACKUP) {
|
||||||
// Add (actually subtract) back the amount the callee popped on return.
|
// Add (actually subtract) back the amount the callee popped on return.
|
||||||
@ -1603,7 +1602,7 @@ PPCFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|||||||
|
|
||||||
MachineFunction *MF = MBB.getParent();
|
MachineFunction *MF = MBB.getParent();
|
||||||
const PPCInstrInfo &TII =
|
const PPCInstrInfo &TII =
|
||||||
*static_cast<const PPCInstrInfo *>(MF->getSubtarget().getInstrInfo());
|
*static_cast<const PPCInstrInfo *>(Subtarget.getInstrInfo());
|
||||||
bool CR2Spilled = false;
|
bool CR2Spilled = false;
|
||||||
bool CR3Spilled = false;
|
bool CR3Spilled = false;
|
||||||
bool CR4Spilled = false;
|
bool CR4Spilled = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user