Fix a bug Sabre was having where the DAG root was a group. The group dominator
authorJim Laskey <jlaskey@mac.com>
Sun, 18 Dec 2005 04:40:52 +0000 (04:40 +0000)
committerJim Laskey <jlaskey@mac.com>
Sun, 18 Dec 2005 04:40:52 +0000 (04:40 +0000)
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

lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

index ef90fc048c537b63629725d710f83e2d099ffad6..03a0dd1200c1fedbf4fd17ef5cc07f3650303b26 100644 (file)
@@ -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