[LLVMdev] Running Pool Allocated programs

Chris Lattner sabre at nondot.org
Sat Apr 2 10:25:26 PST 2005

On Sat, 2 Apr 2005, Ricardo wrote:
> Hello,
> I am trying to run a program optimized with the Pool Allocation, but I am receiving this error:
> ====================
> MaxHeapSize = 0.062500KB  HeapSizeAtExit = 0.062500KB   NOTE: only valid if using
> Heuristic=AllPools and no bumpptr/realloc!
> ====================

This output is what happens when you link with the debug version of the 
runtime library.  If you rebuild the FL2Allocator with 'make 
ENABLE_OPTIMIZED=1' and link with the result, you shouldn't get this.

> I have tried to link the program with the Analysis and with Datastructure libs:
> llvm-gcc -o test test.opt.bc -lpoolalloc -lpoolalloc_rt -lLLVMDataStructure -lLLVMAnalysis
> But I am still receiving the error.

You should only need -lpoolalloc_rt.

For the record, I usually do (effectively) this to test the pool 

llvm-gcc *.c -o program         # compile&link whole prog with LLVM
opt -load ... -poolalloc program.bc ... -o program.pa.bc
llc program.pa.bc -march=c -o program.pa.cbe.c
gcc -fno-strict-aliasing -O2 program.pa.cbe.c -o program.pa -L~/llvm/projects/llvm-poolalloc/Release/lib/ -lpoolalloc_rt

Alternatively, if you want a quick test, you can do the first two steps, 

   lli -load ~/llvm/projects/llvm-poolalloc/Release/lib/libpoolalloc_rt.so program.pa.bc

If you're on a target that supports the JIT.

> Another question, I do not want to use the bump ptr optimization, and I suppose that the right
> heuristic for that is AllNodes? But if I want to use it, what is the right heuristic?

The AllNodes heuristic is the only one that is substantially tested.  I 
would recommend it, none of the others have any significant performance 
benefit anyway.

The bump pointer and other opts are a seperate option -pooloptimize, which 
can be run after -poolalloc.  It does not work with -pointercompress 

> Also, if I want to use the Pointer Compression, I suppose that I have to 
> use the -pointercompress switch with opt or what?

Yes, if you use it, don't specify -poolalloc manually.



More information about the llvm-dev mailing list