Hey,

This is a respin of an earlier patch series:
https://gcc.gnu.org/pipermail/gcc-patches/2026-October/736924.html.

The original patch series had three patches. The third patch was
approved and committed. The first and second patches had comments which
are addressed here. The changes for V3AE will be done separately.

Ok for master?

Thanks,
Saurabh

Saurabh Jha (2):
  aarch64: Add two new fields to the tuning models for vector
    comparisons
  aarch64: Change SVE2 comparison costs for Neoverse V3

 gcc/config/aarch64/aarch64-json-schema.h       |  4 +++-
 .../aarch64-json-tunings-parser-generated.inc  |  2 ++
 .../aarch64-json-tunings-printer-generated.inc |  2 ++
 gcc/config/aarch64/aarch64-protos.h            | 12 ++++++++++++
 gcc/config/aarch64/aarch64.cc                  | 18 +++++++++++++-----
 gcc/config/aarch64/tuning_models/cortexx925.h  |  2 ++
 .../aarch64/tuning_models/generic_armv9_a.h    |  2 ++
 gcc/config/aarch64/tuning_models/hip12.h       |  2 ++
 .../aarch64/tuning_models/neoverse512tvb.h     |  2 ++
 gcc/config/aarch64/tuning_models/neoversen2.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversen3.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev1.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev2.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev3.h  |  2 ++
 .../aarch64/tuning_models/neoversev3ae.h       |  2 ++
 gcc/config/aarch64/tuning_models/olympus.h     |  2 ++
 16 files changed, 54 insertions(+), 6 deletions(-)

--
2.34.1


---
This is a forge pull request published on the gcc-patches mailing list mailing 
list
as requested by Saurabh Jha via Sourceware Forge 
<[email protected]>.
Forge discussion: https://forge.sourceware.org/gcc/gcc/pulls/264

Get it locally using:
```
git fetch forge-upstream "+refs/versioned_pull/264/*:refs/versioned_pull/264/*"
git switch -c "pr-264-v2" "refs/versioned_pull/264/2/head"
```
Or, download the patch at: https://forge.sourceware.org/gcc/gcc/pulls/264.diff
Created on: 2026-10-30 13:05:39+00:00
Latest update: 2026-11-18 12:58:53+00:00
Changes: 16 changed files, 54 additions, 6 deletions
Head revision: saurabh.jha/gcc-TEST ref neoverse-v3-tuning commit 
2ce46be6fe7fbd78aaa305ca6be834202e453712
Base revision: gcc/gcc ref trunk commit 
a208de2ff4168214de996076f83dc2269b90883b r17-6339-ga208de2ff41682
Merge base: a208de2ff4168214de996076f83dc2269b90883b
Requested Reviewers:

Changed files:
- M: gcc/config/aarch64/aarch64-json-schema.h
- M: gcc/config/aarch64/aarch64-json-tunings-parser-generated.inc
- M: gcc/config/aarch64/aarch64-json-tunings-printer-generated.inc
- M: gcc/config/aarch64/aarch64-protos.h
- M: gcc/config/aarch64/aarch64.cc
- M: gcc/config/aarch64/tuning_models/cortexx925.h
- M: gcc/config/aarch64/tuning_models/generic_armv9_a.h
- M: gcc/config/aarch64/tuning_models/hip12.h
- M: gcc/config/aarch64/tuning_models/neoverse512tvb.h
- M: gcc/config/aarch64/tuning_models/neoversen2.h
- M: gcc/config/aarch64/tuning_models/neoversen3.h
- M: gcc/config/aarch64/tuning_models/neoversev1.h
- M: gcc/config/aarch64/tuning_models/neoversev2.h
- M: gcc/config/aarch64/tuning_models/neoversev3.h
- M: gcc/config/aarch64/tuning_models/neoversev3ae.h
- M: gcc/config/aarch64/tuning_models/olympus.h

Saurabh Jha (2):
  aarch64: Add two new fields to the tuning models for vector
    comparisons
  aarch64: Change SVE2 comparison costs for Neoverse V3

 gcc/config/aarch64/aarch64-json-schema.h       |  4 +++-
 .../aarch64-json-tunings-parser-generated.inc  |  2 ++
 .../aarch64-json-tunings-printer-generated.inc |  2 ++
 gcc/config/aarch64/aarch64-protos.h            | 12 ++++++++++++
 gcc/config/aarch64/aarch64.cc                  | 18 +++++++++++++-----
 gcc/config/aarch64/tuning_models/cortexx925.h  |  2 ++
 .../aarch64/tuning_models/generic_armv9_a.h    |  2 ++
 gcc/config/aarch64/tuning_models/hip12.h       |  2 ++
 .../aarch64/tuning_models/neoverse512tvb.h     |  2 ++
 gcc/config/aarch64/tuning_models/neoversen2.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversen3.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev1.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev2.h  |  2 ++
 gcc/config/aarch64/tuning_models/neoversev3.h  |  2 ++
 .../aarch64/tuning_models/neoversev3ae.h       |  2 ++
 gcc/config/aarch64/tuning_models/olympus.h     |  2 ++
 16 files changed, 54 insertions(+), 6 deletions(-)

Range-diff against v1:
1:  da96c3737ff9c < -:  ------------- aarch64: Add two new fields to the tuning 
models for vector comparisons
2:  00c18357975db < -:  ------------- aarch64: Change SVE2 comparison costs for 
Neoverse V3
-:  ------------- > 1:  81efd7dc564cb aarch64: Add two new fields to the tuning 
models for vector comparisons
3:  6932bd8ae3877 ! 2:  2ce46be6fe7fb aarch64: Change register move costs for 
Neoverse V3
    @@ Metadata
     Author: Saurabh Jha <[email protected]>
     
      ## Commit message ##
    -    aarch64: Change register move costs for Neoverse V3
    +    aarch64: Change SVE2 comparison costs for Neoverse V3
     
    -    Currently, our register move costs are such that they are leading to
    -    spills of long lived variables on to the stack. Moreover, it is also
    -    leading to stack allocation for code paths where stack is not touched.
    +    Currently, we underestimate vector comparison costs for Neoverse V3.
    +    This leads to unnecessary vectorisation in cases where scalar code 
would
    +    have been more performant.
     
    -    This patch decreases the register move costs like this:
    -    * gp2gp: 3 -> 1.
    -    * gp2fp: 5 -> 3.
    -    * fp2gp: 4 -> 2.
    -    * fp2fp: 4 -> 2.
    -
    -    These changes lead to long lived variables being kept in registers and
    -    avoidance of stack allocation over paths which don't use stack, i.e.
    -    shrink wrapping.
    +    This patch increases the SVE int and fp comparison costs from 1 to 4,
    +    while keeping SVE comparison predication costs to 0.
     
         This change led to around 5% improvement in the execution time of SPEC
    -    2017 511.povray_r benchmark against current master while using the
    -    compiler options '-Ofast -mcpu=neoversev-v3' on Neoverse V3 core.
    +    2017 541.leela_r benchmark against current master while using the
    +    compiler options '-Ofast -mcpu=neoverse-v3' on a Neoverse V3 core.
     
         gcc/ChangeLog:
     
    -            * config/aarch64/tuning_models/neoversev3.h: Decrease register
    -            move costs by using generic_armv9_a_regmove_cost.
    +            * config/aarch64/tuning_models/neoversev3.h: Increase
    +            int_cmp_ops and fp_cmp_ops from 1 to 4.
     
      ## gcc/config/aarch64/tuning_models/neoversev3.h ##
    -@@
    - 
    - #include "generic.h"
    - 
    --static const struct cpu_regmove_cost neoversev3_regmove_cost =
    --{
    --  3, /* GP2GP  */
    --  /* Spilling to int<->fp instead of memory is recommended so set
    --     realistic costs compared to memmov_cost.  */
    --  5, /* GP2FP  */
    --  4, /* FP2GP  */
    --  4 /* FP2FP  */
    --};
    --
    - static const advsimd_vec_cost neoversev3_advsimd_vector_cost =
    - {
    -   2, /* int_stmt_cost  */
    -@@ gcc/config/aarch64/tuning_models/neoversev3.h: static const struct 
tune_params neoversev3_tunings =
    - {
    -   &cortexa76_extra_costs,
    -   &generic_armv9_a_addrcost_table,
    --  &neoversev3_regmove_cost,
    -+  &generic_armv9_a_regmove_cost,
    -   &neoversev3_vector_cost,
    -   &generic_branch_cost,
    -   &generic_approx_modes,
    +@@ gcc/config/aarch64/tuning_models/neoversev3.h: static const 
aarch64_sve_vec_issue_info neoversev3_sve_issue_info =
    +   },
    +   2, /* pred_ops_per_cycle  */
    +   1, /* while_pred_ops  */
    +-  1, /* int_cmp_ops  */
    ++  4, /* int_cmp_ops  */
    +   0, /* int_cmp_pred_ops  */
    +-  1, /* fp_cmp_ops  */
    ++  4, /* fp_cmp_ops  */
    +   0, /* fp_cmp_pred_ops  */
    +   1, /* gather_scatter_pair_general_ops  */
    +   1 /* gather_scatter_pair_pred_ops  */
-- 
2.56.0

Reply via email to