[PATCH] D104060: Machine IR Profile

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 13:55:22 PDT 2021


MIP has achieved great size reduction for instrumented binary. My
understanding the savings are mainly from the following:

1) Smaller counter size (1 byte or 4 byte instead of 8 byte for IR PGO)
2) extractable per function metadata (mipmap). Using this technique may
increase object file size more (due to extra relocations), but will reduce
executable size.

I don't understand (in block coverage mode) how the .text size can be
reduced. I have not looked at the patch in detail, but the test case shows
that the counter update is simply a 'movb 0, $counter' even in non-coverage
mode, is that expected?

I think 2) is something worth introducing to IRPGO under a flag.

David


On Sun, Jun 13, 2021 at 12:47 PM Kyungwoo Lee via Phabricator <
reviews at reviews.llvm.org> wrote:

> kyulee added a comment.
>
> > Yes there are other instrumentations that provide similar features with
> low runtime overhead, but MIP seems to be the only one that extracts out
> all metadata to minimize binary size overhead.
>
> I echo this. There are instrumentations with similar features (e.g, code
> coverage) but they required to keep metadata in the final binary, The
> other/rest lightweight instrumentations (without metadata) are far from
> complete to match the feature that MIP provides.
> The key differentiation of MIP is that the metadata (mipmap) is expressed
> with relative relocations, which can be extractable in any build target and
> platform, which took us non-trivial amount of time to make them right.
> In theory, we could improve other existing insturmentations like MIP to
> extract metadata, but this may require a significant amount of changes in
> the architect and format.
>
>
> 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/20210613/a762cc38/attachment.html>


More information about the llvm-commits mailing list