diff --git a/llvm/include/llvm/CodeGen/MachineScheduler.h b/llvm/include/llvm/CodeGen/MachineScheduler.h --- a/llvm/include/llvm/CodeGen/MachineScheduler.h +++ b/llvm/include/llvm/CodeGen/MachineScheduler.h @@ -103,8 +103,10 @@ extern cl::opt VerifyScheduling; #ifndef NDEBUG extern cl::opt ViewMISchedDAGs; +extern cl::opt PrintDAGs; #else extern const bool ViewMISchedDAGs; +extern const bool PrintDAGs; #endif class AAResults; diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -93,8 +93,11 @@ cl::opt ViewMISchedDAGs( "view-misched-dags", cl::Hidden, cl::desc("Pop up a window to show MISched dags after they are processed")); +cl::opt PrintDAGs("misched-print-dags", cl::Hidden, + cl::desc("Print schedule DAGs")); #else const bool ViewMISchedDAGs = false; +const bool PrintDAGs = false; #endif // NDEBUG } // end namespace llvm @@ -112,10 +115,6 @@ cl::desc("Only schedule this function")); static cl::opt SchedOnlyBlock("misched-only-block", cl::Hidden, cl::desc("Only schedule this MBB#")); -static cl::opt PrintDAGs("misched-print-dags", cl::Hidden, - cl::desc("Print schedule DAGs")); -#else -static const bool PrintDAGs = false; #endif // NDEBUG /// Avoid quadratic complexity in unusually large basic blocks by limiting the diff --git a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp --- a/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp @@ -1883,7 +1883,13 @@ LLVM_DEBUG(dbgs() << "Preparing Scheduling\n"); buildDAGWithRegPressure(); + postprocessDAG(); + LLVM_DEBUG(dump()); + if (PrintDAGs) + dump(); + if (ViewMISchedDAGs) + viewGraph(); topologicalSort(); findRootsAndBiasEdges(TopRoots, BotRoots);