[llvm-dev] Building and Invoking DSA or Pool Alloc

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 27 06:17:23 PDT 2016


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 
(https://github.com/jtcriswell/llvm-dsa).

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 libAssistDS.so and 
libLLVMDataStructure.so:

opt -load AssistDS.so -load LLVMDataStructucture.so -load poolalloc.so ...

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.

Regards,

John Criswell

On 4/27/16 2:06 AM, Mani, Suresh via llvm-dev wrote:
>
> 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 http://llvm.org/svn/llvm-project/llvm/branches/release_32 llvm
>
> cd llvm/projects
>
> svn co http://llvm.org/svn/llvm-project/poolalloc/branches/release_32 
> poolalloc
>
> 2)Was able to build the binaries and libraries
>
>             ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib
>
> -rw-rw-r-- 1 sumani sumani  987956 Apr 15 15:56 AssistDS.a
>
> -rwxrwxr-x 1 sumani sumani  508376 Apr 15 15:56 AssistDS.so
>
> -rw-rw-r-- 1 sumani sumani    2648 Apr 15 15:56 libcount.a
>
> -rwxrwxr-x 1 sumani sumani    8539 Apr 15 15:56 libcount.so
>
> -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 libpoolalloc_rt.so
>
> -rw-rw-r-- 1 sumani sumani 1656724 Apr 15 15:56 LLVMDataStructure.a
>
> -rwxrwxr-x 1 sumani sumani  809363 Apr 15 15:56 LLVMDataStructure.so
>
> -rw-rw-r-- 1 sumani sumani 1255556 Apr 15 15:56 poolalloc.a
>
> -rwxrwxr-x 1 sumani sumani  609417 Apr 15 15:56 poolalloc.so
>
> -rwxrwxr-x 1 sumani sumani   23861 Apr 15 15:56 typechecks_rt.so
>
> ../rel_32/build_rel/Release+Asserts/bin          // Contains the llvm 
> binaries
>
> ../rel_32/build_rel/Release+Asserts/lib           // Contains the llvm 
> libraries
>
> 3)Invoking opt as follows,
>
> ../rel_32/build_rel/Release+Asserts/bin/opt -load 
> ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so --help
>
>                   Error opening 
> ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so: 
> ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so: 
> *undefined symbol: _ZN4llvm21EquivBUDataStructures2IDE*
>
>                  -load request ignored.
>
>                   OVERVIEW: llvm .bc -> .bc modular optimizer and 
> analysis printer
>
>                   USAGE: opt [options] <input bitcode file>
>
>                   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.
>
> Thanks
>
> M Suresh
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160427/9b2f0f4f/attachment.html>


More information about the llvm-dev mailing list