diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp index 21c12d3993f..fff444087a8 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp @@ -731,7 +731,9 @@ void ScheduleDAG::EmitLiveInCopies(MachineBasicBlock *MBB) { /// EmitSchedule - Emit the machine code in scheduled order. MachineBasicBlock *ScheduleDAG::EmitSchedule() { - bool isEntryBB = &MF->front() == BB; + // If we're emitting the first code into the entry block, we + // have additional work to do. + bool isEntryBB = &MF->front() == BB && BB->empty(); if (isEntryBB && !SchedLiveInCopies) { // If this is the first basic block in the function, and if it has live ins