From c7f4a8a80cb7e8cf09495f4b60ae45734e7d5d98 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 5 Sep 2008 01:07:48 +0000 Subject: [PATCH] In FastISel mode, the scheduler may be invoked multiple times in the same block. Fix the entry-block handling to only run at at the beginning of the entry block, and not any other times. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55817 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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