On Thu, Jul 17, 2025 at 7:39 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, this pass could get expensive if you have a large number of 
> > basic blocks
> > and the hard register was never alive so it does nothing in the end.
> > In the aarch64 case, FPM_REGNUM is only used for FP8 related code so it has 
> > a high probability
> > of not being used. So skipping the pass for that register can improve both 
> > compile time and memory
> > usage.
> >
> > Build and tested for aarch64-linux-gnu.
> >
> >       PR middle-end/PR121095
> > gcc/ChangeLog:
> >
> >       * gcse.cc (execute_hardreg_pre): Skip if the hardreg is never alive.
> >
> > Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>
> > ---
> >  gcc/gcse.cc | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/gcc/gcse.cc b/gcc/gcse.cc
> > index 96aae0e1718..6eddffcdba8 100644
> > --- a/gcc/gcse.cc
> > +++ b/gcc/gcse.cc
> > @@ -4238,8 +4238,15 @@ execute_hardreg_pre (void)
> >      {
> >        int changed;
> >        current_hardreg_regno = regnos[i];
> > +      if (!df_regs_ever_live_p (current_hardreg_regno))
> > +     {
> > +       if (dump_file)
> > +         fprintf (dump_file, "Skipping hardreg PRE for regno %d never 
> > alive\n",
>
> How about: "Skipping hardreg PRE for regno %d, which is never live\n"
>
> OK with that change, thanks.

Attached is what I pushed in the end, I changed the commit message to
use never live instead of never alive and fixed the summary and PR
line because I had PR in there twice.

Thanks,
Andrew

>
> Richard
>
> > +                 current_hardreg_regno);
> > +       continue;
> > +     }
> >        if (dump_file)
> > -     fprintf(dump_file, "Entering hardreg PRE for regno %d\n",
> > +     fprintf (dump_file, "Entering hardreg PRE for regno %d\n",
> >               current_hardreg_regno);
> >        delete_unreachable_blocks ();
> >        df_analyze ();

Attachment: 0001-gcse-Skip-hardreg-pre-when-the-hardreg-is-never-live.patch
Description: Binary data

Reply via email to