[llvm-commits] [llvm] r47317 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

Chris Lattner clattner at apple.com
Mon Feb 18 22:49:17 PST 2008


On Feb 18, 2008, at 10:47 PM, Owen Anderson wrote:

> Author: resistor
> Date: Tue Feb 19 00:47:18 2008
> New Revision: 47317
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47317&view=rev
> Log:
> In addition to arguments passed to it, memcpy (and all other calls)  
> can ModRef pointers that alias their arguments as well.  This fixes  
> PR2057.

Do you need the call to getUnderlyingObject at all then?  Isn't the  
call to 'alias' sufficient?

-chris

>
>
> Modified:
>    llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
>
> Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=47317&r1=47316&r2=47317&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
> +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Feb 19  
> 00:47:18 2008
> @@ -263,7 +263,8 @@
>           for (CallSite::arg_iterator CI = CS.arg_begin(), CE =  
> CS.arg_end();
>               CI != CE; ++CI)
>             if (isa<PointerType>((*CI)->getType()) &&
> -                getUnderlyingObject(*CI) == P)
> +                ( getUnderlyingObject(*CI) == P ||
> +                  alias(cast<Value>(CI), ~0ULL, P, ~0ULL) !=  
> NoAlias) )
>               passedAsArg = true;
>
>           if (!passedAsArg)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list