> -----Original Message-----
> From: Alex Coplan <[email protected]>
> Sent: 06 May 2026 14:15
> To: Tamar Christina <[email protected]>
> Cc: [email protected]; nd <[email protected]>; Richard Earnshaw
> <[email protected]>; [email protected];
> [email protected]; Wilco Dijkstra
> <[email protected]>; Alice Carlotti <[email protected]>
> Subject: Re: [PATCH]AArch64: Turn on GPR narrowing pass by default
>
> On 06/05/2026 14:00, Tamar Christina wrote:
> > This turns on the GPR narrowing pass for all AArch64 targets.
>
> In principle this sounds good, although maybe it should go in after
> Soumya's fix for PR124895 to minimize noise for folks that are testing
> the trunk.
Sure, I'll wait for that fix to be committed.
>
> >
> > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
> >
> > Any objections?
> >
> > Thanks,
> > Tamar
> >
> > gcc/ChangeLog:
> >
> > * config/aarch64/aarch64-tuning-flags.def
> > (AARCH64_EXTRA_TUNE_BASE): Add
> AARCH64_EXTRA_TUNE_NARROW_GP_WRITES.
> >
> > ---
> > diff --git a/gcc/config/aarch64/aarch64-tuning-flags.def
> b/gcc/config/aarch64/aarch64-tuning-flags.def
> > index
> 882daa4b4312039f96dcde1295179be3ab3da0d0..058dadecccaac458e30a
> 6585b558581a7bef6f54 100644
> > --- a/gcc/config/aarch64/aarch64-tuning-flags.def
> > +++ b/gcc/config/aarch64/aarch64-tuning-flags.def
> > @@ -67,7 +67,8 @@ AARCH64_EXTRA_TUNING_OPTION
> ("cheap_fpmr_write", CHEAP_FPMR_WRITE)
> >
> > /* Baseline tuning settings suitable for all modern cores. */
> > #define AARCH64_EXTRA_TUNE_BASE
> (AARCH64_EXTRA_TUNE_CHEAP_SHIFT_EXTEND \
> > - |
> AARCH64_EXTRA_TUNE_FULLY_PIPELINED_FMA)
> > + |
> AARCH64_EXTRA_TUNE_FULLY_PIPELINED_FMA \
> > + |
> AARCH64_EXTRA_TUNE_NARROW_GP_WRITES)
>
> Doesn't this render the tuning flag obsolete? Presumably we could remove
> the flag entirely and instead just adjust the default to 1 for
> -mnarrow-gp-writes in aarch64.opt (simplifying the logic in
> pass_narrow_gp_writes::gate accordingly)?
I think we should remove `-mnarrow-gp-writes` entirely. With it on by default
It can be disabled with the pass manager's standard
-fdisable-rtl-narrow_gp_writes
so there's no need to the target option anymore.
This would also be more inline with other generic passes. Or do you see a
value in
having it?
>
> Or would you prefer to keep it so that the pass can be turned off for
> particular cores if required / to minimize churn in case a reversion is
> needed?
>
I wanted to keep a way to disable it since I don't know if it'll do anything
weird on partner cores. So I think I'd like the tune for now, but when/if
this moves to a middle-end pass to drop it.
So I'll respin dropping the `-m` flag if you agree.
Thanks,
Tamar
> Thanks,
> Alex
>
> >
> > /* Enables dispatch scheduling. */
> > AARCH64_EXTRA_TUNING_OPTION ("dispatch_sched", DISPATCH_SCHED)
> >
> >
> > --
>
> > diff --git a/gcc/config/aarch64/aarch64-tuning-flags.def
> b/gcc/config/aarch64/aarch64-tuning-flags.def
> > index
> 882daa4b4312039f96dcde1295179be3ab3da0d0..058dadecccaac458e30a
> 6585b558581a7bef6f54 100644
> > --- a/gcc/config/aarch64/aarch64-tuning-flags.def
> > +++ b/gcc/config/aarch64/aarch64-tuning-flags.def
> > @@ -67,7 +67,8 @@ AARCH64_EXTRA_TUNING_OPTION
> ("cheap_fpmr_write", CHEAP_FPMR_WRITE)
> >
> > /* Baseline tuning settings suitable for all modern cores. */
> > #define AARCH64_EXTRA_TUNE_BASE
> (AARCH64_EXTRA_TUNE_CHEAP_SHIFT_EXTEND \
> > - |
> AARCH64_EXTRA_TUNE_FULLY_PIPELINED_FMA)
> > + |
> AARCH64_EXTRA_TUNE_FULLY_PIPELINED_FMA \
> > + |
> AARCH64_EXTRA_TUNE_NARROW_GP_WRITES)
> >
> > /* Enables dispatch scheduling. */
> > AARCH64_EXTRA_TUNING_OPTION ("dispatch_sched", DISPATCH_SCHED)
> >