mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Fix DFS number calculation for postdominators
The DFS number calculation for postdominators was broken. In the case of multiple exits that form the post dominator root nodes, do not iterate over all exits, but start from the virtual root node. Otherwise bbs, that are not post dominated by any exit but by the virtual root node, will never be assigned a DFS number. llvm-svn: 92967
This commit is contained in:
parent
944f9c4ac1
commit
fbc9ea7841
@ -585,8 +585,15 @@ protected:
|
||||
SmallVector<std::pair<DomTreeNodeBase<NodeT>*,
|
||||
typename DomTreeNodeBase<NodeT>::iterator>, 32> WorkStack;
|
||||
|
||||
for (unsigned i = 0, e = (unsigned)this->Roots.size(); i != e; ++i) {
|
||||
DomTreeNodeBase<NodeT> *ThisRoot = getNode(this->Roots[i]);
|
||||
DomTreeNodeBase<NodeT> *ThisRoot = getRootNode();
|
||||
|
||||
if (!ThisRoot)
|
||||
return;
|
||||
|
||||
// Even in the case of multiple exits that form the post dominator root
|
||||
// nodes, do not iterate over all exits, but start from the virtual root
|
||||
// node. Otherwise bbs, that are not post dominated by any exit but by the
|
||||
// virtual root node, will never be assigned a DFS number.
|
||||
WorkStack.push_back(std::make_pair(ThisRoot, ThisRoot->begin()));
|
||||
ThisRoot->DFSNumIn = DFSNum++;
|
||||
|
||||
@ -609,7 +616,6 @@ protected:
|
||||
Child->DFSNumIn = DFSNum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SlowQueries = 0;
|
||||
DFSInfoValid = true;
|
||||
|
Loading…
Reference in New Issue
Block a user