[PATCH] D104060: Machine IR Profile

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 16:11:42 PDT 2021


Do you have runtime number with -fcs-profile-generate -mllvm
-disable-vp=true

This will provide more data (BB count) than what MIP can do.

Besides, more options can be added to control the type of profile data
collected in IRPGO to further reduce overhead.

David

On Fri, Jun 11, 2021 at 3:46 PM Ellis Hoag via Phabricator <
reviews at reviews.llvm.org> wrote:

> ellis added a comment.
>
> I've collected some size and runtime metrics from `llvm-test-suite`. The
> steps and results can be found in this gist:
> https://gist.github.com/ellishg/92a68cf82bfdeccd10225154425edc69
>
> Keep in mind that a major goal is that MIP instrumented binaries should be
> as small as possible without sacrificing usability or functionality. The
> metrics that I measured in the gist are the binary size and the execution
> time of instrumented binaries. Like I said in the description, MIP
> instrumented binaries are usually 2-5% larger than non-instrumented
> binaries. We can compare this to the
> `-fsanitize-coverage=func,inline-bool-flag,pc-table` flag which seems to
> produce instrumented binaries that can be 100x larger. The extra size
> likely comes from the function metadata that is left in the binary, whereas
> MIP extracts all excess metadata out of the binary.
>
> I also looked into comparing against `-finstrument-function-entry-bare`
> and `-finstrument-functions`. It seems that they inject calls to `void
> __cyg_profile_func_enter_bare();` or `void __cyg_profile_func_enter (void
> *this_fn, void *call_site);` at the start of each function. The first flag
> doesn't really provide enough context know the caller and mark it as
> covered. The second does provide this information, but it still would
> require some work to collect profile data in a consumable way as MIP does.
> That being said, these flags seem provide similar size and runtime overhead
> as MIP, albeit with much less functionality.
>
> It should also be noted that all this is only considering MIP function
> coverage. MIP can profile much more data including call counts and the
> dynamic call graph, likely with very similar performance metrics.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D104060/new/
>
> https://reviews.llvm.org/D104060
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/24363de5/attachment.html>


More information about the llvm-commits mailing list