aboutsummaryrefslogtreecommitdiff
path: root/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
commitd039b383e76e6658846dca9eee3fe7f221a2f938 (patch)
tree26d5588b876f1fee969a1367c9bc85170dcb3b5d /lib/CodeGen/MachineScheduler.cpp
parentd15e6576903b3dc33a5418153aa7078a61ae6f04 (diff)
misched: add a hook for custom DAG postprocessing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--lib/CodeGen/MachineScheduler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp
index 330ec560f8..d7ecec4163 100644
--- a/lib/CodeGen/MachineScheduler.cpp
+++ b/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.