Re: New option -flimit-function-alignment

2016-11-24 Thread Rainer Orth
Hi Jeff, >> gcc/ >> * common.opt (flimit-function-alignment): New. >> * doc/invoke.texi (-flimit-function-alignment): Document. >> * emit-rtl.h (struct rtl_data): Add max_insn_address field. >> * final.c (shorten_branches): Set it. >> * varasm.c (assemble_start_function):

Re: New option -flimit-function-alignment

2016-11-16 Thread Jeff Law
On 10/14/2016 12:28 PM, Bernd Schmidt wrote: On 10/12/2016 09:27 PM, Denys Vlasenko wrote: Yes, something like "if max_skip >= func_size, temporarily lower max_skip to func_size-1" (because otherwise we can create padding bigger-or-equal to the entire function in size, which is stupid - it's

Re: New option -flimit-function-alignment

2016-11-07 Thread Bernd Schmidt
On 10/14/2016 08:28 PM, Bernd Schmidt wrote: On 10/12/2016 09:27 PM, Denys Vlasenko wrote: Yes, something like "if max_skip >= func_size, temporarily lower max_skip to func_size-1" (because otherwise we can create padding bigger-or-equal to the entire function in size, which is stupid - it's

Re: New option -flimit-function-alignment

2016-10-14 Thread Bernd Schmidt
On 10/12/2016 09:27 PM, Denys Vlasenko wrote: Yes, something like "if max_skip >= func_size, temporarily lower max_skip to func_size-1" (because otherwise we can create padding bigger-or-equal to the entire function in size, which is stupid - it's better to just put the function in that space).

Re: New option -flimit-function-alignment

2016-10-12 Thread Denys Vlasenko
On 10/11/2016 10:14 PM, Bernd Schmidt wrote: On 10/11/2016 04:23 PM, Denys Vlasenko wrote: 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

Re: New option -flimit-function-alignment

2016-10-11 Thread Bernd Schmidt
On 10/11/2016 04:23 PM, Denys Vlasenko wrote: 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

Re: New option -flimit-function-alignment

2016-10-11 Thread Denys Vlasenko
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

New option -flimit-function-alignment

2016-10-11 Thread Bernd Schmidt
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