[llvm-commits] [llvm] r84175 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Chris Lattner
clattner at apple.com
Sat Oct 17 20:46:45 PDT 2009
On Oct 17, 2009, at 5:44 PM, Nick Lewycky wrote:
> Chris Lattner wrote:
>> On Oct 15, 2009, at 12:11 AM, Nick Lewycky wrote:
>>> Author: nicholas
>>> Date: Thu Oct 15 02:11:24 2009
>>> New Revision: 84175
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=84175&view=rev
>>> Log:
>>> Teach basicaa about memcpy/memmove/memset. The length argument can
>>> be used to
>>> improve alias results if constant, and the source pointer can't be
>>> modified.
>> Hi Nick,
>> Please write some testcases that fail without this and pass with it.
>
> Added in r84385.
>
> I'm pretty sure that this is already
>> handled by logic in AliasAnalysis that knows that memset only looks
>> at its arguments:
>
> No, that isn't enough. memmove/memcpy have an argument that they
> never write to. The existing logic returns ModRef against that
> pointer, while we know we can return Ref.
>
> Similarly, when alias() isn't given the size, it has to assume that
> the possible writer will write over the whole thing, and any two
> pointers which are computed as offset from the same base are
> potentially aliasing. By pulling the size out of memmove/memcpy/
> memset, we can return NoModRef in cases where the fallback code
> could not.
Ok, thanks!
More information about the llvm-commits
mailing list