mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Eastimate required stack alignment early, so we can decide, whether we will need frame pointer or not
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
874384e20f
commit
b51dce3013
@ -371,6 +371,25 @@ void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|||||||
MI.getOperand(i+3).ChangeToImmediate(Offset);
|
MI.getOperand(i+3).ChangeToImmediate(Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
|
RegScavenger *RS) const {
|
||||||
|
MachineFrameInfo *FFI = MF.getFrameInfo();
|
||||||
|
|
||||||
|
// Calculate and set max stack object alignment early, so we can decide
|
||||||
|
// whether we will need stack realignment (and thus FP).
|
||||||
|
unsigned MaxAlign = 0;
|
||||||
|
for (int i = FFI->getObjectIndexBegin(),
|
||||||
|
e = FFI->getObjectIndexEnd(); i != e; ++i) {
|
||||||
|
if (FFI->isDeadObjectIndex(i))
|
||||||
|
continue;
|
||||||
|
unsigned Align = FFI->getObjectAlignment(i);
|
||||||
|
MaxAlign = std::max(MaxAlign, Align);
|
||||||
|
}
|
||||||
|
|
||||||
|
FFI->setMaxAlignment(MaxAlign);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
X86RegisterInfo::processFunctionBeforeFrameFinalized(MachineFunction &MF) const{
|
X86RegisterInfo::processFunctionBeforeFrameFinalized(MachineFunction &MF) const{
|
||||||
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
|
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
|
||||||
|
@ -127,6 +127,8 @@ public:
|
|||||||
int SPAdj, RegScavenger *RS = NULL) const;
|
int SPAdj, RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||||
|
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||||
|
RegScavenger *RS = NULL) const;
|
||||||
|
|
||||||
void emitPrologue(MachineFunction &MF) const;
|
void emitPrologue(MachineFunction &MF) const;
|
||||||
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user