@@ -23,7 +23,7 @@ using namespace llvm;
23
23
24
24
namespace {
25
25
// The ABI-defined register save slots, relative to the CFA (i.e.
26
- // incoming stack pointer + SystemZMC::CallFrameSize ).
26
+ // incoming stack pointer + SystemZMC::ELFCallFrameSize ).
27
27
static const TargetFrameLowering::SpillSlot SpillOffsetTable[] = {
28
28
{ SystemZ::R2D, 0x10 },
29
29
{ SystemZ::R3D, 0x18 },
@@ -75,7 +75,7 @@ assignCalleeSavedSpillSlots(MachineFunction &MF,
75
75
76
76
unsigned LowGPR = 0 ;
77
77
unsigned HighGPR = SystemZ::R15D;
78
- int StartSPOffset = SystemZMC::CallFrameSize ;
78
+ int StartSPOffset = SystemZMC::ELFCallFrameSize ;
79
79
for (auto &CS : CSI) {
80
80
unsigned Reg = CS.getReg ();
81
81
int Offset = getRegSpillOffset (MF, Reg);
@@ -84,7 +84,7 @@ assignCalleeSavedSpillSlots(MachineFunction &MF,
84
84
LowGPR = Reg;
85
85
StartSPOffset = Offset;
86
86
}
87
- Offset -= SystemZMC::CallFrameSize ;
87
+ Offset -= SystemZMC::ELFCallFrameSize ;
88
88
int FrameIdx = MFFrame.CreateFixedSpillStackObject (8 , Offset);
89
89
CS.setFrameIdx (FrameIdx);
90
90
} else
@@ -99,8 +99,8 @@ assignCalleeSavedSpillSlots(MachineFunction &MF,
99
99
// already be included, but we also need to handle the call-clobbered
100
100
// argument registers.
101
101
unsigned FirstGPR = ZFI->getVarArgsFirstGPR ();
102
- if (FirstGPR < SystemZ::NumArgGPRs ) {
103
- unsigned Reg = SystemZ::ArgGPRs [FirstGPR];
102
+ if (FirstGPR < SystemZ::ELFNumArgGPRs ) {
103
+ unsigned Reg = SystemZ::ELFArgGPRs [FirstGPR];
104
104
int Offset = getRegSpillOffset (MF, Reg);
105
105
if (StartSPOffset > Offset) {
106
106
LowGPR = Reg; StartSPOffset = Offset;
@@ -110,7 +110,7 @@ assignCalleeSavedSpillSlots(MachineFunction &MF,
110
110
ZFI->setSpillGPRRegs (LowGPR, HighGPR, StartSPOffset);
111
111
112
112
// Create fixed stack objects for the remaining registers.
113
- int CurrOffset = -SystemZMC::CallFrameSize ;
113
+ int CurrOffset = -SystemZMC::ELFCallFrameSize ;
114
114
if (usePackedStack (MF))
115
115
CurrOffset += StartSPOffset;
116
116
@@ -146,8 +146,8 @@ void SystemZFrameLowering::determineCalleeSaves(MachineFunction &MF,
146
146
// Record these pending uses, which typically include the call-saved
147
147
// argument register R6D.
148
148
if (IsVarArg)
149
- for (unsigned I = MFI->getVarArgsFirstGPR (); I < SystemZ::NumArgGPRs ; ++I)
150
- SavedRegs.set (SystemZ::ArgGPRs [I]);
149
+ for (unsigned I = MFI->getVarArgsFirstGPR (); I < SystemZ::ELFNumArgGPRs ; ++I)
150
+ SavedRegs.set (SystemZ::ELFArgGPRs [I]);
151
151
152
152
// If there are any landing pads, entering them will modify r6/r7.
153
153
if (!MF.getLandingPads ().empty ()) {
@@ -234,8 +234,8 @@ bool SystemZFrameLowering::spillCalleeSavedRegisters(
234
234
235
235
// ...likewise GPR varargs.
236
236
if (IsVarArg)
237
- for (unsigned I = ZFI->getVarArgsFirstGPR (); I < SystemZ::NumArgGPRs ; ++I)
238
- addSavedGPR (MBB, MIB, SystemZ::ArgGPRs [I], true );
237
+ for (unsigned I = ZFI->getVarArgsFirstGPR (); I < SystemZ::ELFNumArgGPRs ; ++I)
238
+ addSavedGPR (MBB, MIB, SystemZ::ELFArgGPRs [I], true );
239
239
}
240
240
241
241
// Save FPRs/VRs in the normal TargetInstrInfo way.
@@ -326,7 +326,7 @@ processFunctionBeforeFrameFinalized(MachineFunction &MF,
326
326
327
327
// Get the size of our stack frame to be allocated ...
328
328
uint64_t StackSize = (MFFrame.estimateStackSize (MF) +
329
- SystemZMC::CallFrameSize );
329
+ SystemZMC::ELFCallFrameSize );
330
330
// ... and the maximum offset we may need to reach into the
331
331
// caller's frame to access the save area or stack arguments.
332
332
int64_t MaxArgOffset = 0 ;
@@ -437,7 +437,7 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF,
437
437
report_fatal_error (
438
438
" In GHC calling convention a frame pointer is not supported" );
439
439
}
440
- MFFrame.setStackSize (MFFrame.getStackSize () + SystemZMC::CallFrameSize );
440
+ MFFrame.setStackSize (MFFrame.getStackSize () + SystemZMC::ELFCallFrameSize );
441
441
return ;
442
442
}
443
443
@@ -446,7 +446,7 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF,
446
446
DebugLoc DL;
447
447
448
448
// The current offset of the stack pointer from the CFA.
449
- int64_t SPOffsetFromCFA = -SystemZMC::CFAOffsetFromInitialSP ;
449
+ int64_t SPOffsetFromCFA = -SystemZMC::ELFCFAOffsetFromInitialSP ;
450
450
451
451
if (ZFI->getSpillGPRRegs ().LowGPR ) {
452
452
// Skip over the GPR saves.
@@ -480,10 +480,10 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF,
480
480
break ;
481
481
}
482
482
if (HasStackObject || MFFrame.hasCalls ())
483
- StackSize += SystemZMC::CallFrameSize ;
483
+ StackSize += SystemZMC::ELFCallFrameSize ;
484
484
// Don't allocate the incoming reg save area.
485
- StackSize = StackSize > SystemZMC::CallFrameSize
486
- ? StackSize - SystemZMC::CallFrameSize
485
+ StackSize = StackSize > SystemZMC::ELFCallFrameSize
486
+ ? StackSize - SystemZMC::ELFCallFrameSize
487
487
: 0 ;
488
488
MFFrame.setStackSize (StackSize);
489
489
@@ -638,7 +638,7 @@ void SystemZFrameLowering::inlineStackProbe(MachineFunction &MF,
638
638
const unsigned ProbeSize = TLI.getStackProbeSize (MF);
639
639
uint64_t NumFullBlocks = StackSize / ProbeSize;
640
640
uint64_t Residual = StackSize % ProbeSize;
641
- int64_t SPOffsetFromCFA = -SystemZMC::CFAOffsetFromInitialSP ;
641
+ int64_t SPOffsetFromCFA = -SystemZMC::ELFCFAOffsetFromInitialSP ;
642
642
MachineBasicBlock *MBB = &PrologMBB;
643
643
MachineBasicBlock::iterator MBBI = StackAllocMI;
644
644
const DebugLoc DL = StackAllocMI->getDebugLoc ();
@@ -682,7 +682,7 @@ void SystemZFrameLowering::inlineStackProbe(MachineFunction &MF,
682
682
.addReg (SystemZ::R15D);
683
683
buildDefCFAReg (*MBB, MBBI, DL, SystemZ::R0D, ZII);
684
684
emitIncrement (*MBB, MBBI, DL, SystemZ::R0D, -int64_t (LoopAlloc), ZII);
685
- buildCFAOffs (*MBB, MBBI, DL, -int64_t (SystemZMC::CallFrameSize + LoopAlloc),
685
+ buildCFAOffs (*MBB, MBBI, DL, -int64_t (SystemZMC::ELFCallFrameSize + LoopAlloc),
686
686
ZII);
687
687
688
688
DoneMBB = SystemZ::splitBlockBefore (MBBI, MBB);
@@ -737,11 +737,11 @@ SystemZFrameLowering::hasReservedCallFrame(const MachineFunction &MF) const {
737
737
StackOffset
738
738
SystemZFrameLowering::getFrameIndexReference (const MachineFunction &MF, int FI,
739
739
Register &FrameReg) const {
740
- // Our incoming SP is actually SystemZMC::CallFrameSize below the CFA, so
740
+ // Our incoming SP is actually SystemZMC::ELFCallFrameSize below the CFA, so
741
741
// add that difference here.
742
742
StackOffset Offset =
743
743
TargetFrameLowering::getFrameIndexReference (MF, FI, FrameReg);
744
- return Offset + StackOffset::getFixed (SystemZMC::CallFrameSize );
744
+ return Offset + StackOffset::getFixed (SystemZMC::ELFCallFrameSize );
745
745
}
746
746
747
747
MachineBasicBlock::iterator SystemZFrameLowering::
@@ -784,7 +784,7 @@ getOrCreateFramePointerSaveIndex(MachineFunction &MF) const {
784
784
int FI = ZFI->getFramePointerSaveIndex ();
785
785
if (!FI) {
786
786
MachineFrameInfo &MFFrame = MF.getFrameInfo ();
787
- int Offset = getBackchainOffset (MF) - SystemZMC::CallFrameSize ;
787
+ int Offset = getBackchainOffset (MF) - SystemZMC::ELFCallFrameSize ;
788
788
FI = MFFrame.CreateFixedObject (8 , Offset, false );
789
789
ZFI->setFramePointerSaveIndex (FI);
790
790
}
0 commit comments