[llvm-commits] [poolalloc] r124665 - in /poolalloc/trunk/lib/DSA: DataStructureStats.cpp Steensgaard.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Tue Feb 1 09:41:46 PST 2011


Author: aggarwa4
Date: Tue Feb  1 11:41:46 2011
New Revision: 124665

URL: http://llvm.org/viewvc/llvm-project?rev=124665&view=rev
Log:
Steensgaard: Just some cleanup. This code is not maintained.
DataStructureStats: Cleanup. Make sure we count the nodes
correctly and only in one category.

Modified:
    poolalloc/trunk/lib/DSA/DataStructureStats.cpp
    poolalloc/trunk/lib/DSA/Steensgaard.cpp

Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=124665&r1=124664&r2=124665&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Tue Feb  1 11:41:46 2011
@@ -27,7 +27,6 @@
 namespace {
   STATISTIC (TotalNumCallees, "Total number of callee functions at all indirect call sites");
   STATISTIC (NumIndirectCalls, "Total number of indirect call sites in the program");
-  //  STATISTIC (NumPoolNodes, "Number of allocation nodes that could be pool allocated");
 
   // Typed/Untyped memory accesses: If DSA can infer that the types the loads
   // and stores are accessing are correct (ie, the node has not been collapsed),
@@ -102,6 +101,7 @@
 
 
 void DSGraphStats::countCallees(const Function& F) {
+  //FIXME:Use callgraph
   unsigned numIndirectCalls = 0, totalNumCallees = 0;
 
   for (DSGraph::fc_iterator I = TDGraph->fc_begin(), E = TDGraph->fc_end();
@@ -155,16 +155,17 @@
     DSNode* N = NH.getNode();
     if (N->isNodeCompletelyFolded())
       return true;
-    if ( N->isIncompleteNode()){
-      ++NumIncompleteAccesses;
-      return true;
-    }
     if ( N->isExternalNode()){
       ++NumExternalAccesses;
       return true;
     }
+    if ( N->isIncompleteNode()){
+      ++NumIncompleteAccesses;
+      return true;
+    }
     if (N->isUnknownNode()){
       ++NumUnknownAccesses;
+      return true;
     }
     // it is a complete node, now check how many types are present
    int count = 0;

Modified: poolalloc/trunk/lib/DSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Steensgaard.cpp?rev=124665&r1=124664&r2=124665&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/DSA/Steensgaard.cpp Tue Feb  1 11:41:46 2011
@@ -28,7 +28,8 @@
 
 void
 SteensgaardDataStructures::releaseMemory() {
-  delete ResultGraph; ResultGraph = 0;
+  delete ResultGraph; 
+  ResultGraph = 0;
   DataStructures::releaseMemory();
 }
 
@@ -73,8 +74,8 @@
   }
 
   ResultGraph->removeTriviallyDeadNodes();
-
-  // FIXME: Must recalculate and use the Incomplete markers!!
+  ResultGraph->maskIncompleteMarkers();
+  ResultGraph->markIncompleteNodes(DSGraph::MarkFormalArgs | DSGraph::IgnoreGlobals);
 
   // Now that we have all of the graphs inlined, we can go about eliminating
   // call nodes...
@@ -125,7 +126,6 @@
   // Update the "incomplete" markers on the nodes, ignoring unknownness due to
   // incoming arguments...
   ResultGraph->maskIncompleteMarkers();
-
   ResultGraph->markIncompleteNodes(DSGraph::MarkFormalArgs | DSGraph::IgnoreGlobals);
 
   // Remove any nodes that are dead after all of the merging we have done...
@@ -141,16 +141,10 @@
   formGlobalECs();
 
   // Clone the global nodes into this graph.
-  ReachabilityCloner RC(ResultGraph, GlobalsGraph,
-      DSGraph::DontCloneCallNodes |
-      DSGraph::DontCloneAuxCallNodes);
-  for (DSScalarMap::global_iterator I = GlobalsGraph->getScalarMap().global_begin(),
-      E = GlobalsGraph->getScalarMap().global_end(); I != E; ++I)
-    if (isa<GlobalVariable>(*I))
-      RC.getClonedNH(GlobalsGraph->getNodeForValue(*I));
-   
+  cloneGlobalsInto(ResultGraph, DSGraph::DontCloneCallNodes |
+                              DSGraph::DontCloneAuxCallNodes);
 
-  print(errs(), &M);
+  DEBUG(print(errs(), &M));
   return false;
 }
 





More information about the llvm-commits mailing list