[llvm-branch-commits] [llvm-branch] r121526 - /llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h

Daniel Dunbar daniel at zuster.org
Fri Dec 10 13:31:43 PST 2010


Author: ddunbar
Date: Fri Dec 10 15:31:43 2010
New Revision: 121526

URL: http://llvm.org/viewvc/llvm-project?rev=121526&view=rev
Log:
Merge r120003:
--
Author: Cameron Zwarich <zwarich at apple.com>
Date:   Tue Nov 23 06:32:37 2010 +0000

    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.

Modified:
    llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h

Modified: llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h?rev=121526&r1=121525&r2=121526&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/Analysis/DominatorInternals.h Fri Dec 10 15:31:43 2010
@@ -278,9 +278,16 @@
       }
     }
 
-    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





More information about the llvm-branch-commits mailing list