Re: Is PRE architecture dependent? aarch64 vs x86_64

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

 



On 7/14/25 17:38, Segher Boessenkool wrote:
Oh!  Then you do not get PRE at all of course.

bool
pass_rtl_pre::gate (function *fun)
{
   return optimize > 0 && flag_gcse
     && !fun->calls_setjmp
     && optimize_function_for_speed_p (fun)
     && dbg_cnt (pre);
}

No -fgcse -> no PRE.

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.





[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