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

Chris Lattner lattner at cs.uiuc.edu
Fri Nov 14 19:20:01 PST 2003


Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.53 -> 1.54

---
Log message:

count the number of typesafe pools


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

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.53 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.54
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.53	Fri Nov 14 12:50:08 2003
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Fri Nov 14 19:19:27 2003
@@ -35,6 +35,7 @@
   Statistic<> NumArgsAdded("poolalloc", "Number of function arguments added");
   Statistic<> NumCloned   ("poolalloc", "Number of functions cloned");
   Statistic<> NumPools    ("poolalloc", "Number of pools allocated");
+  Statistic<> NumTSPools  ("poolalloc", "Number of typesafe pools");
   Statistic<> NumPoolFree ("poolalloc", "Number of poolfree's elided");
 
   const Type *VoidPtrTy;
@@ -401,6 +402,10 @@
       ConstantUInt::get(Type::UIntTy, (*I)->getType()->isSized() ? 
                         TD.getTypeSize((*I)->getType()) : 4);
     new CallInst(PoolInit, make_vector((Value*)GV, ElSize, 0), "", InsertPt);
+
+    ++NumPools;
+    if (!(*I)->isNodeCompletelyFolded())
+      ++NumTSPools;
   }
 
   return false;
@@ -534,6 +539,8 @@
     if (Node->getType() == Type::VoidTy)
       std::cerr << "Node collapsing in '" << F.getName() << "'\n";
     ++NumPools;
+    if (!Node->isNodeCompletelyFolded())
+      ++NumTSPools;
       
     // Update the PoolDescriptors map
     PoolDescriptors.insert(std::make_pair(Node, AI));





More information about the llvm-commits mailing list