diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index c9fc812259..ac35b40d92 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -733,18 +733,16 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, } // Now that we have emitted all operands, emit this instruction itself. - if (Opc == TargetInstrInfo::LABEL && + if (ISD::isDebugLabel(Node) && !BB->empty() && &MF->front() == BB) { - // 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. + // If we are inserting a debug label and this happens to be the first + // debug label in the entry block, it is the "function start" label. + // Make sure there are no other instructions before it. unsigned NumLabels = 0; MachineBasicBlock::iterator MBBI = BB->begin(); while (MBBI != BB->end()) { - if (MBBI->getOpcode() == TargetInstrInfo::LABEL) { - if (++NumLabels > 1) - break; - } + if (!MBBI->isDebugLabel() || ++NumLabels > 1) + break; ++MBBI; } if (NumLabels <= 1) |