public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [AArch64] Cortex-A57 Choose some new branch costs.
@ 2015-11-13 10:13 James Greenhalgh
  2015-11-13 10:41 ` Richard Biener
  2015-11-16 10:20 ` Richard Earnshaw
  0 siblings, 2 replies; 4+ messages in thread
From: James Greenhalgh @ 2015-11-13 10:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: marcus.shawcroft, richard.earnshaw

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]


Hi,

With all the work that has recently gone in to ifcvt, I thought I'd revisit
the branch cost settings for Cortex-A57. After a run of experiments [1],
I found {1, 3} to be the sweet spot, giving a small set of performance
improvements across some popular benchmarks.

I'd therefore like to propose changing the branch cost to those numbers.

Patch bootstrapped tuning for Cortex-A57 with no issues. I'll revisit
the same for Cortex-A53.

OK?

Thanks,
James

[1]: {2, 2}, {2, 3}, {2, 4},
     {1, 2}, {1, 3}, {1, 4},
     {3, 3}, {3, 4},
     {4, 4}, {4, 5},
     {5, 5}, {5, 6}

---
2015-11-12  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c (cortexa57_branch_costs): New.
	(cortexa57_tunings): Use it.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-AArch64-Cortex-A57-Choose-some-new-branch-costs.patch --]
[-- Type: text/x-patch;  name=0001-AArch64-Cortex-A57-Choose-some-new-branch-costs.patch, Size: 866 bytes --]

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 5ec7f08..96df9ed 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -338,6 +338,13 @@ static const struct cpu_branch_cost generic_branch_cost =
   2   /* Unpredictable.  */
 };
 
+/* Branch costs for Cortex-A57.  */
+static const struct cpu_branch_cost cortexa57_branch_cost =
+{
+  1,  /* Predictable.  */
+  3   /* Unpredictable.  */
+};
+
 static const struct tune_params generic_tunings =
 {
   &cortexa57_extra_costs,
@@ -393,7 +400,7 @@ static const struct tune_params cortexa57_tunings =
   &cortexa57_addrcost_table,
   &cortexa57_regmove_cost,
   &cortexa57_vector_cost,
-  &generic_branch_cost,
+  &cortexa57_branch_cost,
   4, /* memmov_cost  */
   3, /* issue_rate  */
   (AARCH64_FUSE_MOV_MOVK | AARCH64_FUSE_ADRP_ADD

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

* Re: [AArch64] Cortex-A57 Choose some new branch costs.
  2015-11-13 10:13 [AArch64] Cortex-A57 Choose some new branch costs James Greenhalgh
@ 2015-11-13 10:41 ` Richard Biener
  2015-11-16  9:28   ` James Greenhalgh
  2015-11-16 10:20 ` Richard Earnshaw
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Biener @ 2015-11-13 10:41 UTC (permalink / raw)
  To: James Greenhalgh; +Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw

On Fri, Nov 13, 2015 at 11:13 AM, James Greenhalgh
<james.greenhalgh@arm.com> wrote:
>
> Hi,
>
> With all the work that has recently gone in to ifcvt, I thought I'd revisit
> the branch cost settings for Cortex-A57. After a run of experiments [1],
> I found {1, 3} to be the sweet spot, giving a small set of performance
> improvements across some popular benchmarks.
>
> I'd therefore like to propose changing the branch cost to those numbers.
>
> Patch bootstrapped tuning for Cortex-A57 with no issues. I'll revisit
> the same for Cortex-A53.
>
> OK?

Can you re-do the experiment with adding a LOGICAL_OP_NON_SHORT_CIRCUIT
target macro for aarch64?  It's fallback uses BRANCH_COST (see fold-const.c
and tree-ssa-ifcombine.c)

Richard.

>
> Thanks,
> James
>
> [1]: {2, 2}, {2, 3}, {2, 4},
>      {1, 2}, {1, 3}, {1, 4},
>      {3, 3}, {3, 4},
>      {4, 4}, {4, 5},
>      {5, 5}, {5, 6}
>
> ---
> 2015-11-12  James Greenhalgh  <james.greenhalgh@arm.com>
>
>         * config/aarch64/aarch64.c (cortexa57_branch_costs): New.
>         (cortexa57_tunings): Use it.
>

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

* Re: [AArch64] Cortex-A57 Choose some new branch costs.
  2015-11-13 10:41 ` Richard Biener
@ 2015-11-16  9:28   ` James Greenhalgh
  0 siblings, 0 replies; 4+ messages in thread
From: James Greenhalgh @ 2015-11-16  9:28 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw

On Fri, Nov 13, 2015 at 11:40:56AM +0100, Richard Biener wrote:
> On Fri, Nov 13, 2015 at 11:13 AM, James Greenhalgh
> <james.greenhalgh@arm.com> wrote:
> >
> > Hi,
> >
> > With all the work that has recently gone in to ifcvt, I thought I'd revisit
> > the branch cost settings for Cortex-A57. After a run of experiments [1],
> > I found {1, 3} to be the sweet spot, giving a small set of performance
> > improvements across some popular benchmarks.
> >
> > I'd therefore like to propose changing the branch cost to those numbers.
> >
> > Patch bootstrapped tuning for Cortex-A57 with no issues. I'll revisit
> > the same for Cortex-A53.
> >
> > OK?
> 
> Can you re-do the experiment with adding a LOGICAL_OP_NON_SHORT_CIRCUIT
> target macro for aarch64?  It's fallback uses BRANCH_COST (see fold-const.c
> and tree-ssa-ifcombine.c)

This didn't drastically change the results for the workloads I was
using as benchmarks. I'd still pick {1, 3} out as the winner.

Thanks,
James

> > ---
> > 2015-11-12  James Greenhalgh  <james.greenhalgh@arm.com>
> >
> >         * config/aarch64/aarch64.c (cortexa57_branch_costs): New.
> >         (cortexa57_tunings): Use it.
> >
> 

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

* Re: [AArch64] Cortex-A57 Choose some new branch costs.
  2015-11-13 10:13 [AArch64] Cortex-A57 Choose some new branch costs James Greenhalgh
  2015-11-13 10:41 ` Richard Biener
@ 2015-11-16 10:20 ` Richard Earnshaw
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Earnshaw @ 2015-11-16 10:20 UTC (permalink / raw)
  To: James Greenhalgh, gcc-patches; +Cc: marcus.shawcroft, richard.earnshaw

On 13/11/15 10:13, James Greenhalgh wrote:
> 
> Hi,
> 
> With all the work that has recently gone in to ifcvt, I thought I'd revisit
> the branch cost settings for Cortex-A57. After a run of experiments [1],
> I found {1, 3} to be the sweet spot, giving a small set of performance
> improvements across some popular benchmarks.
> 
> I'd therefore like to propose changing the branch cost to those numbers.
> 
> Patch bootstrapped tuning for Cortex-A57 with no issues. I'll revisit
> the same for Cortex-A53.
> 
> OK?
> 
> Thanks,
> James
> 
> [1]: {2, 2}, {2, 3}, {2, 4},
>      {1, 2}, {1, 3}, {1, 4},
>      {3, 3}, {3, 4},
>      {4, 4}, {4, 5},
>      {5, 5}, {5, 6}
> 
> ---
> 2015-11-12  James Greenhalgh  <james.greenhalgh@arm.com>
> 
> 	* config/aarch64/aarch64.c (cortexa57_branch_costs): New.
> 	(cortexa57_tunings): Use it.
> 

OK.

R.

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

end of thread, other threads:[~2015-11-16 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 10:13 [AArch64] Cortex-A57 Choose some new branch costs James Greenhalgh
2015-11-13 10:41 ` Richard Biener
2015-11-16  9:28   ` James Greenhalgh
2015-11-16 10:20 ` Richard Earnshaw

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).