summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-14 00:33:17 +0000
committerDan Gohman <gohman@apple.com>2008-11-14 00:33:17 +0000
commitdb8b95a4fa86b23c540a05bef5f5b17fd46fd3b9 (patch)
treed3a027fa1537a643a606239a18c84c62dfd56736 /llvm/lib/CodeGen/SelectionDAG
parent1a21ab69250b7566947296576404bc94e4fbd178 (diff)
downloadbcm5719-llvm-db8b95a4fa86b23c540a05bef5f5b17fd46fd3b9.tar.gz
bcm5719-llvm-db8b95a4fa86b23c540a05bef5f5b17fd46fd3b9.zip
For post-regalloc scheduling, remove the instructions from the block
before re-inserting them. llvm-svn: 59281
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp
index d60dd493576..0c679734ea1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp
+++ b/llvm/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<SDValue, unsigned> VRBaseMap;
DenseMap<SUnit*, unsigned> CopyVRBaseMap;
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
OpenPOWER on IntegriCloud