aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-01-16 22:10:20 +0000
committerDan Gohman <gohman@apple.com>2009-01-16 22:10:20 +0000
commitf7119393a97c2a10757084b6bc186380f8c19a73 (patch)
tree7824f429705e746de59c9c813df694fd3f19fab0 /lib/CodeGen/ScheduleDAG.cpp
parent49bb50e0b65d4646a1d44eec3196c003c13caa96 (diff)
Instead of adding dependence edges between terminator instructions
and every other instruction in their blocks to keep the terminator instructions at the end, teach the post-RA scheduler how to operate on ranges of instructions, and exclude terminators from the range of instructions that get scheduled. Also, exclude mid-block labels, such as EH_LABEL instructions, and schedule code before them separately from code after them. This fixes problems with the post-RA scheduler moving code past EH_LABELs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAG.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/ScheduleDAG.cpp b/lib/CodeGen/ScheduleDAG.cpp
index e309a4385e..718f591902 100644
--- a/lib/CodeGen/ScheduleDAG.cpp
+++ b/lib/CodeGen/ScheduleDAG.cpp
@@ -46,11 +46,18 @@ void ScheduleDAG::dumpSchedule() const {
/// Run - perform scheduling.
///
-void ScheduleDAG::Run(SelectionDAG *dag, MachineBasicBlock *bb) {
+void ScheduleDAG::Run(SelectionDAG *dag, MachineBasicBlock *bb,
+ MachineBasicBlock::iterator begin,
+ MachineBasicBlock::iterator end) {
+ assert((!dag || begin == end) &&
+ "An instruction range was given for SelectionDAG scheduling!");
+
SUnits.clear();
Sequence.clear();
DAG = dag;
BB = bb;
+ Begin = begin;
+ End = end;
Schedule();