<div dir="ltr">What is the semantics of calling function with <span style="color:rgb(0,0,0);font-family:Arial;white-space:pre-wrap">__builtin_always_inline that is marked with </span><span style="color:rgb(0,0,0);font-family:Arial;white-space:pre-wrap">__attribute__ ((noinline)) ?</span><div><font color="#000000" face="Arial"><span style="white-space:pre-wrap">It seems reasonable to me that call site attributes should be stronger than global attributes.  </span></font></div><div><span style="color:rgb(0,0,0);font-family:Arial;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Arial;white-space:pre-wrap">In general SGTM.</span></div></div><br><div class="gmail_quote"><div dir="ltr">wt., 4 wrz 2018 o 12:32 Jakub Kuderski via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> they seem like very surgical tools for controlling inlining, and so applying them to a family of functions is perhaps unwise -- and the case where the builtin is applied to a call in some instantiations and to a built-in operator in others does not immediately seem like a primary concern to me<br></blockquote><div>Having seen a lot of library and game engine code with FORCE_INLINE stuck on dozens functions, I'd eventually expect it to become an issue for some people. However, I think it would be easier to start simple and issue errors in any case where these intrinsics don't make sense, and relax it later if there's a real need.<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(Are there also macro scenarios where you anticipate it being unknown whether the operand is a function call?)<br></blockquote><div>Arthur O'Dwyer pointed that out in the code review -- one example could be sqrt being a function call or a builtin call. Another thing that comes to my mind is `min` from windows.h.  </div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 4, 2018 at 11:53 AM Jon Chesterfield via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-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"><div dir="auto"><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div><div dir="auto">This is a good idea. I've been working around the absence of this by writing wrapper functions tagged with the corresponding metadata.</div><div dir="auto"><br></div><div dir="auto">I don't know clang well enough to review the implementation, but if it ships, I'll use it. Whatever the syntax.</div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto"><br></div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
TL;DR: I propose to add 3 new C/C++ intrinsics for controlling inlining at<br>
callsite:<br>
* __builtin_no_inline(Foo()) -- prevents the call to Foo() from being<br>
inlined at that particular callsite.<br>
* __builtin_always_inline(Foo()) -- inlines this call to Foo(), if possible.<br>
* __builtin_flatten_inline(Foo()) -- inlines this call to Foo() and<br>
(transitively) everything called within Foo’s body.<br>
</blockquote></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>