This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] Add new ipa-reorder pass


On 9/19/19 2:33 AM, Martin Liška wrote:
> Hi.
> 
> Function reordering has been around for quite some time and a naive
> implementation was also part of my diploma thesis some time ago.
> Currently, the GCC can reorder function based on first execution, which
> happens with PGO and LTO of course. Known limitation is that the order
> is preserved only partially as various symbols go into different LTRANS partitions.
> 
> There has been some research in the area and I would point out the Facebook paper
> ([1]) and Sony presentation ([2]). Based on that, I decided to make a new implementation
> in the GCC that does the same (in a proper way). First part of the enablement are patches
> to ld.bfd and ld.gold that come up with a new section .text.sorted, that is always sorted.
> There's a snippet from the modified default linker script:
Funny, I was doing this via linker scripts circa ~95, in fact that's why
we have -ffunction-sections :-)   We started with scripts which
post-processed profiling data to create linker scripts for ELF systems.
 We had something for HPUX/SOM as well, but I can't remember what
mechanism we used, it may have been a gross level sorting using the SOM
section sort key mechanism - it only had 128 or 256 keys with a notable
amount of them reserved.

We had also built a linker with a basic level of interposition circa
1993 and explored various approaches to reordering executables.  I'd
just joined the group at the time and was responsible for wiring up
stuff on the OS side, but eventually got the "pleasure" of owning the
linker server.  A lot of the C3 algorithmic stuff looks similar to what
we did.

Anyway...

I don't see anything objectionable in here.  It's noted as an RFC.  Are
you interested in pushing this forward for gcc-10?

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]