[LLVMdev] "Best" alias analysis algorithm

Vladimir Prus ghost at cs.msu.su
Mon Apr 25 06:35:13 PDT 2005


On Monday 25 April 2005 16:09, Vladimir Prus wrote:

> The GlobalsModRef::getModRefInfo has this logic:
>
>     // If we are asking for mod/ref info of a direct call with a pointer to
> a // global we are tracking, return information if we have it.
>     if (GlobalValue *GV = const_cast<GlobalValue*>(getUnderlyingObject(P)))
>        if (GV->hasInternalLinkage())
>
> So, no information is produced for external variables, the function calls
> Aliasanalysis::getModRefInfo, which sees that called function may write to
> memory, and returns true for all global variables.

Ok, I've just modified all variables to have internal linkage. OTOH,  in my 
test case it's definitely clear that no external functions are called and so 
the global variables, even though they have external linkage, cannot be 
modified by any outside code.

- Volodya




More information about the llvm-dev mailing list