Hal Finkel
2014-Oct-15 19:56 UTC
[LLVMdev] how to choose which alias analysis used in my pass?
----- 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 >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
songlh
2014-Oct-16 01:18 UTC
[LLVMdev] how to choose which alias analysis used in my pass?
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 >>
Roel Jordans
2014-Oct-16 09:46 UTC
[LLVMdev] how to choose which alias analysis used in my pass?
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