aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-12 03:52:09 +0000
committerChris Lattner <sabre@nondot.org>2006-03-12 03:52:09 +0000
commitb2215030d6a6c3096ed5da8fde43c4eed7165768 (patch)
tree4f2cf8f23bf99973fadf69798bc12268a50555bd /lib/CodeGen
parent53fbf2a8e810bbdf5ad5d7808fabe9ae4f3497e2 (diff)
Chain operands aren't real uses: they don't require the full latency of the
predecessor to finish before they can start. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
index ac0543d7d7..f3d97fe18c 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
@@ -387,8 +387,6 @@ void ScheduleDAGList::dumpSchedule() const {
}
/// Schedule - Schedule the DAG using list scheduling.
-/// FIXME: Right now it only supports the burr (bottom up register reducing)
-/// heuristic.
void ScheduleDAGList::Schedule() {
DEBUG(std::cerr << "********** List Scheduling **********\n");
@@ -552,8 +550,16 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SuccSU, bool isChain) {
unsigned AvailableCycle = 0;
for (std::set<std::pair<SUnit*, bool> >::iterator I = SuccSU->Preds.begin(),
E = SuccSU->Preds.end(); I != E; ++I) {
- AvailableCycle = std::max(AvailableCycle,
- I->first->Cycle + I->first->Latency);
+ // If this is a token edge, we don't need to wait for the full latency of
+ // the preceeding instruction (e.g. a long-latency load) unless there is
+ // also some other data dependence.
+ unsigned PredDoneCycle = I->first->Cycle;
+ if (!I->second)
+ PredDoneCycle += I->first->Latency;
+ else
+ PredDoneCycle += 1;
+
+ AvailableCycle = std::max(AvailableCycle, PredDoneCycle);
}
PendingQueue.push_back(std::make_pair(AvailableCycle, SuccSU));