| Issue |
56467
|
| Summary |
hand written memcpy replaced with builtin memcpy
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
nickitat
|
we have code like this:
``` cpp
void __attribute__((noinline, no_builtin("memcpy"))) my_memcpy(char * __restrict dst, const char * __restrict src, ssize_t n)
{
while (n > 0)
{
_mm_storeu_si128(reinterpret_cast<__m128i *>(dst),
_mm_loadu_si128(reinterpret_cast<const __m128i *>(src)));
dst += 16;
src += 16;
n -= 16;
}
}
int main()
{
char src[1024] = "wefjwoefjowfopwfokwpeofkpowf";
char dst[sizeof(src) + 15]; // we always have 15 bytes padding in dst to be able to use memcpy without branches
my_memcpy(dst, src, 1024);
return 0;
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs