mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-12 13:24:29 +00:00
Also avoid adding callee save code before debug labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -243,11 +243,19 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
|
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
|
||||||
|
|
||||||
// Now that we have a stack slot for each register to be saved, insert spill
|
// Now that we have a stack slot for each register to be saved, insert spill
|
||||||
// code into the entry block.
|
// code into the entry block.
|
||||||
MachineBasicBlock *MBB = Fn.begin();
|
MachineBasicBlock *MBB = Fn.begin();
|
||||||
MachineBasicBlock::iterator I = MBB->begin();
|
MachineBasicBlock::iterator I = MBB->begin();
|
||||||
|
|
||||||
|
// Do not insert prologue code before debug LABELs at the start of the
|
||||||
|
// entry block.
|
||||||
|
MachineModuleInfo *MMI = FFI->getMachineModuleInfo();
|
||||||
|
if (MMI && MMI->hasDebugInfo())
|
||||||
|
while (I != MBB->end() && I->getOpcode() == TargetInstrInfo::LABEL)
|
||||||
|
++I;
|
||||||
|
|
||||||
if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) {
|
if (!TII.spillCalleeSavedRegisters(*MBB, I, CSI)) {
|
||||||
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
|
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
|
||||||
// Add the callee-saved register as live-in. It's killed at the spill.
|
// Add the callee-saved register as live-in. It's killed at the spill.
|
||||||
|
Reference in New Issue
Block a user