mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
Optimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a
9.7% speedup running domtree on test-suite. Reviewed by Chris Lattner. llvm-svn: 120003
This commit is contained in:
parent
a830fc6a45
commit
1fa40011ae
@ -278,9 +278,16 @@ void Calculate(DominatorTreeBase<typename GraphTraits<NodeT>::NodeType>& DT,
|
||||
}
|
||||
}
|
||||
|
||||
DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W);
|
||||
|
||||
typename GraphT::NodeType* WParent = DT.Vertex[WInfo.Parent];
|
||||
|
||||
// If V is a non-root vertex and sdom(V) = parent(V), then idom(V) is
|
||||
// necessarily parent(V). In this case, set idom(V) here and avoid placing
|
||||
// V into a bucket.
|
||||
if (WInfo.Semi == WInfo.Parent)
|
||||
DT.IDoms[W] = WParent;
|
||||
else
|
||||
DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W);
|
||||
|
||||
Link<GraphT>(DT, WInfo.Parent, W, WInfo);
|
||||
|
||||
// Step #3: Implicitly define the immediate dominator of vertices
|
||||
|
Loading…
Reference in New Issue
Block a user