diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-05 00:15:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-05 00:15:57 +0000 |
commit | 2f0d1ea864ff0fe59c5a2b35390a82fad2865b61 (patch) | |
tree | 6077de77399815b5811c1843db166b8a884a1574 /lib/VMCore | |
parent | 7ae8c4c810935625bcdbdf832a33ef4032bad906 (diff) | |
download | external_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/VMCore')
-rw-r--r-- | lib/VMCore/Dominators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp index 6231eb8..7d0fbaa 100644 --- a/lib/VMCore/Dominators.cpp +++ b/lib/VMCore/Dominators.cpp @@ -211,7 +211,7 @@ unsigned DominatorTree::DFSPass(BasicBlock *V, unsigned N) { void DominatorTree::Compress(BasicBlock *VIn) { std::vector<BasicBlock *> Work; - std::set<BasicBlock *> Visited; + SmallPtrSet<BasicBlock *, 32> Visited; BasicBlock *VInAncestor = Info[VIn].Ancestor; InfoRec &VInVAInfo = Info[VInAncestor]; @@ -225,9 +225,9 @@ void DominatorTree::Compress(BasicBlock *VIn) { InfoRec &VAInfo = Info[VAncestor]; // Process Ancestor first - if (Visited.count(VAncestor) == 0 && VAInfo.Ancestor != 0) { + if (Visited.insert(VAncestor) && + VAInfo.Ancestor != 0) { Work.push_back(VAncestor); - Visited.insert(VAncestor); continue; } Work.pop_back(); |