<div dir="ltr">Also - I tried both -fno-builtin and <span style="font-size:12.8px"> -ffreestanding and code with memcpy was still produced.</span><div><span style="font-size:12.8px"><br></span></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Kind Regards,<div><br>Wolf</div></div></div></div>
<br><div class="gmail_quote">On Sat, Oct 15, 2016 at 6:17 PM, Joerg Sonnenberger via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Oct 15, 2016 at 04:12:15PM -0700, Flamedoge wrote:<br>
> Even with -ffreestanding LLVM generates memcpy/memset? Does this mean some<br>
> passes do not honor this flag? If you really wanted to prevent libcalls,<br>
> you could technically translate those memcpy/memset to loops in lowering.<br>
> Kevin<br>
<br>
</span>Yes, LLVM follows the same rules as GCC here:<br>
<br>
GCC requires the freestanding environment provide `memcpy', `memmove',<br>
`memset' and `memcmp'.<br>
<br>
As I said, target lowering may decide to inline all the llvm.mem*<br>
intrinsics, but it is typically wasteful to do so. Exceptions are e.g.<br>
on x86 when optimising for size, since the function call overhead is<br>
large than the "rep stosb" sequence would be for memset or "rep movsb"<br>
or memcpy.<br>
<div class="HOEnZb"><div class="h5"><br>
Joerg<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>