summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-02-22 06:08:11 +0000
committerAndrew Trick <atrick@apple.com>2012-02-22 06:08:11 +0000
commit46cc9a4aaa1c3c110ba7d925cbba402b769441a5 (patch)
tree7f51c4c531db9f7c9dd0b464ca6a8f469ec9db05 /llvm/lib/CodeGen/MachineScheduler.cpp
parent760b134ffa8bb88ccc96fc2230ab7e5fa501e921 (diff)
downloadbcm5719-llvm-46cc9a4aaa1c3c110ba7d925cbba402b769441a5.tar.gz
bcm5719-llvm-46cc9a4aaa1c3c110ba7d925cbba402b769441a5.zip
Initialize SUnits before DAG building.
Affect on SD scheduling and postRA scheduling: Printing the DAG will display the nodes in top-down topological order. This matches the order within the MBB and makes my life much easier in general. Affect on misched: We don't need to track virtual register uses at all. This is awesome. I also intend to rely on the SUnit ID as a topo-sort index. So if A < B then we cannot have an edge B -> A. llvm-svn: 151135
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 6034c9082c4..8a485e0fdef 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -149,7 +149,8 @@ protected:
MachineScheduler *Pass;
public:
ScheduleTopDownLive(MachineScheduler *P):
- ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false), Pass(P) {}
+ ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false, P->LIS),
+ Pass(P) {}
/// ScheduleDAGInstrs callback.
void Schedule();
@@ -310,7 +311,8 @@ class DefaultMachineScheduler : public ScheduleDAGInstrs {
MachineScheduler *Pass;
public:
DefaultMachineScheduler(MachineScheduler *P):
- ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false), Pass(P) {}
+ ScheduleDAGInstrs(*P->MF, *P->MLI, *P->MDT, /*IsPostRA=*/false, P->LIS),
+ Pass(P) {}
/// Schedule - This is called back from ScheduleDAGInstrs::Run() when it's
/// time to do some work.
@@ -348,15 +350,14 @@ void DefaultMachineScheduler::Schedule() {
#ifndef NDEBUG
namespace {
-// Nodes with a higher number have lower priority. This way we attempt to
+// Nodes with a higher number have higher priority. This way we attempt to
// schedule the latest instructions earliest.
//
// TODO: Relies on the property of the BuildSchedGraph that results in SUnits
-// being ordered in sequence bottom-up. This will be formalized, probably be
-// constructing SUnits in a prepass.
+// being ordered in sequence top-down.
struct ShuffleSUnitOrder {
bool operator()(SUnit *A, SUnit *B) const {
- return A->NodeNum > B->NodeNum;
+ return A->NodeNum < B->NodeNum;
}
};
OpenPOWER on IntegriCloud