aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-20 04:30:30 +0000
committerChris Lattner <sabre@nondot.org>2005-03-20 04:30:30 +0000
commitcc9bda6a416af8393b7227d5830974a48f9c2f7e (patch)
tree3f8549fc76fb773149baab57d54a4ed2c23adbbd /lib/Analysis/DataStructure/DataStructure.cpp
parent1fd7d4a67067980e6a8c6575bcf0bf59ee79be17 (diff)
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
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp37
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 416766b166..ed7fa9ac4f 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<GlobalValue>(I->first)) {
+ if (GlobalValue* GV = dyn_cast<GlobalValue>(I->first))
ScalarMap[GV].mergeWith(H);
- if (CloneFlags & DSGraph::UpdateInlinedGlobals)
- InlinedGlobals.insert(GV);
- }
}
if (!(CloneFlags & DontCloneCallNodes)) {