aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2005-12-18 04:40:52 +0000
committerJim Laskey <jlaskey@mac.com>2005-12-18 04:40:52 +0000
commitbd2b6214862ccc33d3bb63005faa15c16ee51c49 (patch)
treee230c3dff4f1475eba6461cf517ae07123decdc1 /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
parent9022ed955adc8ecdc8ebf19bb05efea924d1ad0e (diff)
Fix a bug Sabre was having where the DAG root was a group. The group dominator
needed to be added to the ordering list, not the first member of the group. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index ef90fc048c..03a0dd1200 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -682,7 +682,12 @@ void SimpleSched::IncludeNode(NodeInfo *NI) {
/// Note that the ordering in the Nodes vector is reversed.
void SimpleSched::VisitAll() {
// Add first element to list
- Ordering.push_back(getNI(DAG.getRoot().Val));
+ NodeInfo *NI = getNI(DAG.getRoot().Val);
+ if (NI->isInGroup()) {
+ Ordering.push_back(NI->Group->getDominator());
+ } else {
+ Ordering.push_back(NI);
+ }
// Iterate through all nodes that have been added
for (unsigned i = 0; i < Ordering.size(); i++) { // note: size() varies