For post-regalloc scheduling, remove the instructions from the block

before re-inserting them.

llvm-svn: 59281
This commit is contained in:
Dan Gohman 2008-11-14 00:33:17 +00:00
parent 1a21ab6925
commit db8b95a4fa
1 changed files with 6 additions and 0 deletions

View File

@ -675,6 +675,12 @@ void ScheduleDAG::EmitCrossRCCopy(SUnit *SU,
/// EmitSchedule - Emit the machine code in scheduled order. /// EmitSchedule - Emit the machine code in scheduled order.
MachineBasicBlock *ScheduleDAG::EmitSchedule() { 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<SDValue, unsigned> VRBaseMap;
DenseMap<SUnit*, unsigned> CopyVRBaseMap; DenseMap<SUnit*, unsigned> CopyVRBaseMap;
for (unsigned i = 0, e = Sequence.size(); i != e; i++) { for (unsigned i = 0, e = Sequence.size(); i != e; i++) {