diff mbox series

[committed] CRIS-LRA: Define TARGET_SPILL_CLASS

Message ID 20230504004415.3F59E20438@pchp3.se.axis.com
State New
Headers show
Series [committed] CRIS-LRA: Define TARGET_SPILL_CLASS | expand

Commit Message

Hans-Peter Nilsson May 4, 2023, 12:44 a.m. UTC
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 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc
index 641e7ea25fb1..373b9999e0db 100644
--- a/gcc/config/cris/cris.cc
+++ b/gcc/config/cris/cris.cc
@@ -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);
@@ -224,6 +225,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
@@ -1684,6 +1688,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