Re: Is PRE architecture dependent? aarch64 vs x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Jul 14, 2025, at 6:11 PM, Bradley J Lucier <lucier@xxxxxxxxxx> wrote:
> 
> I also found
> 
> static unsigned int
> execute_hardreg_pre (void)
> {
> #ifdef HARDREG_PRE_REGNOS
>  doing_hardreg_pre_p = true;
>  unsigned int regnos[] = HARDREG_PRE_REGNOS;
>  /* It's possible to avoid this loop, but it isn't worth doing so until
>     hardreg PRE is used for multiple hardregs.  */
>  for (int i = 0; regnos[i] != 0; i++)
>    {
>      int changed;
>      current_hardreg_regno = regnos[i];
>      if (dump_file)
>        fprintf(dump_file, "Entering hardreg PRE for regno %d\n",
>                current_hardreg_regno);
>      delete_unreachable_blocks ();
>      df_analyze ();
>      changed = one_pre_gcse_pass ();
>      if (changed)
>        cleanup_cfg (0);
>    }
>  doing_hardreg_pre_p = false;
> #endif
>  return 0;
> }
> ...
> bool
> pass_hardreg_pre::gate (function * ARG_UNUSED (fun))
> {
> #ifdef HARDREG_PRE_REGNOS
>  return optimize > 0
>    && !fun->calls_setjmp;
> #else
>  return false;
> #endif
> }
> 
> and
> 
> heine:~/programs/gcc/gcc-mainline/gcc> grep -R HARDREG_PRE_REGNOS config
> config/aarch64/aarch64.h:#define HARDREG_PRE_REGNOS { FPM_REGNUM, 0 }
> 
> so aarch64 seems to be the only architecture that defines HARDREG_PRE_REGNOS.

This is all very interesting, and leads to more questions.

I looked at a sample dump file and what seems to be the summary statistics for the largest routine were
====================
;; Function ___H___num (___H___num, funcdef_no=66, decl_uid=11088, cgraph_uid=524, symbol_order=523)

Entering hardreg PRE for regno 84
starting the processing of deferred insns
ending the processing of deferred insns
df_analyze called
df_worklist_dataflow_doublequeue: n_basic_blocks 31567 n_edges 51599 count 31791 (    1)
Expression hash table (54357 buckets, 0 entries)

PRE GCSE of ___H___num, 31567 basic blocks, 2524104 bytes needed, 0 substs, 0 insns created
starting the processing of deferred insns
ending the processing of deferred insns 
====================

Does this mean that the hardreg_pre pass didn’t actually change anything (“0 substs, 0 insns created”)?

It appears from Arm’s documentation that FPM_REGNUM controls certain properties of FP8 operations.  Does this pass need to be run if (as in my case) the routine uses no FP8 instructions?

Thanks.

Brad




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux