[PATCH] D44847: [profile] Fix value profile runtime merging issues

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 30 13:55:40 PDT 2018


My previous refers to using gcc as the compiler.

With llvm (itself, i.e. trunk) as the compiler, it's not inlined.

I will update the patch using a wrapper.


On Fri, Mar 30, 2018 at 1:49 PM Rong Xu <xur at google.com> wrote:

> I checked the assembly in
> clang_rt.profile-i386.dir/  and
> clang_rt.profile-x86_64.dir/
>
> Both are inlined.
>
> On Fri, Mar 30, 2018 at 1:43 PM David Li via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> davidxl added inline comments.
>>
>>
>> ================
>> Comment at: lib/profile/InstrProfilingValue.c:138
>>                                   uint32_t CounterIndex) {
>> +  __llvm_profile_instrument_target_value(TargetValue, Data,
>> CounterIndex, 1);
>> +
>> ----------------
>> Is this call getting inlined in the library build? If not, it will
>> introduce unnecessary overhead.
>>
>> 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.
>>
>>
>> https://reviews.llvm.org/D44847
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180330/50906279/attachment.html>


More information about the llvm-commits mailing list