1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

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.

llvm-svn: 24816
This commit is contained in:
Jim Laskey 2005-12-18 04:40:52 +00:00
parent a06085f024
commit 831eca00db

View 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