https://gcc.gnu.org/g:a208de2ff4168214de996076f83dc2269b90883b

commit r17-6339-ga208de2ff4168214de996076f83dc2269b90883b
Author: Saurabh Jha <[email protected]>
Date:   Fri Oct 30 12:58:24 2026 +0000

    aarch64: Change register move 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.
    
    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 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.
    
    gcc/ChangeLog:
    
            * config/aarch64/tuning_models/neoversev3.h: Decrease register
            move costs by using generic_armv9_a_regmove_cost.

Diff:
---
 gcc/config/aarch64/tuning_models/neoversev3.h | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/gcc/config/aarch64/tuning_models/neoversev3.h 
b/gcc/config/aarch64/tuning_models/neoversev3.h
index 7e0144032dc6..8d31c58f70d8 100644
--- a/gcc/config/aarch64/tuning_models/neoversev3.h
+++ b/gcc/config/aarch64/tuning_models/neoversev3.h
@@ -22,16 +22,6 @@
 
 #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  */
@@ -192,7 +182,7 @@ 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,

Reply via email to