[PATCH] D104060: Machine IR Profile

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 11:57:45 PDT 2021


hiraditya added a comment.

In D104060#2815509 <https://reviews.llvm.org/D104060#2815509>, @davidxl wrote:

> Thinking about MIP's use case a little, it seems that it actually matches
> what xray does.  Xray has very low runtime overhead and can be turned on
> always : xra https://llvm.org/docs/XRay.htmly. Have you compare with xray
> and consider using that?

Perhaps xray could be improved to reduce code size overhead to have feature parity with MIP?

> Thanks for sharing this! Specifically re: the -fprofile-generate v. MIP comparison for code coverage, perhaps it would be more fair to compare against -finstrument-function-entry-bare. The latter only adds one call per function, whereas -fprofile-generate can add instrument a function in more than one place.

+1

Some historical context, I wrote an instrumentation little while back https://reviews.llvm.org/D74362 which adds similar instrumentation for function entry but at the IR level.

> David
>
> ellis added a comment.
>
>> @davidxl
>>
>> I've added text size data to
>> https://gist.github.com/ellishg/92a68cf82bfdeccd10225154425edc69#gistcomment-3778109
>> and hopefully it is more clear. I randomly chose the test
>> `MultiSource/Benchmarks/FreeBench/fourinarow.test` to show the size data.
>> You can see the raw data in
>> https://gist.github.com/ellishg/156639f24d728a88067f903cb53e1643
>>
>> Base
>> ====
>>
>>   "size..text": 4629
>>   "size..data": 8,
>>   "size..bss": 120,
>>
>> MIP
>> ===
>>
>>   "size..text": 4741,
>>   "size..data": 8,
>>   "size.__llvm_mipmap": 768,
>>   "size.__llvm_mipraw": 41,
>>   "size..bss": 120,
>>
>> `-fcs-profile-generate`
>> =======================
>>
>>   "size..text": 24322,
>>   "size..data": 176,
>>   "size.__llvm_prf_cnts": 1336,
>>   "size.__llvm_prf_data": 816,
>>   "size.__llvm_prf_names": 117,
>>   "size.__llvm_prf_vnds": 24576,
>>   "size..bss": 8952,
>>
>> Repository:
>>
>>   rG LLVM Github Monorepo
>>
>> CHANGES SINCE LAST ACTION
>>
>>   https://reviews.llvm.org/D104060/new/
>>
>> https://reviews.llvm.org/D104060




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104060/new/

https://reviews.llvm.org/D104060



More information about the llvm-commits mailing list