How to transfer AliasAnalysis result from a module pass to a function pass?

Hi all,

I am Shen, a new LLVM learner. Now i am trying to call basic alias analysis in my own module pass, i hope to use -basicaa to check whether two pointers are aliases in the inner function passes.

After I run the command opt -load ./pdg.so -basicaa -dot-pdg -debug-pass=Structure < $1 > /dev/null

the compiler reports as follows:

Pass Arguments: -targetlibinfo -datalayout -notti -basictti -x86tti -no-aa -basicaa -pdg -dot-pdg -verify -verify-di
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
Program Dependency Graph
Unnamed pass: implement Pass::getPassName()
FunctionPass Manager
Print instruction-level program dependency graph of function to ‘dot’ file
Module Verifier
Debug Info Verifier
Bitcode Writer
Pass Arguments: -no-aa -fda
No Alias Analysis (always returns ‘may’ alias)
FunctionPass Manager
Flow Dependence Analysis

If all passes are Function pass, -basicaa can be executed very well. But when I call -basicaa through a Module pass. It seems the basic AA was called during the runtime. However, the inner function pass didn’t see -basicaa option but use default -no-aa instead.

So is there a good way to let my inner Function pass get the result from outer Module pass?

Best regards,

Shen