<div dir="ltr">noinline should, and does, not mean "do not do IPO"; we will still do IPCP. The easiest way to defeat IPO is to use __attribute__((weak)) as it makes isDefinitionExact false: <a href="https://godbolt.org/g/VVBcgF">https://godbolt.org/g/VVBcgF</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 22, 2017 at 10:35 AM, David Blaikie 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"><div dir="ltr">optnone should work, but really noinline should probably (Chandler: Can you confirm: is it reasonable to model noinline as "no interprocedural analysis across this function boundary" (so FunctionAttrs should do the same thing for noinline as it does for optnone, for example? ie: not derive any new attributes) - allowing the function to be optimized internally (unlike optnone) but not allowing interprocedural analysis inside the function to be used in callers (unlike optnone)) work as well?<div><div class="h5"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 22, 2017 at 7:35 AM Joerg Sonnenberger via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jun 21, 2017 at 05:25:04PM -0700, Mehdi AMINI via llvm-dev wrote:<br>
> Hi Kuba,<br>
><br>
> Try:<br>
><br>
> __attribute__(optnone)<br>
><br>
> See<br>
> <a href="https://clang.llvm.org/docs/AttributeReference.html#optnone-clang-optnone" rel="noreferrer" target="_blank">https://clang.llvm.org/docs/<wbr>AttributeReference.html#<wbr>optnone-clang-optnone</a><br>
<br>
Actually, it should be enough to use:<br>
<br>
__attribute__((noinline))<br>
void please_do_not_optimize_me_<wbr>away(int arg1, void *arg2) {<br>
asm volatile("":::"memory");<br>
}<br>
<br>
Creating a real barrier is important.<br>
<br>
Joerg<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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>
</blockquote></div></div></div></div>
<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>
<br></blockquote></div><br></div>