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

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 10:42:03 PDT 2021


ayermolo added a comment.

In D104080#2812525 <https://reviews.llvm.org/D104080#2812525>, @jhenderson wrote:

>> The size went up from 107KB to 322KB, aggregate of all the input sections.
>
> That sounds like a lot (3x increase). How does this impact link times?
>
> Is this patch intended to be reviewed as-is, or is this still illustrative?

Sorry, yes reviewed as-is.
The increase is driven by couple of things. This is for ELF64 so to/from total goes from 8 bytes to 16 bytes. I am also using RELA which adds another 8 bytes for addend. @MaskRay suggested using REL, but looking at the code where it's chooses, it seems like there is just one global flag for the writer. Not sure if this is on purpose or just for ease of implementation. If anyone has insights would love to hear it.
I did timings on clang.
Old:
0:01.16 real,	1.07 user,	6.63 sys,	0 amem,	685040 mmem
0:01.23 real,	1.17 user,	8.87 sys,	0 amem,	689600 mmem
0:01.17 real,	1.15 user,	7.19 sys,	0 amem,	690520 mmem

New
0:01.10 real,	1.11 user,	6.46 sys,	0 amem,	690772 mmem
0:01.10 real,	1.10 user,	7.25 sys,	0 amem,	685932 mmem
0:01.09 real,	1.09 user,	6.28 sys,	0 amem,	685900 mmem

user time went up negligibly, real time and sys time are noise.
Relocation sections do not participate in actual relocations, and it's just a linear scan through memory to process them. I doubt it will have significant impact on linking times with bigger binaries.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104080



More information about the llvm-commits mailing list