[llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Oct 13 11:37:01 PDT 2003
Changes in directory llvm/lib/Analysis:
PostDominators.cpp updated: 1.42 -> 1.43
---
Log message:
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.
---
Diffs of the changes: (+3 -3)
Index: llvm/lib/Analysis/PostDominators.cpp
diff -u llvm/lib/Analysis/PostDominators.cpp:1.42 llvm/lib/Analysis/PostDominators.cpp:1.43
--- llvm/lib/Analysis/PostDominators.cpp:1.42 Thu Sep 11 13:12:02 2003
+++ llvm/lib/Analysis/PostDominators.cpp Mon Oct 13 11:36:06 2003
@@ -51,12 +51,12 @@
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?
More information about the llvm-commits
mailing list