mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user