[llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Feb 20 18:30:03 PST 2004


Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.58 -> 1.59

---
Log message:

Always print information about pool allocation.  Also, isntead of scanning over
all entries in the scalar map looking for globals, just look for globals directly!


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

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.58 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.59
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.58	Sun Feb  8 22:14:20 2004
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Fri Feb 20 18:28:58 2004
@@ -557,21 +557,19 @@
   FuncInfo &FI = FunctionInfo[&F];   // Get FuncInfo for F
   hash_set<DSNode*> &MarkedNodes = FI.MarkedNodes;
   
-  DEBUG(std::cerr << "[" << F.getName() << "] Pool Allocate: ");
-
   // Calculate which DSNodes are reachable from globals.  If a node is reachable
   // from a global, we will create a global pool for it, so no argument passage
   // is required.
   DSGraph &GG = BU->getGlobalsGraph();
   DSGraph::NodeMapTy GlobalsGraphNodeMapping;
-  for (DSGraph::ScalarMapTy::iterator I = G.getScalarMap().begin(), 
-         E = G.getScalarMap().end(); I != E; ++I)
-    if (GlobalValue *GV = dyn_cast<GlobalValue>(I->first)) {
-      // Map all node reachable from this global to the corresponding nodes in
-      // the globals graph.
-      DSGraph::computeNodeMapping(I->second.getNode(), GG.getNodeForValue(GV),
-                                  GlobalsGraphNodeMapping);
-    }
+  for (DSScalarMap::global_iterator I = G.getScalarMap().global_begin(),
+         E = G.getScalarMap().global_end(); I != E; ++I) {
+    // Map all node reachable from this global to the corresponding nodes in
+    // the globals graph.
+    DSGraph::computeNodeMapping(G.getNodeForValue(*I).getNode(),
+                                GG.getNodeForValue(*I),
+                                GlobalsGraphNodeMapping);
+  }
   
   // Loop over all of the nodes which are non-escaping, adding pool-allocatable
   // ones to the NodesToPA vector.
@@ -590,7 +588,8 @@
         NodesToPA.push_back(*I);
       }
   
-  DEBUG(std::cerr << NodesToPA.size() << " nodes to pool allocate\n");
+  std::cerr << "[" << F.getName() << "] Pool Allocating "
+            << NodesToPA.size() << " nodes\n";
   if (!NodesToPA.empty())    // Insert pool alloca's
     CreatePools(NewF, NodesToPA, FI.PoolDescriptors);
   





More information about the llvm-commits mailing list