From cf15db34d3c0eecdc78fa958a73891b897cd2b02 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 17 Oct 2002 20:09:52 +0000 Subject: * Make the DSGraph cloner automatically merge global nodes * BUClosure doesn't have to worry about global nodes * TDClosure now works with global nodes * Reenable DNE on TD pass, now that globals work right git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4220 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/BottomUpClosure.cpp | 34 -------------------------- 1 file changed, 34 deletions(-) (limited to 'lib/Analysis/DataStructure/BottomUpClosure.cpp') diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index 7601524dd2..acb90a27bb 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -71,35 +71,6 @@ static void ResolveArguments(std::vector &Call, Function &F, } } -// MergeGlobalNodes - Merge all existing global nodes with globals -// inlined from the callee or with globals from the GlobalsGraph. -// -static void MergeGlobalNodes(DSGraph &Graph, - map &OldValMap) { - map &ValMap = Graph.getValueMap(); - for (map::iterator I = ValMap.begin(), E = ValMap.end(); - I != E; ++I) - if (GlobalValue *GV = dyn_cast(I->first)) { - map::iterator NHI = OldValMap.find(GV); - if (NHI != OldValMap.end()) // was it inlined from the callee? - I->second.mergeWith(NHI->second); -#if 0 - else // get it from the GlobalsGraph - I->second.mergeWith(Graph.cloneGlobalInto(GV)); -#endif - } - - // Add unused inlined global nodes into the value map - for (map::iterator I = OldValMap.begin(), - E = OldValMap.end(); I != E; ++I) - if (isa(I->first)) { - DSNodeHandle &NH = ValMap[I->first]; // If global is not in ValMap... - if (NH.getNode() == 0) - NH = I->second; // Add the one just inlined. - } - -} - DSGraph &BUDataStructures::calculateGraph(Function &F) { // Make sure this graph has not already been calculated, or that we don't get // into an infinite loop with mutually recursive functions. @@ -191,11 +162,6 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) { if (Call[0].getNode()) // Handle the return value if present RetVal.mergeWith(Call[0]); - // Merge global value nodes in the inlined graph with the global - // value nodes in the current graph if there are duplicates. - // - MergeGlobalNodes(*Graph, OldValMap); - // Erase the entry in the Callees vector Callees.erase(Callees.begin()+c--); -- cgit v1.2.3