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

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 10 15:41:14 PST 2004



Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.92 -> 1.93

---
Log message:

These optimizations have been moved to the pooloptimize pass.


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

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.92 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.93
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.92	Wed Nov 10 16:06:05 2004
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Wed Nov 10 17:41:04 2004
@@ -135,8 +135,11 @@
 // AddPoolPrototypes - Add prototypes for the pool functions to the specified
 // module and update the Pool* instance variables to point to them.
 //
+// NOTE: If these are changed, make sure to update PoolOptimize.cpp as well!
+//
 void PoolAllocate::AddPoolPrototypes() {
   if (VoidPtrTy == 0) {
+    // NOTE: If these are changed, make sure to update PoolOptimize.cpp as well!
     VoidPtrTy = PointerType::get(Type::SByteTy);
     PoolDescType = ArrayType::get(VoidPtrTy, 16);
     PoolDescPtrTy = PointerType::get(PoolDescType);
@@ -207,20 +210,10 @@
     // poolalloc never returns null.  Loop over all uses of the call looking for
     // set(eq|ne) X, null.
     OptimizePointerNotNull(CI);
-
-    // poolalloc(null, X) -> malloc(X)
-    if (isa<Constant>(CI->getOperand(0)) && 
-        cast<Constant>(CI->getOperand(0))->isNullValue())
-      std::cerr << "Could turn into malloc: " << *CI;
   }
 
   // TODO: poolfree accepts a null pointer, so remove any check above it, like
   // 'if (P) poolfree(P)'
-
-  // poolfree(null) -> noop
-
-  // poolrealloc(null, X) -> malloc(X)
-
 }
 
 





More information about the llvm-commits mailing list