Author: evancheng Date: Wed Jan 30 18:27:49 2008 New Revision: 46586 URL: http://llvm.org/viewvc/llvm-project?rev=46586&view=rev Log: Also avoid adding callee save code before debug labels.
Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=46586&r1=46585&r2=46586&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Wed Jan 30 18:27:49 2008 @@ -243,11 +243,19 @@ return; const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo(); - + // Now that we have a stack slot for each register to be saved, insert spill // 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. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits