mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
Move callee-saved regs spills / reloads to TFI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120228 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -295,13 +295,14 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
return;
|
||||
|
||||
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
|
||||
const TargetFrameInfo *TFI = Fn.getTarget().getFrameInfo();
|
||||
const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
|
||||
MachineBasicBlock::iterator I;
|
||||
|
||||
if (! ShrinkWrapThisFunction) {
|
||||
// Spill using target interface.
|
||||
I = EntryBlock->begin();
|
||||
if (!TII.spillCalleeSavedRegisters(*EntryBlock, I, CSI, TRI)) {
|
||||
if (!TFI->spillCalleeSavedRegisters(*EntryBlock, I, CSI, TRI)) {
|
||||
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
|
||||
// Add the callee-saved register as live-in.
|
||||
// It's killed at the spill.
|
||||
@ -333,7 +334,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
|
||||
// Restore all registers immediately before the return and any
|
||||
// terminators that preceed it.
|
||||
if (!TII.restoreCalleeSavedRegisters(*MBB, I, CSI, TRI)) {
|
||||
if (!TFI->restoreCalleeSavedRegisters(*MBB, I, CSI, TRI)) {
|
||||
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
|
||||
unsigned Reg = CSI[i].getReg();
|
||||
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
|
||||
|
Reference in New Issue
Block a user