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

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 2 18:35:12 PST 2005



Changes in directory llvm-poolalloc/lib/PoolAllocate:

PointerCompress.cpp updated: 1.37 -> 1.38
---
Log message:

Pointer compression can reduce the alignment requirement of a pool.  Note this.


---
Diffs of the changes:  (+5 -1)

 PointerCompress.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.37 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.38
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.37	Wed Mar  2 10:21:41 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp	Wed Mar  2 20:34:57 2005
@@ -805,7 +805,11 @@
   Ops.push_back(CI.getOperand(1));
   // Transform to pass in the compressed size.
   Ops.push_back(ConstantUInt::get(Type::UIntTy, PI->getNewSize()));
-  Ops.push_back(CI.getOperand(3));
+
+  // Pointer compression can reduce the alignment restriction to 4 bytes from 8.
+  // Reevaluate the desired alignment.
+  Ops.push_back(ConstantUInt::get(Type::UIntTy,
+             PA::Heuristic::getRecommendedAlignment(PI->getNewType(), TD)));
   // TODO: Compression could reduce the alignment restriction for the pool!
   Value *PB = new CallInst(PtrComp.PoolInitPC, Ops, "", &CI);
 






More information about the llvm-commits mailing list