[PATCH] D86815: [LangRef] Remove non-overlapping guarantee from memcpy.

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 03:26:16 PDT 2020


nlopes added a comment.

In D86815#2245481 <https://reviews.llvm.org/D86815#2245481>, @rsmith wrote:

> In D86815#2245467 <https://reviews.llvm.org/D86815#2245467>, @arsenm wrote:
>
>> In D86815#2245466 <https://reviews.llvm.org/D86815#2245466>, @arsenm wrote:
>>
>>> Why would we change this? What's the point of having separate memcpy and memmove intrinsics?
>>
>> I'm reading this as clang mis-uses llvm.memcpy when it probably should be using llvm.memmove
>
> There is a longstanding assumption made by ~every compiler that `memcpy(p, p, n)` is safe. That's what we should be encoding here. We should not be removing all overlap restrictions.

If clang doesn't have a document stating the assumptions made about the run-time libraries (couldn't quickly find it), it might be useful to have one and mention this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86815/new/

https://reviews.llvm.org/D86815



More information about the llvm-commits mailing list