Get clone flags right, so we don't build InlinedGlobals only to clear them
authorChris Lattner <sabre@nondot.org>
Tue, 27 Jan 2004 21:50:41 +0000 (21:50 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Jan 2004 21:50:41 +0000 (21:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10984 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/BottomUpClosure.cpp
lib/Analysis/DataStructure/CompleteBottomUp.cpp

index f207c5235294659e2fc216b87bb7e1c435f604b2..1406da7738a44acc308c4fb52b946f5093a02e89 100644 (file)
@@ -187,8 +187,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
       if (&G != SCCGraph) {
         DSGraph::NodeMapTy NodeMap;
         SCCGraph->cloneInto(G, SCCGraph->getScalarMap(),
-                            SCCGraph->getReturnNodes(), NodeMap,
-                            DSGraph::UpdateInlinedGlobals);
+                            SCCGraph->getReturnNodes(), NodeMap);
         // Update the DSInfo map and delete the old graph...
         DSInfo[*I] = SCCGraph;
         delete &G;
@@ -196,7 +195,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
     }
 
     // Clean up the graph before we start inlining a bunch again...
-    SCCGraph->removeTriviallyDeadNodes();
+    SCCGraph->removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
 
     // Now that we have one big happy family, resolve all of the call sites in
     // the graph...
@@ -283,7 +282,6 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
             << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() << "+"
             << Graph.getAuxFunctionCalls().size() << "]\n");
       
-      // Handle self recursion by resolving the arguments and return value
       Graph.mergeInGraph(CS, *Callee, GI,
                          DSGraph::KeepModRefBits | 
                          DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes);
@@ -304,7 +302,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
 
   // Re-materialize nodes from the globals graph.
   // Do not ignore globals inlined from callees -- they are not up-to-date!
-  Graph.getInlinedGlobals().clear();
+  assert(Graph.getInlinedGlobals().empty());
   Graph.updateFromGlobalGraph();
 
   // Recompute the Incomplete markers
index 0cbe0257b56f5a0bdb67c2fa5f1132574bd41553..58327016dc4ef20b6516ec6f078b821c5a0d9588 100644 (file)
@@ -141,8 +141,7 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
     ValMap[NG] = ~0U;
 
     DSGraph::NodeMapTy NodeMap;
-    FG.cloneInto(*NG, FG.getScalarMap(), FG.getReturnNodes(), NodeMap,
-                 DSGraph::UpdateInlinedGlobals);
+    FG.cloneInto(*NG, FG.getScalarMap(), FG.getReturnNodes(), NodeMap);
 
     // Update the DSInfo map and delete the old graph...
     for (DSGraph::ReturnNodesTy::iterator I = NG->getReturnNodes().begin();
@@ -194,7 +193,7 @@ void CompleteBUDataStructures::processGraph(DSGraph &G) {
 
   // Re-materialize nodes from the globals graph.
   // Do not ignore globals inlined from callees -- they are not up-to-date!
-  G.getInlinedGlobals().clear();
+  assert(G.getInlinedGlobals().empty());
   G.updateFromGlobalGraph();
 
   // Recompute the Incomplete markers