9.7% speedup running domtree on test-suite.
Reviewed by Chris Lattner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120003
91177308-0d34-0410-b5e6-
96231b3b80d8
- DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W);
-
typename GraphT::NodeType* WParent = DT.Vertex[WInfo.Parent];
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
Link<GraphT>(DT, WInfo.Parent, W, WInfo);
// Step #3: Implicitly define the immediate dominator of vertices