diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-27 20:05:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-27 20:05:15 +0000 |
commit | 06a573f63d14a8823bb6a671df7f89ed2d236c87 (patch) | |
tree | 05266a42f595903a457dbf8205de74abb925908d /llvm/lib | |
parent | 98f8ca40179063c775e3a2c6f056f2184b01931e (diff) | |
download | bcm5719-llvm-06a573f63d14a8823bb6a671df7f89ed2d236c87.tar.gz bcm5719-llvm-06a573f63d14a8823bb6a671df7f89ed2d236c87.zip |
Only clone global nodes between graphs if both graphs have the global.
llvm-svn: 11928
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Analysis/DataStructure/DataStructure.cpp | 19 |
2 files changed, 9 insertions, 13 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp index 2125064030e..08a5a158349 100644 --- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -279,6 +279,9 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) { // 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 '" diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index fd252304b24..270a0bf9e0c 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -33,10 +33,6 @@ namespace { 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 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F, 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); |