This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to check if two symbols are from same source unit during WPA ?
- From: Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>
- To: Richard Biener <rguenther at suse dot de>, Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>, <nd at arm dot com>
- Date: Thu, 14 Apr 2016 13:22:37 +0100
- Subject: Re: How to check if two symbols are from same source unit during WPA ?
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <CAAgBjMm++Cf+iKD+BBgXO7Bk2DZwPMra9+VXrf6pateujN4MGg at mail dot gmail dot com> <36255F7F-1676-459B-B95F-A812B26214FF at suse dot de> <CAAgBjMkcNH6WAkgaB0p7xr7dwhmuMA0z2bwb6DQxH4WKvA1zfA at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1604141024150 dot 13384 at t29 dot fhfr dot qr> <CAAgBjM=5gwG8RNicUWs7hDjST=-dQtPOSqkm9MEEHZBzwx_STQ at mail dot gmail dot com> <alpine dot LSU dot 2 dot 11 dot 1604141414010 dot 13384 at t29 dot fhfr dot qr>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
>
> What happens in practice? GCC doesn't put functions in random
> partitions.
>
The data goes into a separate partition AFAIU - it means that all data accesses are as though they are extern references which means there's not necessarily any CSE'ing ability that's available with section anchors.
>> If it's not desired by default could we gate it on an option ?
>> AFIAU, section anchors optimization is important for ARM and AArch64.
>
> For code size or for performance? I wonder why section anchors cannot
> be "implemented" using some special relocations and thus as linker
> optimization.
For performance (and probably code size too) as you can end up CSE'ing the anchor point. the difference in performance with -flto-partitions=1 is visible on quite a few of the spec2k benchmarks. I don't remember which ones immediately but yeah it makes a difference.
Ramana
>
> Richard.
>