[PATCH] D104080: [LLD][LLVM] CG Graph profile using relocations

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 10:33:18 PDT 2021


On Fri, Jul 16, 2021 at 1:26 PM Alexander Yermolovich via Phabricator <
reviews at reviews.llvm.org> wrote:

> ayermolo added a comment.
>
> In D104080#2883347 <https://reviews.llvm.org/D104080#2883347>, @echristo
> wrote:
>
> > In D104080#2835108 <https://reviews.llvm.org/D104080#2835108>, @MaskRay
> wrote:
> >
> >> You can mention that this does increase `-fprofile-use=` object file
> sizes a bit but probably don't matter.
> >>
> >> For instrumentation PGO users, `-fprofile-generate=` object files are
> much larger than `-fprofile-use=`, so `-fprofile-use=` slightly size
> increases don't matter.
> >> For sample PGO users, this may increase the peak object file sizes a
> bit, but doesn't matter as your measurement for clang-13 shows.
> >>
> >>> Test Plan:
> >>> ninja check all, manual rtesting
> >>
> >> This should be deleted when committing.
> >>
> >>> The size went up from 107KB to 322KB, aggregate of all the input
> sections.
> >>
> >> How large is your clang-13? ~100MiB? Then this increase looks neligible.
> >
> > I've noticed some increases in object size over here. What's the
> percentage increase you're expecting here in object file sizes?
>
> So original implementation was 16-bytes (2x4 bytes for index, 8 bytes for
> Weight). After this @MaskRay changed it to REL implementation. So that's 40
> bytes (2x16 bytes for index in relocation form + 8 bytes for Weight).
> When I measured with RELA approach on clang-13 it went from 107KB to 322KB
> in 118MB binary. With REL, current implementation, that's around 230KB out
> of 118MB. Now this is final binary size so proportion, in aggregate, of
> object files will be smaller.
>

I'm specifically talking about object file growth rather than binary size.
I went ahead and ran a bunch of tests here to get an idea of what
percentage increase in object file size we're looking at. In some cases
it's about 5%, but the general case is much smaller.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/2d3c54c3/attachment.html>


More information about the llvm-commits mailing list