mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 16:53:02 +00:00
Remove workaround in PostDominators
Remove a FIXME and unify code that was necessary to work around broken updateDFSNumbers(). Before updateDFSNumbers() did not work correctly for post dominators. llvm-svn: 92968
This commit is contained in:
parent
fbc9ea7841
commit
35528e6f1d
@ -347,15 +347,8 @@ void Calculate(DominatorTreeBase<typename GraphTraits<NodeT>::NodeType>& DT,
|
|||||||
DT.IDoms.clear();
|
DT.IDoms.clear();
|
||||||
DT.Info.clear();
|
DT.Info.clear();
|
||||||
std::vector<typename GraphT::NodeType*>().swap(DT.Vertex);
|
std::vector<typename GraphT::NodeType*>().swap(DT.Vertex);
|
||||||
|
|
||||||
// FIXME: This does not work on PostDomTrees. It seems likely that this is
|
|
||||||
// due to an error in the algorithm for post-dominators. This really should
|
|
||||||
// be investigated and fixed at some point.
|
|
||||||
// DT.updateDFSNumbers();
|
|
||||||
|
|
||||||
// Start out with the DFS numbers being invalid. Let them be computed if
|
DT.updateDFSNumbers();
|
||||||
// demanded.
|
|
||||||
DT.DFSInfoValid = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -652,21 +652,17 @@ public:
|
|||||||
/// recalculate - compute a dominator tree for the given function
|
/// recalculate - compute a dominator tree for the given function
|
||||||
template<class FT>
|
template<class FT>
|
||||||
void recalculate(FT& F) {
|
void recalculate(FT& F) {
|
||||||
if (!this->IsPostDominators) {
|
reset();
|
||||||
reset();
|
this->Vertex.push_back(0);
|
||||||
|
|
||||||
// Initialize roots
|
if (!this->IsPostDominators) {
|
||||||
|
// Initialize root
|
||||||
this->Roots.push_back(&F.front());
|
this->Roots.push_back(&F.front());
|
||||||
this->IDoms[&F.front()] = 0;
|
this->IDoms[&F.front()] = 0;
|
||||||
this->DomTreeNodes[&F.front()] = 0;
|
this->DomTreeNodes[&F.front()] = 0;
|
||||||
this->Vertex.push_back(0);
|
|
||||||
|
|
||||||
Calculate<FT, NodeT*>(*this, F);
|
Calculate<FT, NodeT*>(*this, F);
|
||||||
|
|
||||||
updateDFSNumbers();
|
|
||||||
} else {
|
} else {
|
||||||
reset(); // Reset from the last time we were run...
|
|
||||||
|
|
||||||
// Initialize the roots list
|
// Initialize the roots list
|
||||||
for (typename FT::iterator I = F.begin(), E = F.end(); I != E; ++I) {
|
for (typename FT::iterator I = F.begin(), E = F.end(); I != E; ++I) {
|
||||||
if (std::distance(GraphTraits<FT*>::child_begin(I),
|
if (std::distance(GraphTraits<FT*>::child_begin(I),
|
||||||
@ -678,8 +674,6 @@ public:
|
|||||||
this->DomTreeNodes[I] = 0;
|
this->DomTreeNodes[I] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->Vertex.push_back(0);
|
|
||||||
|
|
||||||
Calculate<FT, Inverse<NodeT*> >(*this, F);
|
Calculate<FT, Inverse<NodeT*> >(*this, F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user