[LLVMdev] Question about using steensgaard's pointer analysis in poolalloc

John Criswell criswell at uiuc.edu
Tue Mar 23 06:59:03 PDT 2010


聪明陈 wrote:
> Hi LLVM dev team:
> I am now doing an experiment to comparing Steensgaard-style and
> Andersen-style pointer analysis on LLVM. Since steensgaard pointer
> analysis is in module "poolalloc", so I installed poolalloc release
> 2.6 on my machine(intel X86_64 RedHatEnterpriseLinux 5.1, gcc-4.2.4),
> two directories "include" and "lib" were created after installation
> but no binary files generated.

Generally, we don't use the files created by a "make install." Instead,
we generally just compile the code and use the files directly out of the
Release/bin (or Debug/bin) directories of the LLVM object tree.

> I loaded poolalloc module into opt program according to the poolalloc
> "README" file:
> /opt -load <path to pool allocator> -poolalloc <other opt options>/
> Here's my command:
> *opt -load=/home/cmchen/INSTALL/llvm-common/lib/libpoolalloc_rt.so
> -poolalloc -analyze -print-alias-sets test.bc*
> and here's the error message:
> *opt: Unknown command line argument '-poolalloc' Try: 'opt --help' *
> So, my questions are:
> 1 Did I install the poolalloc module in a wrong way? or I just did not
> completely installed the module?
> 2 How should I load the module correctly? I just use the path of
> poolalloc shared object file to be the <path to pool allocator>, cause
> no binary file has been generated.
> Could you give me some suggestion? Thank you.

There are two problems:

1) You need to load the library containing DSA first. To do that, you
need to use the -load <path>/libLLVMDataStructure.so option.

2) I believe you are loading the wrong library. You want to load
libpoolalloc.so and not libpoolalloc_rt.so. The former is the LLVM
poolalloc transform pass; the latter is the run-time library
implementing the poolallocation functions.

If you're only interested in DSA (for points-to and alias analysis),
then you don't need poolalloc. Just use:

opt -load <path>/libLLVMDataStructure.so <dsa passes you want to run>

If you want to run poolalloc, then you do the following:

opt -load <path>/libLLVMDataStructure.so -load <path>/libpoolalloc.so
-poolalloc input.bc -f -o output.bc

A couple of warnings about the alias analysis passes in DSA:

1) I believe all the alias analysis implementations are based on DSA.
DSA is a unification-based algorithm, so I think you might see
unification even in non-unification algorithms like Andersons. Andrew,
does this sound correct?

2) I have not used the alias analysis passes in DSA, so I don't know how
well they work.

-- John T.




More information about the llvm-dev mailing list