From cc9bda6a416af8393b7227d5830974a48f9c2f7e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Mar 2005 04:30:30 +0000 Subject: [PATCH] Remove the ability to keep track of inlined globals, which is always dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20716 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/DataStructure.cpp | 37 +------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 416766b166c..ed7fa9ac4f0 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -922,9 +922,6 @@ DSNodeHandle ReachabilityCloner::getClonedNH(const DSNodeHandle &SrcNH) { assert(DestGNH.getNode() == NH.getNode() &&"Global mapping inconsistent"); Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(), DestGNH.getOffset()+SrcGNH.getOffset())); - - if (CloneFlags & DSGraph::UpdateInlinedGlobals) - Dest.getInlinedGlobals().insert(GV); } NH.getNode()->mergeGlobals(SN->getGlobalsList()); @@ -1014,9 +1011,6 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH, assert(DestGNH.getNode()==NH.getNode() &&"Global mapping inconsistent"); Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(), DestGNH.getOffset()+SrcGNH.getOffset())); - - if (CloneFlags & DSGraph::UpdateInlinedGlobals) - Dest.getInlinedGlobals().insert(GV); } NH.getNode()->mergeGlobals(SN->getGlobalsList()); } @@ -1049,9 +1043,6 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH, assert(SrcGNH.getNode() == SN && "Global mapping inconsistent"); Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(), DestGNH.getOffset()+SrcGNH.getOffset())); - - if (CloneFlags & DSGraph::UpdateInlinedGlobals) - Dest.getInlinedGlobals().insert(GV); } } @@ -1159,7 +1150,6 @@ DSGraph::DSGraph(const DSGraph &G, NodeMapTy &NodeMap, DSGraph::~DSGraph() { FunctionCalls.clear(); AuxFunctionCalls.clear(); - InlinedGlobals.clear(); ScalarMap.clear(); ReturnNodes.clear(); @@ -1189,28 +1179,6 @@ void DSNode::remapLinks(DSGraph::NodeMapTy &OldNodeMap) { } } -/// updateFromGlobalGraph - This function rematerializes global nodes and -/// nodes reachable from them from the globals graph into the current graph. -/// It uses the vector InlinedGlobals to avoid cloning and merging globals that -/// are already up-to-date in the current graph. In practice, in the TD pass, -/// this is likely to be a large fraction of the live global nodes in each -/// function (since most live nodes are likely to have been brought up-to-date -/// in at _some_ caller or callee). -/// -void DSGraph::updateFromGlobalGraph() { - TIME_REGION(X, "updateFromGlobalGraph"); - ReachabilityCloner RC(*this, *GlobalsGraph, 0); - - // Clone the non-up-to-date global nodes into this graph. - for (DSScalarMap::global_iterator I = getScalarMap().global_begin(), - E = getScalarMap().global_end(); I != E; ++I) - if (InlinedGlobals.count(*I) == 0) { // GNode is not up-to-date - DSScalarMap::iterator It = GlobalsGraph->ScalarMap.find(*I); - if (It != GlobalsGraph->ScalarMap.end()) - RC.merge(getNodeForValue(*I), It->second); - } -} - /// addObjectToGraph - This method can be used to add global, stack, and heap /// objects to the graph. This can be used when updating DSGraphs due to the /// introduction of new temporary objects. The new object is not pointed to @@ -1287,11 +1255,8 @@ void DSGraph::cloneInto(const DSGraph &G, DSScalarMap &OldValMap, I->second.getOffset()+MappedNode.getOffset())); // If this is a global, add the global to this fn or merge if already exists - if (GlobalValue* GV = dyn_cast(I->first)) { + if (GlobalValue* GV = dyn_cast(I->first)) ScalarMap[GV].mergeWith(H); - if (CloneFlags & DSGraph::UpdateInlinedGlobals) - InlinedGlobals.insert(GV); - } } if (!(CloneFlags & DontCloneCallNodes)) {