public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Increase default function alignment
@ 2019-05-31 12:28 Wilco Dijkstra
  2019-05-31 15:48 ` Steve Ellcey
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wilco Dijkstra @ 2019-05-31 12:28 UTC (permalink / raw)
  To: GCC Patches, James Greenhalgh, Richard Earnshaw,
	Ramana Radhakrishnan, Richard Sandiford
  Cc: nd

With -mcpu=generic the function alignment is currently 8, however almost all
supported cores prefer 16 or higher, so increase the default to 16:12.
This gives ~0.2% performance increase on SPECINT2017, while codesize is 0.12%
larger.

ChangeLog:
2019-05-31  Wilco Dijkstra  <wdijkstr@arm.com>

	* config/aarch64/aarch64.c (generic_tunings): Set function alignment to 16.

--

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 0023cb37bbae5afe9387840c1bb6b43586d4fac2..ed1422af6aab5e3c6eeea37ec57e69b64092a0ab 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -693,7 +693,7 @@ static const struct tune_params generic_tunings =
   4, /* memmov_cost  */
   2, /* issue_rate  */
   (AARCH64_FUSE_AES_AESMC), /* fusible_ops  */
-  "8",	/* function_align.  */
+  "16:12",	/* function_align.  */
   "4",	/* jump_align.  */
   "8",	/* loop_align.  */
   2,	/* int_reassoc_width.  */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Increase default function alignment
  2019-05-31 12:28 [PATCH][AArch64] Increase default function alignment Wilco Dijkstra
@ 2019-05-31 15:48 ` Steve Ellcey
  2019-05-31 16:12   ` Wilco Dijkstra
  2019-07-31 17:00 ` Wilco Dijkstra
  2019-08-12 18:43 ` James Greenhalgh
  2 siblings, 1 reply; 5+ messages in thread
From: Steve Ellcey @ 2019-05-31 15:48 UTC (permalink / raw)
  To: gcc-patches, James.Greenhalgh, Richard.Earnshaw, Wilco.Dijkstra,
	Richard.Sandiford, Ramana.Radhakrishnan
  Cc: nd

On Fri, 2019-05-31 at 11:52 +0000, Wilco Dijkstra wrote:
> With -mcpu=generic the function alignment is currently 8, however almost all
> supported cores prefer 16 or higher, so increase the default to 16:12.
> This gives ~0.2% performance increase on SPECINT2017, while codesize is 0.12%
> larger.
> 
> ChangeLog:
> 2019-05-31  Wilco Dijkstra  <wdijkstr@arm.com>
> 
> 	* config/aarch64/aarch64.c (generic_tunings): Set function
> alignment to 16.
> 
> --
> 
> diff --git a/gcc/config/aarch64/aarch64.c
> b/gcc/config/aarch64/aarch64.c
> index
> 0023cb37bbae5afe9387840c1bb6b43586d4fac2..ed1422af6aab5e3c6eeea37ec57
> e69b64092a0ab 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -693,7 +693,7 @@ static const struct tune_params generic_tunings =
>    4, /* memmov_cost  */
>    2, /* issue_rate  */
>    (AARCH64_FUSE_AES_AESMC), /* fusible_ops  */
> -  "8",	/* function_align.  */
> +  "16:12",	/* function_align.  */
>    "4",	/* jump_align.  */
>    "8",	/* loop_align.  */
>    2,	/* int_reassoc_width.  */

I have no objection to the change but could the commit message and/or
comments be expanded to explain the ':12' part of this value.  I
couldn't find an explanation for it in the code and I don't understand
what it does.

Steve Ellcey
sellcey@marvell.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Increase default function alignment
  2019-05-31 15:48 ` Steve Ellcey
@ 2019-05-31 16:12   ` Wilco Dijkstra
  0 siblings, 0 replies; 5+ messages in thread
From: Wilco Dijkstra @ 2019-05-31 16:12 UTC (permalink / raw)
  To: Steve Ellcey, gcc-patches, James Greenhalgh, Richard Earnshaw,
	Richard Sandiford, Ramana Radhakrishnan
  Cc: nd

Hi Steve,

> I have no objection to the change but could the commit message and/or
> comments be expanded to explain the ':12' part of this value.  I
> couldn't find an explanation for it in the code and I don't understand
> what it does.

See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-falign-functions

Basically the 12 guarantees there are at least 12 useable bytes in the 
16-byte aligned block. This significantly lowers the overhead of padding
compared to always forcing 16-byte alignment. The Neoverse N1 tuning
already uses this feature.

Wilco
    

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Increase default function alignment
  2019-05-31 12:28 [PATCH][AArch64] Increase default function alignment Wilco Dijkstra
  2019-05-31 15:48 ` Steve Ellcey
@ 2019-07-31 17:00 ` Wilco Dijkstra
  2019-08-12 18:43 ` James Greenhalgh
  2 siblings, 0 replies; 5+ messages in thread
From: Wilco Dijkstra @ 2019-07-31 17:00 UTC (permalink / raw)
  To: GCC Patches, James Greenhalgh, Richard Earnshaw,
	Ramana Radhakrishnan, Richard Sandiford
  Cc: nd

ping
   
 
With -mcpu=generic the function alignment is currently 8, however almost all
 supported cores prefer 16 or higher, so increase the default to 16:12.
 This gives ~0.2% performance increase on SPECINT2017, while codesize is 0.12%
 larger.
 
 ChangeLog:
 2019-05-31  Wilco Dijkstra  <wdijkstr@arm.com>
 
         * config/aarch64/aarch64.c (generic_tunings): Set function alignment to 16.
 
 --
 
 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
 index 0023cb37bbae5afe9387840c1bb6b43586d4fac2..ed1422af6aab5e3c6eeea37ec57e69b64092a0ab 100644
 --- a/gcc/config/aarch64/aarch64.c
 +++ b/gcc/config/aarch64/aarch64.c
 @@ -693,7 +693,7 @@ static const struct tune_params generic_tunings =
    4, /* memmov_cost  */
    2, /* issue_rate  */
    (AARCH64_FUSE_AES_AESMC), /* fusible_ops  */
 -  "8", /* function_align.  */
 +  "16:12",     /* function_align.  */
    "4", /* jump_align.  */
    "8", /* loop_align.  */
    2,   /* int_reassoc_width.  */
 
     

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Increase default function alignment
  2019-05-31 12:28 [PATCH][AArch64] Increase default function alignment Wilco Dijkstra
  2019-05-31 15:48 ` Steve Ellcey
  2019-07-31 17:00 ` Wilco Dijkstra
@ 2019-08-12 18:43 ` James Greenhalgh
  2 siblings, 0 replies; 5+ messages in thread
From: James Greenhalgh @ 2019-08-12 18:43 UTC (permalink / raw)
  To: Wilco Dijkstra
  Cc: GCC Patches, Richard Earnshaw, Ramana Radhakrishnan,
	Richard Sandiford, nd

On Fri, May 31, 2019 at 12:52:32PM +0100, Wilco Dijkstra wrote:
> With -mcpu=generic the function alignment is currently 8, however almost all
> supported cores prefer 16 or higher, so increase the default to 16:12.
> This gives ~0.2% performance increase on SPECINT2017, while codesize is 0.12%
> larger.

OK.

Thanks,
James

> ChangeLog:
> 2019-05-31  Wilco Dijkstra  <wdijkstr@arm.com>
> 
> 	* config/aarch64/aarch64.c (generic_tunings): Set function alignment to 16.
> 
> --
> 
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 0023cb37bbae5afe9387840c1bb6b43586d4fac2..ed1422af6aab5e3c6eeea37ec57e69b64092a0ab 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -693,7 +693,7 @@ static const struct tune_params generic_tunings =
>    4, /* memmov_cost  */
>    2, /* issue_rate  */
>    (AARCH64_FUSE_AES_AESMC), /* fusible_ops  */
> -  "8",	/* function_align.  */
> +  "16:12",	/* function_align.  */
>    "4",	/* jump_align.  */
>    "8",	/* loop_align.  */
>    2,	/* int_reassoc_width.  */
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-12 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 12:28 [PATCH][AArch64] Increase default function alignment Wilco Dijkstra
2019-05-31 15:48 ` Steve Ellcey
2019-05-31 16:12   ` Wilco Dijkstra
2019-07-31 17:00 ` Wilco Dijkstra
2019-08-12 18:43 ` James Greenhalgh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).