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
This commit is contained in:
Dan Gohman 2008-11-14 00:33:17 +00:00
parent 90c5201dd1
commit 8f6c6d4c5f

View File

@ -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<SDValue, unsigned> VRBaseMap;
DenseMap<SUnit*, unsigned> CopyVRBaseMap;
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {