[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Feb 27 14:06:38 PST 2004
Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.77 -> 1.78
DataStructure.cpp updated: 1.162 -> 1.163
---
Log message:
Only clone global nodes between graphs if both graphs have the global.
---
Diffs of the changes: (+9 -13)
Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.77 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.78
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.77 Fri Feb 20 18:30:28 2004
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Fri Feb 27 14:05:14 2004
@@ -279,6 +279,9 @@
//
DSGraph &GI = getDSGraph(*Callee); // Graph to inline
+ if (Callee->getName() == "bc_raise")
+ std::cerr << "HERE!\n";
+
DEBUG(std::cerr << " Inlining graph for " << Callee->getName()
<< "[" << GI.getGraphSize() << "+"
<< GI.getAuxFunctionCalls().size() << "] into '"
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.162 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.163
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.162 Wed Feb 25 21:45:03 2004
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Fri Feb 27 14:05:15 2004
@@ -33,10 +33,6 @@
Statistic<> NumDNE ("dsa", "Number of nodes removed by reachability");
Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed");
Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
-
- cl::opt<bool>
- EnableDSNodeGlobalRootsHack("enable-dsa-globalrootshack", cl::Hidden,
- cl::desc("Make DSA less aggressive when cloning graphs"));
};
#if 1
@@ -1239,15 +1235,12 @@
AuxFunctionCalls.push_back(DSCallSite(Graph.AuxFunctionCalls[i], RC));
}
- // If the user requested it, add the nodes that we need to clone to the
- // RootNodes set.
- if (!EnableDSNodeGlobalRootsHack)
- // FIXME: Why is this not iterating over the globals in the graph??
- for (node_iterator NI = Graph.node_begin(), E = Graph.node_end();
- NI != E; ++NI)
- if (!(*NI)->getGlobals().empty())
- RC.getClonedNH(*NI);
-
+ // Clone over all globals that appear in the caller and callee graphs.
+ for (DSScalarMap::global_iterator GI = Graph.getScalarMap().global_begin(),
+ E = Graph.getScalarMap().global_end(); GI != E; ++GI)
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*GI))
+ if (ScalarMap.count(GV))
+ RC.merge(ScalarMap[GV], Graph.getNodeForValue(GV));
} else {
DSNodeHandle RetVal = getReturnNodeFor(F);
More information about the llvm-commits
mailing list