[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 4 11:06:01 PST 2004


Changes in directory llvm/lib/Analysis/DataStructure:

BottomUpClosure.cpp updated: 1.78 -> 1.79

---
Log message:

Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.


---
Diffs of the changes:  (+10 -7)

Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.78 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.79
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.78	Fri Feb 27 14:05:14 2004
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp	Thu Mar  4 11:05:28 2004
@@ -100,6 +100,9 @@
   ValMap[F] = Min;
   Stack.push_back(F);
 
+  // FIXME!  This test should be generalized to be any function that we have
+  // already processed, in the case when there isn't a main or there are
+  // unreachable functions!
   if (F->isExternal()) {   // sprintf, fprintf, sscanf, etc...
     // No callees!
     Stack.pop_back();
@@ -167,6 +170,8 @@
       // graph sizes.
       DSGraph &NFGraph = getDSGraph(*NF);
       SCCGraphs.insert(&NFGraph);
+      // FIXME: If we used a better way of cloning graphs (ie, just splice all
+      // of the nodes into the new graph), this would be completely unneeded!
       if (!SCCGraph || SCCGraph->getGraphSize() < NFGraph.getGraphSize())
         SCCGraph = &NFGraph;
     } while (NF != F);
@@ -186,9 +191,11 @@
            E = SCCGraphs.end(); I != E; ++I) {
       DSGraph &G = **I;
       if (&G != SCCGraph) {
-        DSGraph::NodeMapTy NodeMap;
-        SCCGraph->cloneInto(G, SCCGraph->getScalarMap(),
-                            SCCGraph->getReturnNodes(), NodeMap);
+        {
+          DSGraph::NodeMapTy NodeMap;
+          SCCGraph->cloneInto(G, SCCGraph->getScalarMap(),
+                              SCCGraph->getReturnNodes(), NodeMap);
+        }
         // Update the DSInfo map and delete the old graph...
         for (DSGraph::ReturnNodesTy::iterator I = G.getReturnNodes().begin(),
                E = G.getReturnNodes().end(); I != E; ++I)
@@ -278,16 +285,12 @@
       // Get the data structure graph for the called function.
       //
       DSGraph &GI = getDSGraph(*Callee);  // Graph to inline
-      
-      if (Callee->getName() == "bc_raise")
-        std::cerr << "HERE!\n";
 
       DEBUG(std::cerr << "    Inlining graph for " << Callee->getName()
             << "[" << GI.getGraphSize() << "+"
             << GI.getAuxFunctionCalls().size() << "] into '"
             << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() << "+"
             << Graph.getAuxFunctionCalls().size() << "]\n");
-      
       Graph.mergeInGraph(CS, *Callee, GI,
                          DSGraph::KeepModRefBits | 
                          DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes);





More information about the llvm-commits mailing list