Also avoid adding callee save code before debug labels.

llvm-svn: 46586
This commit is contained in:
Evan Cheng 2008-01-31 00:27:49 +00:00
parent 3646fdda67
commit 4863fcc3eb
1 changed files with 9 additions and 1 deletions

View File

@ -248,6 +248,14 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
// code into the entry block.
MachineBasicBlock *MBB = Fn.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)) {
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
// Add the callee-saved register as live-in. It's killed at the spill.