diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-13 16:36:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-13 16:36:06 +0000 |
commit | 50b5d71cb73144823dba1e0521f8ac2eab7dec66 (patch) | |
tree | d02e34583975100209a993218ac7e8b6f5bdecbc /lib/Analysis/PostDominators.cpp | |
parent | 9061e992d5ee0c59c89ae7812c551bafd680a59c (diff) |
Make use of "external" depth-first iterators to avoid revisiting nodes
multiple times. This reduces the time to construct post-dominance sets a LOT.
For example, optimizing perlbmk goes from taking 12.9894s to 1.4074s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PostDominators.cpp')
-rw-r--r-- | lib/Analysis/PostDominators.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index f97fda854e..2ff5fd331a 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -51,12 +51,12 @@ bool PostDominatorSet::runOnFunction(Function &F) { do { Changed = false; - std::set<const BasicBlock*> Visited; + std::set<BasicBlock*> Visited; DomSetType WorkingSet; for (unsigned i = 0, e = Roots.size(); i != e; ++i) - for (idf_iterator<BasicBlock*> It = idf_begin(Roots[i]), - E = idf_end(Roots[i]); It != E; ++It) { + for (idf_ext_iterator<BasicBlock*> It = idf_ext_begin(Roots[i], Visited), + E = idf_ext_end(Roots[i], Visited); It != E; ++It) { BasicBlock *BB = *It; succ_iterator SI = succ_begin(BB), SE = succ_end(BB); if (SI != SE) { // Is there SOME successor? |