]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
CRIS-LRA: Define TARGET_SPILL_CLASS
authorHans-Peter Nilsson <hp@axis.com>
Sat, 18 Feb 2023 04:19:21 +0000 (05:19 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Thu, 4 May 2023 00:43:26 +0000 (02:43 +0200)
This has no effect on arith-rand-ll (which suffers badly from LRA) and
marginal effects (0.01% improvement) on coremark, but the size of
coremark shrinks by 0.2%.  An earlier version was tested with a tree
around 2023-03 which showed (marginally) that ALL_REGS is preferable
to GENERAL_REGS.

* config/cris/cris.cc (TARGET_SPILL_CLASS): Define
to ALL_REGS.

gcc/config/cris/cris.cc

index 3013e01f22ace8e138e15a4b76bbc07acb2bf023..496a1a0fe91a9994c776508a779541b13448a405 100644 (file)
@@ -134,6 +134,7 @@ static void cris_init_libfuncs (void);
 static unsigned int cris_postdbr_cmpelim (void);
 
 static reg_class_t cris_preferred_reload_class (rtx, reg_class_t);
+static reg_class_t cris_spill_class (reg_class_t, machine_mode);
 
 static int cris_register_move_cost (machine_mode, reg_class_t, reg_class_t);
 static int cris_memory_move_cost (machine_mode, reg_class_t, bool);
@@ -221,6 +222,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 #undef TARGET_PREFERRED_RELOAD_CLASS
 #define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class
 
+#undef TARGET_SPILL_CLASS
+#define TARGET_SPILL_CLASS cris_spill_class
+
 /* We don't define TARGET_FIXED_CONDITION_CODE_REGS, as at the time of
    this writing, it has an effect only on pre-reload CSE and when
    scheduling (and for "macro fusion" at that).  Neither applies for
@@ -1681,6 +1685,14 @@ cris_preferred_reload_class (rtx x, reg_class_t rclass)
   return rclass;
 }
 
+/* Worker function for TARGET_SPILL_CLASS.  */
+
+static reg_class_t
+cris_spill_class (reg_class_t /* orig_class */, machine_mode)
+{
+  return ALL_REGS;
+}
+
 /* Worker function for TARGET_REGISTER_MOVE_COST.  */
 
 static int