https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129211

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-12-01
     Ever confirmed|0                           |1

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Drea Pinski from comment #2)
> (In reply to Drea Pinski from comment #1)
> > From the way I understand it, this is a target hook issue.
> 
> As shown by aarch64 code generation:

the hook is TARGET_SCHED_REASSOCIATION_WIDTH where the aarch64 is defined as:
```
/* Return the reassociation width of treeop OPC with mode MODE.  */
static int
aarch64_reassociation_width (tree_code opc, machine_mode mode)
{
  if (VECTOR_MODE_P (mode))
    return aarch64_tune_params.vec_reassoc_width;
  if (INTEGRAL_MODE_P (mode))
    return aarch64_tune_params.int_reassoc_width;
  /* Reassociation reduces the number of FMAs which may result in worse
     performance.  Use a per-CPU setting for FMA reassociation which allows
     narrow CPUs with few FP pipes to switch it off (value of 1), and wider
     CPUs with many FP pipes to enable reassociation.
     Since the reassociation pass doesn't understand FMA at all, assume
     that any FP addition might turn into FMA.  */
  if (FLOAT_MODE_P (mode))
    return opc == PLUS_EXPR ? aarch64_tune_params.fma_reassoc_width
                            : aarch64_tune_params.fp_reassoc_width;
  return 1;
}
```

int_reassoc_width is at least 2, sometimes 3 or 4 or 8.

The generic one (default) is 2.

Reply via email to