<div dir="ltr">My previous refers to using gcc as the compiler. <div><br><div>With llvm (itself, i.e. trunk) as the compiler, it's not inlined.</div><div><br></div><div>I will update the patch using a wrapper.</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 30, 2018 at 1:49 PM Rong Xu <<a href="mailto:xur@google.com">xur@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I checked the assembly in <div>clang_rt.profile-i386.dir/  and</div><div>clang_rt.profile-x86_64.dir/<br></div><div><br></div><div>Both are inlined.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 30, 2018 at 1:43 PM David Li via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/profile/InstrProfilingValue.c:138<br>
                                  uint32_t CounterIndex) {<br>
+  __llvm_profile_instrument_target_value(TargetValue, Data, CounterIndex, 1);<br>
+<br>
----------------<br>
Is this call getting inlined in the library build? If not, it will introduce unnecessary overhead.<br>
<br>
One way to avoid this is to define a static always inline function, and then make the two APIs as wrappers to that common function.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D44847" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44847</a><br>
<br>
<br>
<br>
</blockquote></div></blockquote></div>