From adec96f4388afaeb5e5babfcc901fb65202a437a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 14 Jul 2008 18:19:29 +0000 Subject: Reapply 53476 and 53480, with a fix so that it properly updates the BB member to the current basic block after emitting instructions. llvm-svn: 53567 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 02f20f919e6..982bbab3cb2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -1082,7 +1082,7 @@ void ScheduleDAG::EmitLiveInCopies(MachineBasicBlock *MBB) { } /// EmitSchedule - Emit the machine code in scheduled order. -void ScheduleDAG::EmitSchedule() { +MachineBasicBlock *ScheduleDAG::EmitSchedule() { bool isEntryBB = &MF->front() == BB; if (isEntryBB && !SchedLiveInCopies) { @@ -1118,6 +1118,8 @@ void ScheduleDAG::EmitSchedule() { if (isEntryBB && SchedLiveInCopies) EmitLiveInCopies(MF->begin()); + + return BB; } /// dump - dump the schedule. @@ -1133,9 +1135,12 @@ void ScheduleDAG::dumpSchedule() const { /// Run - perform scheduling. /// -MachineBasicBlock *ScheduleDAG::Run() { +void ScheduleDAG::Run() { Schedule(); - return BB; + + DOUT << "*** Final schedule ***\n"; + DEBUG(dumpSchedule()); + DOUT << "\n"; } /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or -- cgit v1.2.3