<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you're using just LLVM, you can simply not run optimizations like LoopIdiomRecognizer that synthesize these operations. <div><br></div><div>Assuming you mean clang+LLVM, you can use -ffreestanding to achieve most of what you want, but note that LLVM matches GCC in that it <i>requires</i> certain functions to have expansions available for linking.  If that's not workable for your target, you'll need to modify clang itself to omit those optimizations.<div><br></div><div>From <a href="http://gcc.gnu.org/onlinedocs/gcc/Standards.html">http://gcc.gnu.org/onlinedocs/gcc/Standards.html</a></div><div><br></div><div><blockquote type="cite"><span style="font-family: Times; ">GCC requires the freestanding environment provide </span><code>memcpy</code><span style="font-family: Times; ">, </span><code>memmove</code><span style="font-family: Times; ">, </span><code>memset</code><span style="font-family: Times; "> and </span><code>memcmp</code><span style="font-family: Times; ">.</span></blockquote><div><br></div>--Owen<br><div><br><div><div>On Jul 30, 2013, at 10:55 AM, Bin Tzeng <<a href="mailto:bintzeng@gmail.com">bintzeng@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi all,<div><br></div><div>LLVM is smart that it can synthesize llvm.memset, llvm.memcpy etc. from loops, which can be lowered into calls to memset, memcpy and so on. Is there an option that can disable this optimization? For some cases, I do not want the code to depend on libc.</div>
<div><br></div><div>Thanks in advance!</div><div>Bin</div><div><br></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><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><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></div></div></body></html>