[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Feb 9 18:16:01 PST 2003
Changes in directory llvm/lib/Analysis/DataStructure:
Steensgaard.cpp updated: 1.23 -> 1.24
---
Log message:
Make steensgaards performance not shameful
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.23 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.24
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.23 Sun Feb 9 13:26:47 2003
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Sun Feb 9 18:14:57 2003
@@ -121,6 +121,7 @@
// Loop over the rest of the module, merging graphs for non-external functions
// into this graph.
//
+ unsigned Count = 0;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal()) {
hash_map<Value*, DSNodeHandle> ValMap;
@@ -142,6 +143,9 @@
for (hash_map<Value*, DSNodeHandle>::iterator I = ValMap.begin(),
E = ValMap.end(); I != E; ++I)
GVM[I->first].mergeWith(I->second);
+
+ if ((++Count & 1) == 0) // Prune nodes out every other time...
+ ResultGraph->removeTriviallyDeadNodes();
}
// FIXME: Must recalculate and use the Incomplete markers!!
@@ -174,15 +178,17 @@
ResolveFunctionCall(F, CurCall, RetValMap[F]);
Eliminated = true;
}
- if (Eliminated)
- CallTargets.erase(CallTargets.begin()+c);
- else
+ if (Eliminated) {
+ CallTargets[c] = CallTargets.back();
+ CallTargets.pop_back();
+ } else
++c; // Cannot eliminate this call, skip over it...
}
- if (CallTargets.empty()) // Eliminated all calls?
- Calls.erase(Calls.begin()+i); // Remove from call list...
- else
+ if (CallTargets.empty()) { // Eliminated all calls?
+ CurCall = Calls.back(); // Remove entry
+ Calls.pop_back();
+ } else
++i; // Skip this call site...
}
More information about the llvm-commits
mailing list