[llvm-commits] [llvm] r55817 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp

Dan Gohman gohman at apple.com
Thu Sep 4 18:07:49 PDT 2008


Author: djg
Date: Thu Sep  4 20:07:48 2008
New Revision: 55817

URL: http://llvm.org/viewvc/llvm-project?rev=55817&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp?rev=55817&r1=55816&r2=55817&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp Thu Sep  4 20:07:48 2008
@@ -731,7 +731,9 @@
 
 /// 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





More information about the llvm-commits mailing list