<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>On Dec 3, 2014, at 6:12 AM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><br><br><div class="gmail_quote">On Tue Dec 02 2014 at 12:12:01 PM Robert Lougher <<a href="mailto:rob.lougher@gmail.com">rob.lougher@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2 December 2014 at 19:57, Joerg Sonnenberger <<a href="mailto:joerg@britannica.bec.de" target="_blank">joerg@britannica.bec.de</a>> wrote:<br>
> On Tue, Dec 02, 2014 at 07:23:01PM +0000, Robert Lougher wrote:<br>
>> In feedback from game studios a common issue is the replacement of<br>
>> loops with calls to memcpy/memset.  These loops are often<br>
>> hand-optimised, and highly-efficient and the developers strongly want<br>
>> a way to control the compiler (i.e. leave my loop alone).<br>
><br>
> I doubt that. If anything, it means the lowering of the intrinsic is<br>
> bad, not that the transformation should not happen.<br>
><br>
> Joerg<br>
<br>
Yes, that's why I talked about variable and constant trip-counts.  For<br>
constant loops there generally isn't a problem, as they can be lowered<br>
inline (if small).  Variable loops, however, get expanded into a<br>
library call.<br>
<br></blockquote><div><br></div><div>So the biggest problem is that you don't want a call and would prefer to have inline memcpy code everywhere or something else? If the memcpy isn't being lowered efficiently I'm curious as to what isn't being lowered well.</div></div></div></blockquote><div><br></div><div>Our C library amplifies this problem by being in a dynamic library, so the call has additional overhead, which for small trip counts swamps the copy/set.</div><div><br></div><div>Certainly, the lowering can be better across the many cases as discussed elsewhere in this thread.</div><div><br></div><div>Game developers expect precise control and are surprised by this canonicalization. They also don't have the compiler's frame of reference as a basis for understanding issues like this.</div><div><br></div><div>Alex</div><br><blockquote type="cite"><div><div class="gmail_quote"><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Rob.<br>
<br>
> ______________________________<u></u>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>LLVM Developers mailing list</span><br><span><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a></span><br><span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></span><br></div></blockquote></body></html>