diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-01-30 20:08:35 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-30 20:08:35 +0000 |
| commit | a3395a61ccf1843e73ca489f67628719e86a44bd (patch) | |
| tree | 1c9c9d01571ddea80f1235317ff984fae40677f2 /llvm/lib | |
| parent | ca2565ce9aacacad562fd9b2e7e8eb2c2406136f (diff) | |
| download | bcm5719-llvm-a3395a61ccf1843e73ca489f67628719e86a44bd.tar.gz bcm5719-llvm-a3395a61ccf1843e73ca489f67628719e86a44bd.zip | |
Treat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start label. Make sure nothing else is inserted before them.
Note this solution might be somewhat fragile since ISD::LABEL may be used for other
purposes. If that ends up to be an issue, we may need to introduce a different node
for debug labels.
llvm-svn: 46571
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 12 |
2 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 1b53beddf76..84cd0480375 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -716,16 +716,16 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, // If we are inserting a LABEL and this happens to be the first label in // the entry block, it is the "function start" label. Make sure there are // no other instructions before it. - bool SeenLabel = false; + unsigned NumLabels = 0; MachineBasicBlock::iterator MBBI = BB->begin(); while (MBBI != BB->end()) { if (MBBI->getOpcode() == TargetInstrInfo::LABEL) { - SeenLabel = true; - break; + if (++NumLabels > 1) + break; } ++MBBI; } - if (!SeenLabel) + if (NumLabels <= 1) BB->insert(BB->begin(), MI); else BB->push_back(MI); diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index bca197311fa..2f8ee1dadd8 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -525,11 +525,15 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta)); uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize(); - // Skip over the label which mark the beginning of the function. - if (MMI && MMI->needsFrameInfo() && - MBBI != MBB.end() && - MBBI->getOpcode() == X86::LABEL) + // 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() == X86::LABEL) { + ++NumLabels; ++MBBI; + } + } // Insert stack pointer adjustment for later moving of return addr. Only // applies to tail call optimized functions where the callee argument stack |

