Message ID | VI1PR0801MB2127600D7B9EA79AC253B54E83290@VI1PR0801MB2127.eurprd08.prod.outlook.com |
---|---|
State | New |
Headers | show |
Series | [AARCH64] Set jump-align=4 for neoversen1 | expand |
ping Testing shows the setting of 32:16 for jump alignment has a significant codesize cost, however it doesn't make a difference in performance. So set jump-align to 4 to get 1.6% codesize improvement. OK for commit? ChangeLog 2019-12-24 Wilco Dijkstra <wdijkstr@arm.com> * config/aarch64/aarch64.c (neoversen1_tunings): Set jump_align to 4. -- diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1646ed1d9a3de8ee2f0abff385a1ea145e234475..209ed8ebbe81104d9d8cff0df31946ab7704fb33 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1132,7 +1132,7 @@ static const struct tune_params neoversen1_tunings = 3, /* issue_rate */ (AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_CMP_BRANCH), /* fusible_ops */ "32:16", /* function_align. */ - "32:16", /* jump_align. */ + "4", /* jump_align. */ "32:16", /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes: > Testing shows the setting of 32:16 for jump alignment has a significant codesize > cost, however it doesn't make a difference in performance. So set jump-align > to 4 to get 1.6% codesize improvement. I was leaving this to others in case it was obvious to them. On the basis that silence suggests it wasn't, :-) could you go into more details? Is it expected on first principles that jump alignment doesn't matter for Neoverse N1, or is this purely based on experimentation? If it's expected, are we sure that the other "32:16" entries are still worthwhile? When you say it doesn't make a difference in performance, does that mean that no individual test's performance changed significantly, or just that the aggregate score didn't? Did you experiment with anything inbetween the current 32:16 and 4, such as 32:8 or even 32:4? The problem with applying the patch only with the explanation above is that if someone in future has evidence that jump alignment can make a difference for their testcase, it would be very hard for them to reproduce the reasoning that led to this change. Thanks, Richard > OK for commit? > > ChangeLog > 2019-12-24 Wilco Dijkstra <wdijkstr@arm.com> > > * config/aarch64/aarch64.c (neoversen1_tunings): Set jump_align to 4. > > -- > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index 1646ed1d9a3de8ee2f0abff385a1ea145e234475..209ed8ebbe81104d9d8cff0df31946ab7704fb33 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -1132,7 +1132,7 @@ static const struct tune_params neoversen1_tunings = > 3, /* issue_rate */ > (AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_CMP_BRANCH), /* fusible_ops */ > "32:16",/* function_align. */ > - "32:16",/* jump_align. */ > + "4",/* jump_align. */ > "32:16",/* loop_align. */ > 2,/* int_reassoc_width. */ > 4,/* fp_reassoc_width. */
Hi Richard, Wilco, On 1/17/20 8:43 AM, Richard Sandiford wrote: > Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes: > > Testing shows the setting of 32:16 for jump alignment has a > significant codesize > > cost, however it doesn't make a difference in performance. So set > jump-align > > to 4 to get 1.6% codesize improvement. > > I was leaving this to others in case it was obvious to them. On the > basis that silence suggests it wasn't, :-) could you go into more details? > Is it expected on first principles that jump alignment doesn't matter > for Neoverse N1, or is this purely based on experimentation? If it's > expected, are we sure that the other "32:16" entries are still worthwhile? > When you say it doesn't make a difference in performance, does that mean > that no individual test's performance changed significantly, or just that > the aggregate score didn't? Did you experiment with anything inbetween > the current 32:16 and 4, such as 32:8 or even 32:4? Sorry for dragging my feet on this one, as I put in those numbers last year and I've been trying to recall my experiments from then. The Neoverse N1 Software Optimization guide recommends aligning branch targets to 32 bytes withing the bounds of code density requirements. From my benchmarking last year I do seem to remember function and loop alignment to matter. I probably added the jump alignment for completeness as it's a good idea from first principles. But if the code size hit is too large we could look to decrease it. I'd also be interested in seeing the impact of 32:8 and 32:4. Thanks, Kyrill > > The problem with applying the patch only with the explanation above is > that if someone in future has evidence that jump alignment can make a > difference for their testcase, it would be very hard for them to > reproduce the reasoning that led to this change. > > Thanks, > Richard > > > OK for commit? > > > > ChangeLog > > 2019-12-24 Wilco Dijkstra <wdijkstr@arm.com> > > > > * config/aarch64/aarch64.c (neoversen1_tunings): Set jump_align to 4. > > > > -- > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > > index > 1646ed1d9a3de8ee2f0abff385a1ea145e234475..209ed8ebbe81104d9d8cff0df31946ab7704fb33 > 100644 > > --- a/gcc/config/aarch64/aarch64.c > > +++ b/gcc/config/aarch64/aarch64.c > > @@ -1132,7 +1132,7 @@ static const struct tune_params > neoversen1_tunings = > > 3, /* issue_rate */ > > (AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_CMP_BRANCH), /* > fusible_ops */ > > "32:16",/* function_align. */ > > - "32:16",/* jump_align. */ > > + "4",/* jump_align. */ > > "32:16",/* loop_align. */ > > 2,/* int_reassoc_width. */ > > 4,/* fp_reassoc_width. */
Hi Kyrill & Richard, > I was leaving this to others in case it was obvious to them. On the > basis that silence suggests it wasn't, :-) could you go into more details? > Is it expected on first principles that jump alignment doesn't matter > for Neoverse N1, or is this purely based on experimentation? If it's Jump alignment is set to 4 on almost all cores because higher values have a major codesize cost and yet give no performance gains. I suspect any core that set it higher has done so by accident rather than having benchmarked the cost/benefit. > expected, are we sure that the other "32:16" entries are still worthwhile? > When you say it doesn't make a difference in performance, does that mean > that no individual test's performance changed significantly, or just that > the aggregate score didn't? Did you experiment with anything inbetween > the current 32:16 and 4, such as 32:8 or even 32:4? I mean there is no difference above the noise floor for any test you throw at it. I tried other alignments including 32:16, 32:12, 32:8 but all have a significant cost and zero benefit. Cheers, Wilco
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes: > Hi Kyrill & Richard, > >> I was leaving this to others in case it was obvious to them. On the >> basis that silence suggests it wasn't, :-) could you go into more details? >> Is it expected on first principles that jump alignment doesn't matter >> for Neoverse N1, or is this purely based on experimentation? If it's > > Jump alignment is set to 4 on almost all cores because higher values have > a major codesize cost and yet give no performance gains. > > I suspect any core that set it higher has done so by accident rather than > having benchmarked the cost/benefit. > >> expected, are we sure that the other "32:16" entries are still worthwhile? >> When you say it doesn't make a difference in performance, does that mean >> that no individual test's performance changed significantly, or just that >> the aggregate score didn't? Did you experiment with anything inbetween >> the current 32:16 and 4, such as 32:8 or even 32:4? > > I mean there is no difference above the noise floor for any test you throw at it. OK, great. In that case, let's go with the patch as posted. Thanks, Richard > I tried other alignments including 32:16, 32:12, 32:8 but all have a significant > cost and zero benefit. > > Cheers, > Wilco
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1646ed1d9a3de8ee2f0abff385a1ea145e234475..209ed8ebbe81104d9d8cff0df31946ab7704fb33 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1132,7 +1132,7 @@ static const struct tune_params neoversen1_tunings = 3, /* issue_rate */ (AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_CMP_BRANCH), /* fusible_ops */ "32:16", /* function_align. */ - "32:16", /* jump_align. */ + "4", /* jump_align. */ "32:16", /* loop_align. */ 2, /* int_reassoc_width. */ 4, /* fp_reassoc_width. */