[PATCH] D21920: Fix for Bug 26903 adds support to inline __builtin_mempcpy

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 12:48:31 PDT 2016


kparzysz added a comment.

In http://reviews.llvm.org/D21920#472564, @Sunita_Marathe wrote:

> My thinking had been that substituting memcpy for mempcpy would not negatively affect the user.


The only reason why someone may want to stay with a call to mempcpy is that it could be a tail call.  Otherwise, there shouldn't be any difference.  Also, a potential benefit of using memcpy+add is that in case when the return value is not used, the add would be eliminated as an explicitly dead code.

It's probably reasonable to always do the expansion, especially given that many targets can expand memcpy as well. I'm still not sure why not have that replacement done in clang when generating code for mempcpy. Is there a reason for that?


http://reviews.llvm.org/D21920





More information about the llvm-commits mailing list