diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:42:51 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:42:51 +0000 |
commit | 56fe8f14099930935e3870e3e823c322a85c1c89 (patch) | |
tree | b3032e51d630e8070e9e08d6641648f195316a80 /lib/CodeGen/PostRASchedulerList.cpp | |
parent | 6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (diff) | |
download | src-56fe8f14099930935e3870e3e823c322a85c1c89.tar.gz src-56fe8f14099930935e3870e3e823c322a85c1c89.zip |
Vendor import of llvm trunk r132879:vendor/llvm/llvm-r132879
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=223013
svn path=/vendor/llvm/llvm-r132879/; revision=223014; tag=vendor/llvm/llvm-r132879
Diffstat (limited to 'lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r-- | lib/CodeGen/PostRASchedulerList.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index 60c24b710792..ba8501ff7233 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -304,7 +304,7 @@ void SchedulePostRATDList::Schedule() { if (AntiDepBreak != NULL) { unsigned Broken = AntiDepBreak->BreakAntiDependencies(SUnits, Begin, InsertPos, - InsertPosIndex); + InsertPosIndex, DbgValues); if (Broken != 0) { // We made changes. Update the dependency graph. @@ -540,10 +540,16 @@ void SchedulePostRATDList::ReleaseSucc(SUnit *SU, SDep *SuccEdge) { #endif --SuccSU->NumPredsLeft; - // Compute how many cycles it will be before this actually becomes - // available. This is the max of the start time of all predecessors plus - // their latencies. - SuccSU->setDepthToAtLeast(SU->getDepth() + SuccEdge->getLatency()); + // Standard scheduler algorithms will recompute the depth of the successor + // here as such: + // SuccSU->setDepthToAtLeast(SU->getDepth() + SuccEdge->getLatency()); + // + // However, we lazily compute node depth instead. Note that + // ScheduleNodeTopDown has already updated the depth of this node which causes + // all descendents to be marked dirty. Setting the successor depth explicitly + // here would cause depth to be recomputed for all its ancestors. If the + // successor is not yet ready (because of a transitively redundant edge) then + // this causes depth computation to be quadratic in the size of the DAG. // If all the node's predecessors are scheduled, this node is ready // to be scheduled. Ignore the special ExitSU node. @@ -655,6 +661,12 @@ void SchedulePostRATDList::ListScheduleTopDown() { ScheduleNodeTopDown(FoundSUnit, CurCycle); HazardRec->EmitInstruction(FoundSUnit); CycleHasInsts = true; + if (HazardRec->atIssueLimit()) { + DEBUG(dbgs() << "*** Max instructions per cycle " << CurCycle << '\n'); + HazardRec->AdvanceCycle(); + ++CurCycle; + CycleHasInsts = false; + } } else { if (CycleHasInsts) { DEBUG(dbgs() << "*** Finished cycle " << CurCycle << '\n'); |