[llvm-commits] [poolalloc] r113559 - /poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
Will Dietz
wdietz2 at illinois.edu
Thu Sep 9 16:15:52 PDT 2010
Author: wdietz2
Date: Thu Sep 9 18:15:52 2010
New Revision: 113559
URL: http://llvm.org/viewvc/llvm-project?rev=113559&view=rev
Log:
Simplify CBU code greatly, fix bug due to not using the NH by reference.
Modified:
poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=113559&r1=113558&r2=113559&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original)
+++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Thu Sep 9 18:15:52 2010
@@ -123,6 +123,7 @@
}
#endif
+
//
// Note: The code above and below is dealing with the fact that the targets
// of *direct* function calls do not show up in the Scalar Map of the
@@ -160,30 +161,9 @@
// bur are not the targets of an indirect function call site, they will not
// be merged by CBU.
- DSNodeHandle SrcNH;
- while(csi != cse) {
- const Function *F = *csi;
- DSCallGraph::scc_iterator sccii = callgraph.scc_begin(F),
- sccee = callgraph.scc_end(F);
- while(sccii != sccee && SM.find(*sccii) == SM.end()) {
- ++sccii;
- }
- if(sccii == sccee) {
- ++csi;
- continue;
- }
- SrcNH = SM.find(*sccii)->second;
- ++sccii;
- for(;sccii != sccee; ++sccii) {
- DSGraph::ScalarMapTy::const_iterator I = SM.find(*sccii);
- if (I != SM.end()) {
- SrcNH.mergeWith(I->second);
- }
- }
- ++csi;
- break;
- }
-
+ // This NH starts off empty, but ends up merging them all together
+ DSNodeHandle calleesNH;
+
while(csi != cse) {
const Function *F = *csi;
DSCallGraph::scc_iterator sccii = callgraph.scc_begin(F),
@@ -191,7 +171,7 @@
for(;sccii != sccee; ++sccii) {
DSGraph::ScalarMapTy::const_iterator I = SM.find(*sccii);
if (I != SM.end()) {
- SrcNH.mergeWith(I->second);
+ calleesNH.mergeWith(I->second);
}
}
++csi;
More information about the llvm-commits
mailing list