Makes the same change in ppc backend: avoid inserting prologue before debug labels.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 31 Jan 2008 03:33:38 +0000 (03:33 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 31 Jan 2008 03:33:38 +0000 (03:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46596 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCRegisterInfo.cpp

index b9273af1a48ef326580b388f19d5cd09315c5f26..ff8b359470a10c8212bc2bcd269921e8841e1e7e 100644 (file)
@@ -712,6 +712,16 @@ void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
   // Prepare for frame info.
   unsigned FrameLabelId = 0;
   
+  // Skip over the labels which mark the beginning of the function.
+  if (MMI && MMI->needsFrameInfo()) {
+    unsigned NumLabels = 0;
+    while (NumLabels <= 1 &&
+           MBBI != MBB.end() && MBBI->getOpcode() == PPC::LABEL) {
+      ++NumLabels;
+      ++MBBI;
+    }
+  }
+
   // Scan the prolog, looking for an UPDATE_VRSAVE instruction.  If we find it,
   // process it.
   for (unsigned i = 0; MBBI != MBB.end(); ++i, ++MBBI) {