[PATCH] D104060: Machine IR Profile
Ellis Hoag via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 14 11:28:11 PDT 2021
ellis added a comment.
In D104060#2815939 <https://reviews.llvm.org/D104060#2815939>, @davidxl wrote:
> 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.
That is correct. For function coverage MIP inject only one `movb` instruction in x86 so that the total overhead for every function is 1 byte of global data + 7 bytes of text.
> 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?
Let me try to clear something up. The size tests I ran in https://gist.github.com/ellishg/92a68cf82bfdeccd10225154425edc69 were for function coverage only and block coverage disabled. For block coverage, we inject a single `movb` instruction and another global byte for each basic block so the size overhead is very similar to function coverage. Can you point me to the test case you are referring to?
> I think 2) is something worth introducing to IRPGO under a flag.
>
> David
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