[LLVMdev] Tracking global variables accesses

Vladimir Prus ghost at cs.msu.su
Wed Apr 20 06:46:29 PDT 2005

On Wednesday 20 April 2005 17:41, Chris Lattner wrote:
> On Wed, 20 Apr 2005, Vladimir Prus wrote:
> > Is there any analysis in LLVM that can be used to obtain, for a function,
> > the list of all global variables that may be modified as a result of a
> > call to that function (taking into account any calls in those function
> > and aliasing). If not, what's the best way to implement such a analysis?
> No, not directly.  However, with the standard alias analysis interface,
> you can query a particular function call to see if it will modify a
> particular global (to get a list of all globals potentially modified, just
> iterate through the globals).  If your pass uses the standard alias
> analysis interface, this will allow it to work with many different aa
> implementations.

So, I can just call AliasAnalysis::getModRefInfo with a call instruction and 
global value as argument? Excellent. 

> The other option is to hack the globals mod/ref alias analysis in
> Analysis/IPA to do what you want.

Will that have any advantage over calling getModRefInfo for each global 

- Volodya

More information about the llvm-dev mailing list