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
This commit is contained in:
Andrew Trick
2012-09-14 17:22:42 +00:00
parent d15e657690
commit d039b383e7
2 changed files with 31 additions and 0 deletions

View File

@ -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.