diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-23 20:20:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-23 20:20:43 +0000 |
commit | fa9afef7eaa0865fb9f3489a68a04332b232ed82 (patch) | |
tree | 7adf59cd1003eda1fef0594aaab57cc571460809 /lib/CodeGen/SelectionDAG | |
parent | 3e744c8bc406d9cf22477a07da8cbbc8d07cdbe1 (diff) | |
download | external_llvm-fa9afef7eaa0865fb9f3489a68a04332b232ed82.zip external_llvm-fa9afef7eaa0865fb9f3489a68a04332b232ed82.tar.gz external_llvm-fa9afef7eaa0865fb9f3489a68a04332b232ed82.tar.bz2 |
When unfolding a load during scheduling, the new operator node has
a data dependency on the load node, so it really needs a
data-dependence edge to the load node, even if the load previously
existed.
And add a few comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 8e44997..705e4de 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -410,6 +410,7 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) { NewSU->isCommutable = true; ComputeLatency(NewSU); + // Record all the edges to and from the old SU, by category. SmallVector<SDep, 4> ChainPreds; SmallVector<SDep, 4> ChainSuccs; SmallVector<SDep, 4> LoadPreds; @@ -433,6 +434,7 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) { NodeSuccs.push_back(*I); } + // Now assign edges to the newly-created nodes. for (unsigned i = 0, e = ChainPreds.size(); i != e; ++i) { const SDep &Pred = ChainPreds[i]; RemovePred(SU, Pred); @@ -468,9 +470,10 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) { AddPred(SuccDep, D); } } - if (isNewLoad) { - AddPred(NewSU, SDep(LoadSU, SDep::Order, LoadSU->Latency)); - } + + // Add a data dependency to reflect that NewSU reads the value defined + // by LoadSU. + AddPred(NewSU, SDep(LoadSU, SDep::Data, LoadSU->Latency)); if (isNewLoad) AvailableQueue->addNode(LoadSU); |