On Wed, Jul 16, 2025 at 6:00 AM Richard Sandiford
<richard.sandif...@arm.com> wrote:
>
> Andrew Pinski <quic_apin...@quicinc.com> writes:
> > r15-6789-ge7f98d9603808b added a new RTL pass for hardreg PRE for the hard 
> > register
> > of FPM_REGNUM, but this pass does nothing if there can be any FPM_REGNUM 
> > register in it.
> > So let's set HARDREG_PRE_REGNOS to include all zeros if !TARGET_FP8.
> > Now the pass will only run if there is a possibility of having the FPM 
> > register.
>
> Could we get most of the benefit by instead adding:
>
>   if (!df_regs_ever_live_p (current_hardreg_regno))
>     continue;
>
> to the pass loop?  I think we could do it even before df_analyze given
> the optimize > 0 gate.
>
> If so, we'd also get the benefit for TARGET_FP8 in functions that don't
> use FP8 intrinsics.

Yes that works. I will submit a new patch after the full testing is completed.

Thanks,
Andrew

>
> Thanks,
> Richard
>
> > Built and tested for aarch64-linux-gnu.
> >
> >       PR target/121095
> > gcc/ChangeLog:
> >
> >       * config/aarch64/aarch64.h (HARDREG_PRE_REGNOS): Don't include 
> > FPM_REGNUM
> >       if !TARGET_FP8.
> >
> > Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> > ---
> >  gcc/config/aarch64/aarch64.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
> > index 096c853af7f..d128ed726f0 100644
> > --- a/gcc/config/aarch64/aarch64.h
> > +++ b/gcc/config/aarch64/aarch64.h
> > @@ -1661,8 +1661,8 @@ enum class aarch64_tristate_mode : int { NO, YES, 
> > MAYBE };
> >      int (aarch64_local_sme_state::ANY) }
> >
> >  /* Zero terminated list of regnos for which hardreg PRE should be
> > -   applied.  */
> > -#define HARDREG_PRE_REGNOS { FPM_REGNUM, 0 }
> > +   applied.  Only enable FPM reg if FP8 is enabled. */
> > +#define HARDREG_PRE_REGNOS { TARGET_FP8 ? FPM_REGNUM : 0, 0 }
> >
> >  #endif

Reply via email to