aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/Dominators.h
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-01-02 07:03:00 +0000
committerCameron Zwarich <zwarich@apple.com>2011-01-02 07:03:00 +0000
commit8252ad1351594039fa5d6633ff3eef1bafb7fdf9 (patch)
tree5381ccfb7b0747b75fd55df1baaa81dad13e5184 /include/llvm/Analysis/Dominators.h
parente2c43920919c6fe376613d1d8331897dc1ba3d57 (diff)
Speed up dominator computation some more by optimizing bucket processing. When
naively implemented, the Lengauer-Tarjan algorithm requires a separate bucket for each vertex. However, this is unnecessary, because each vertex is only placed into a single bucket (that of its semidominator), and each vertex's bucket is processed before it is added to any bucket itself. Instead of using a bucket per vertex, we use a single array Buckets that has two purposes. Before the vertex V with DFS number i is processed, Buckets[i] stores the index of the first element in V's bucket. After V's bucket is processed, Buckets[i] stores the index of the next element in the bucket to which V now belongs, if any. Reading from the buckets can also be optimized. Instead of processing the bucket of V's parent at the end of processing V, we process the bucket of V itself at the beginning of processing V. This means that the case of the root vertex can be simplified somewhat. It also means that we don't need to look up the DFS number of the semidominator of every node in the bucket we are processing, since we know it is the current index being processed. This is a 6.5% speedup running -domtree on test-suite + SPEC2000/2006, with larger speedups of around 12% on the larger benchmarks like GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/Dominators.h')
-rw-r--r--include/llvm/Analysis/Dominators.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 1eefe7502c..71f26b1f22 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -210,8 +210,6 @@ protected:
NodeT *Label, *Child;
unsigned Parent, Ancestor;
- std::vector<NodeT*> Bucket;
-
InfoRec() : DFSNum(0), Semi(0), Size(0), Label(0), Child(0), Parent(0),
Ancestor(0) {}
};