This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: New option -flimit-function-alignment
- From: Denys Vlasenko <dvlasenk at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 11 Oct 2016 16:23:58 +0200
- Subject: Re: New option -flimit-function-alignment
- Authentication-results: sourceware.org; auth=none
- References: <0105be2b-46da-1e48-87cc-a88b46825cf0@redhat.com>
On 10/11/2016 04:11 PM, Bernd Schmidt wrote:
Denys has submitted some patches to add more capabilities to the
-falign-* options, but these still have some issues, and the original
ideas seems to have been to allow for large alignments without
over-aligning small functions. The following patch implements that
idea by taking into account the function size as computed during
shorten_branches: let's say we use "-falign-functions=128
-flimit-function-alignment", then a 15-byte function will be 16-byte
aligned rather than 128-byte aligned.
Bootstrapped and tested on x86_64-linux. Denys, does this solve your
problem?
This is better than current behavior, but this is not what I want.
15-byte function does not need to be aligned to 16 bytes on a machine
with 128-byte L1I cachelines. It needs to be aligned to 128 bytes
if there are less than 15 bytes remaining; if there are MORE than 15 bytes
remaining, why align at all? It's a waste of space.