aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/PostDominators.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-05 00:15:57 +0000
committerChris Lattner <sabre@nondot.org>2007-08-05 00:15:57 +0000
commit2f0d1ea864ff0fe59c5a2b35390a82fad2865b61 (patch)
tree6077de77399815b5811c1843db166b8a884a1574 /lib/Analysis/PostDominators.cpp
parent7ae8c4c810935625bcdbdf832a33ef4032bad906 (diff)
downloadexternal_llvm-2f0d1ea864ff0fe59c5a2b35390a82fad2865b61.zip
external_llvm-2f0d1ea864ff0fe59c5a2b35390a82fad2865b61.tar.gz
external_llvm-2f0d1ea864ff0fe59c5a2b35390a82fad2865b61.tar.bz2
Switch some std::sets to SmallPtrSet. This speeds up
domtree by 10% and postdomtree by 17% git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40829 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PostDominators.cpp')
-rw-r--r--lib/Analysis/PostDominators.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp
index 244f8cd..d2892de 100644
--- a/lib/Analysis/PostDominators.cpp
+++ b/lib/Analysis/PostDominators.cpp
@@ -29,7 +29,7 @@ F("postdomtree", "Post-Dominator Tree Construction", true);
unsigned PostDominatorTree::DFSPass(BasicBlock *V, unsigned N) {
std::vector<BasicBlock *> workStack;
- std::set<BasicBlock *> visited;
+ SmallPtrSet<BasicBlock *, 32> Visited;
workStack.push_back(V);
do {
@@ -37,7 +37,7 @@ unsigned PostDominatorTree::DFSPass(BasicBlock *V, unsigned N) {
InfoRec &CurVInfo = Info[currentBB];
// Visit each block only once.
- if (visited.insert(currentBB).second) {
+ if (Visited.insert(currentBB)) {
CurVInfo.Semi = ++N;
CurVInfo.Label = currentBB;
@@ -55,7 +55,7 @@ unsigned PostDominatorTree::DFSPass(BasicBlock *V, unsigned N) {
InfoRec &SuccVInfo = Info[*PI];
if (SuccVInfo.Semi == 0) {
SuccVInfo.Parent = currentBB;
- if (!visited.count(*PI)) {
+ if (!Visited.count(*PI)) {
workStack.push_back(*PI);
visitChild = true;
}