Building and Invoking DSA or Pool Alloc

Hi ,

This Is ‘Suresh M’ from AMD compiler team.

  1. I obtained the source code of llvm and pool-alloc (relase_32 versions ) using the following commands,

svn co llvm

cd llvm/projects

svn co poolalloc

  1. Was able to build the binaries and libraries


-rw-rw-r-- 1 sumani sumani 987956 Apr 15 15:56 AssistDS.a

-rwxrwxr-x 1 sumani sumani 508376 Apr 15 15:56

-rw-rw-r-- 1 sumani sumani 2648 Apr 15 15:56 libcount.a

-rwxrwxr-x 1 sumani sumani 8539 Apr 15 15:56

-rw-rw-r-- 1 sumani sumani 6514 Apr 15 15:56 libpa_pre_rt.a

-rw-rw-r-- 1 sumani sumani 13526 Apr 15 15:56 libpoolalloc_fl_rt.a

-rw-rw-r-- 1 sumani sumani 26048 Apr 15 15:56 libpoolalloc_rt.a

-rwxrwxr-x 1 sumani sumani 28731 Apr 15 15:56

-rw-rw-r-- 1 sumani sumani 1656724 Apr 15 15:56 LLVMDataStructure.a

-rwxrwxr-x 1 sumani sumani 809363 Apr 15 15:56

-rw-rw-r-- 1 sumani sumani 1255556 Apr 15 15:56 poolalloc.a

-rwxrwxr-x 1 sumani sumani 609417 Apr 15 15:56

-rwxrwxr-x 1 sumani sumani 23861 Apr 15 15:56

…/rel_32/build_rel/Release+Asserts/bin // Contains the llvm binaries

…/rel_32/build_rel/Release+Asserts/lib // Contains the llvm libraries

  1. Invoking opt as follows,

…/rel_32/build_rel/Release+Asserts/bin/opt -load …/rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/ --help

Error opening …/rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/ …/rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/ undefined symbol: _ZN4llvm21EquivBUDataStructures2IDE

-load request ignored.

OVERVIEW: llvm .bc → .bc modular optimizer and analysis printer

USAGE: opt [options]


-O1 - Optimization level 1. Similar to clang -O1

-O2 - Optimization level 2. Similar to clang -O2

-O3 - Optimization level 3. Similar to clang -O3



Can anyone please do let me know how this could be resolved.


M Suresh

Dear Suresh,

First, may I ask why you're using automatic pool allocation (APA)? The APA transforms have probably suffered significant bitrot; I haven't used them much in recent years. APA's current algorithms for deciding when and where to make pools are a bit complicated. Depending on your needs, it may make more sense to morph the current APA code into something that is simpler and easier to maintain (e.g., a transform that creates global, context-insensitive pools) than to use it for doing context-sensitive pool allocation (which requires changing function signatures which becomes tricky when the program uses external libraries).

We've used DSA recently (Fall 2014), so it's in much better shape. We even have a version of it ported to LLVM 3.7 (

Second, to answer your question, the reason why you're seeing this error is because you haven't loaded the DSA libraries into opt. You need to include additional -load options to opt to load DSA. I believe the libraries you need to load (in order) are and

opt -load -load -load ...

An alternative to running opt is to build a simple tool which links in these libraries and runs the needed passes over the bitcode file (essentially, writing a specialized opt tool just for running these passes). The pa programs (poolalloc/tools/Pa) is an outdated example of such a tool.


John Criswell

Hi Criswell,

Thanks a lot for the immediate and detailed response on this.

Sure I will try using the ported version and check.


M Suresh

To be clear, the DSA code has been ported to LLVM 3.7. The Poolalloc APA transform has not. Also, if you’re using DSA, you will probably get more accurate results if you analyze unoptimized code. LLVM’s optimizations now do some really funky things to the IR that make it more difficult for DSA to do its type-inference. With less precise type inference, DSA provides less precise points-to analysis results (the type-inference gives DSA its field sensitivity feature). I think DSA can be fixed to deal with those issues, and there are multiple ways to fix it. However, no one’s stepped up to the plate to do it yet. Regards, John Criswell