summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-09-14 17:22:42 +0000
committerAndrew Trick <atrick@apple.com>2012-09-14 17:22:42 +0000
commita2733e9549090cdd57f9776f890e1b36fb727b41 (patch)
treeab28915115de925294aa6dee307ec7275148f409 /llvm/lib/CodeGen/MachineScheduler.cpp
parentefc32c08579f77cb49fad251707c32bc9048ebc5 (diff)
downloadbcm5719-llvm-a2733e9549090cdd57f9776f890e1b36fb727b41.tar.gz
bcm5719-llvm-a2733e9549090cdd57f9776f890e1b36fb727b41.zip
misched: add a hook for custom DAG postprocessing.
llvm-svn: 163915
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 330ec560f88..d7ecec4163a 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -484,6 +484,8 @@ void ScheduleDAGMI::releaseRoots() {
void ScheduleDAGMI::schedule() {
buildDAGWithRegPressure();
+ postprocessDAG();
+
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
SUnits[su].dumpAll(this));
@@ -522,6 +524,13 @@ void ScheduleDAGMI::buildDAGWithRegPressure() {
initRegPressure();
}
+/// Apply each ScheduleDAGMutation step in order.
+void ScheduleDAGMI::postprocessDAG() {
+ for (unsigned i = 0, e = Mutations.size(); i < e; ++i) {
+ Mutations[i]->apply(this);
+ }
+}
+
/// Identify DAG roots and setup scheduler queues.
void ScheduleDAGMI::initQueues() {
// Initialize the strategy before modifying the DAG.
OpenPOWER on IntegriCloud