Keep track of bottom / top element of a set of flagged nodes.

llvm-svn: 25600
This commit is contained in:
Evan Cheng 2006-01-25 09:13:41 +00:00
parent a6eff8a432
commit fbc88a624a
1 changed files with 6 additions and 1 deletions

View File

@ -86,7 +86,7 @@ void ScheduleDAG::IdentifyGroups() {
if (Op.getValueType() != MVT::Flag) break;
// Add to node group
NodeGroup::Add(getNI(Op.Val), NI);
// Let evryone else know
// Let everyone else know
HasGroups = true;
}
}
@ -464,6 +464,7 @@ void NodeGroup::Add(NodeInfo *D, NodeInfo *U) {
// Merge the two lists
DGroup->group_insert(DGroup->group_end(),
UGroup->group_begin(), UGroup->group_end());
DGroup->Bottom = UGroup->Bottom;
} else if (DGroup) {
// Make user member of definers group
U->Group = DGroup;
@ -476,6 +477,7 @@ void NodeGroup::Add(NodeInfo *D, NodeInfo *U) {
DGroup->addPending(-CountInternalUses(DNI, U));
}
DGroup->group_push_back(U);
DGroup->Bottom = U;
} else if (UGroup) {
// Make definer member of users group
D->Group = UGroup;
@ -488,11 +490,14 @@ void NodeGroup::Add(NodeInfo *D, NodeInfo *U) {
UGroup->addPending(-CountInternalUses(D, UNI));
}
UGroup->group_insert(UGroup->group_begin(), D);
UGroup->Top = D;
} else {
D->Group = U->Group = DGroup = new NodeGroup();
DGroup->addPending(D->Node->use_size() + U->Node->use_size() -
CountInternalUses(D, U));
DGroup->group_push_back(D);
DGroup->group_push_back(U);
DGroup->Top = D;
DGroup->Bottom = U;
}
}