[llvm-commits] [llvm] r92968 - in /llvm/trunk/include/llvm/Analysis: DominatorInternals.h Dominators.h
Tobias Grosser
grosser at fim.uni-passau.de
Thu Jan 7 15:50:25 PST 2010
Author: grosser
Date: Thu Jan 7 17:50:25 2010
New Revision: 92968
URL: http://llvm.org/viewvc/llvm-project?rev=92968&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Analysis/DominatorInternals.h
llvm/trunk/include/llvm/Analysis/Dominators.h
Modified: llvm/trunk/include/llvm/Analysis/DominatorInternals.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DominatorInternals.h?rev=92968&r1=92967&r2=92968&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DominatorInternals.h (original)
+++ llvm/trunk/include/llvm/Analysis/DominatorInternals.h Thu Jan 7 17:50:25 2010
@@ -347,15 +347,8 @@
DT.IDoms.clear();
DT.Info.clear();
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
- // demanded.
- DT.DFSInfoValid = false;
+ DT.updateDFSNumbers();
}
}
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=92968&r1=92967&r2=92968&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Thu Jan 7 17:50:25 2010
@@ -652,21 +652,17 @@
/// recalculate - compute a dominator tree for the given function
template<class FT>
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->IDoms[&F.front()] = 0;
this->DomTreeNodes[&F.front()] = 0;
- this->Vertex.push_back(0);
Calculate<FT, NodeT*>(*this, F);
-
- updateDFSNumbers();
} else {
- reset(); // Reset from the last time we were run...
-
// Initialize the roots list
for (typename FT::iterator I = F.begin(), E = F.end(); I != E; ++I) {
if (std::distance(GraphTraits<FT*>::child_begin(I),
@@ -678,8 +674,6 @@
this->DomTreeNodes[I] = 0;
}
- this->Vertex.push_back(0);
-
Calculate<FT, Inverse<NodeT*> >(*this, F);
}
}
More information about the llvm-commits
mailing list