From: Dan Gohman Date: Fri, 14 Nov 2008 00:33:17 +0000 (+0000) Subject: For post-regalloc scheduling, remove the instructions from the block X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8f6c6d4c5f7bb9ab71147c8215c3779a6bec7689;p=oota-llvm.git For post-regalloc scheduling, remove the instructions from the block before re-inserting them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59281 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp index d60dd493576..0c679734ea1 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp @@ -675,6 +675,12 @@ void ScheduleDAG::EmitCrossRCCopy(SUnit *SU, /// EmitSchedule - Emit the machine code in scheduled order. MachineBasicBlock *ScheduleDAG::EmitSchedule() { + // For post-regalloc scheduling, we're rescheduling the instructions in the + // block, so start by removing them from the block. + if (!DAG) + while (!BB->empty()) + BB->remove(BB->begin()); + DenseMap VRBaseMap; DenseMap CopyVRBaseMap; for (unsigned i = 0, e = Sequence.size(); i != e; i++) {