[LLVMdev] how to choose which alias analysis used in my pass?

Roel Jordans r.jordans at tue.nl
Thu Oct 16 02:46:42 PDT 2014


Yes, next to loading the pass you'll also have to add your pass to the 
list of passes to run.

For the hello example it is something like:

opt -load hello.so -hello input.bc

The option name is the first argument to the RegisterPass line IIRC.

Cheers,
  Roel

On 16/10/14 02:18, songlh wrote:
>
> I run the following command: opt -load MyPass.so -basicaa  -MyPass
> ./test.bc -debug-pass=Structure -disable-output
>
> Then I got:
>
> Pass Arguments:  -targetlibinfo -datalayout -notti -basictti -x86tti
> -no-aa -basicaa -Redundancy -preverify -domtree -verify
> Target Library Information
> Data Layout
> No target information
> Target independent code generator's TTI
> X86 Target Transform Info
> No Alias Analysis (always returns 'may' alias)
> Basic Alias Analysis (stateless AA impl)
>    ModulePass Manager
>      Redundancy Checking
>        Unnamed pass: implement Pass::getPassName()
>      FunctionPass Manager
>        Preliminary module verification
>        Dominator Tree Construction
>        Module Verifier
> Pass Arguments:  -no-aa -domtree -postdomtree -loops -memdep
> No Alias Analysis (always returns 'may' alias)
>    FunctionPass Manager
>      Dominator Tree Construction
>      Post-Dominator Tree Construction
>      Natural Loop Information
>      Memory Dependence Analysis
>
> It looks to me that when loading MyPass, basicaa is not used. Do I make
> some mistakes in the opt parameters?
>
> Thanks a lot!
>
> Best,
>
> Linhai
>
>
> On 2014-10-15 14:56, Hal Finkel wrote:
>> ----- Original Message -----
>>> From: "Jingyue Wu" <jingyue at google.com>
>>> To: "songlh" <songlh at cs.wisc.edu>, llvmdev at cs.uiuc.edu
>>> Sent: Wednesday, October 15, 2014 2:50:12 PM
>>> Subject: Re: [LLVMdev] how to choose which alias analysis used in my
>>> pass?
>>>
>>>
>>> Isn't -basicaa the default alias analysis already?
>>
>> No, -basicaa is added (along with several others) when -O3 (or
>> similar) is provided, but you'll only get -noaa if you run opt without
>> specifying anything else.
>>
>>  -Hal
>>
>>>
>>> Jingyue
>>>
>>>
>>> On Wed Oct 15 2014 at 6:42:59 AM songlh < songlh at cs.wisc.edu > wrote:
>>>
>>>
>>> Hi,
>>>
>>> I want to use memory dependence analysis in my pass, but I feel the
>>> default alias analysis is not precise enough. How could I choose to
>>> use
>>> another alias analysis algorithm? I have tried opt -load mypass.so
>>> -basicaa xx.bc > /dev/null. But I feel the alias analysis algorithm
>>> does
>>> not change. Do I need to add something in my codes?
>>>
>>> Thanks a lot!
>>>
>>> Best,
>>>
>>> Linhai
>>> ______________________________ _________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list