summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-17 20:09:52 +0000
committerChris Lattner <sabre@nondot.org>2002-10-17 20:09:52 +0000
commitb182216df843730cf5d9ff459b0174a8e4ed5bbb (patch)
treeb093c2966bb8b102f58ea80c1b06a02232ff4148 /llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
parent26783a5be58bfe4e0c6f7d6f1cc8ac69b420caea (diff)
downloadbcm5719-llvm-b182216df843730cf5d9ff459b0174a8e4ed5bbb.tar.gz
bcm5719-llvm-b182216df843730cf5d9ff459b0174a8e4ed5bbb.zip
* 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 llvm-svn: 4220
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 7601524dd2d..acb90a27bb4 100644
--- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -71,35 +71,6 @@ static void ResolveArguments(std::vector<DSNodeHandle> &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<Value*, DSNodeHandle> &OldValMap) {
- map<Value*, DSNodeHandle> &ValMap = Graph.getValueMap();
- for (map<Value*, DSNodeHandle>::iterator I = ValMap.begin(), E = ValMap.end();
- I != E; ++I)
- if (GlobalValue *GV = dyn_cast<GlobalValue>(I->first)) {
- map<Value*, DSNodeHandle>::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<Value*, DSNodeHandle>::iterator I = OldValMap.begin(),
- E = OldValMap.end(); I != E; ++I)
- if (isa<GlobalValue>(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--);
OpenPOWER on IntegriCloud