<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jun 22, 2017 10:36 AM, "David Blaikie via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="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 class="elided-text"></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">IMHO, No. The only semantic of noinline is that the inliner(s) pass shouldn't do anything with that function. Inhibiting IPO seems like could be a valid usecase but that would need a different attribute (e.g. noipo).</div><div dir="auto"><br></div><div dir="auto">--</div><div dir="auto">Davide</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="elided-text"><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>
<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></div></div>