restore performance for -fnew-ra
Michael Matz
matz@suse.de
Thu Aug 22 08:03:00 GMT 2002
Hi,
this patch goes back to using ALL_REGS as possible hardregs for holding
spilled values. Except on x86, where it's basically ALL_REGS \minus
MMX_REG. For this I added a SPILL_REGS define, which ports can override.
The underlying mechanism will be replaced for the next version of GCC, so
this will go away then. That's why I didn't bother documenting that
define in the texinfo, and also why I didn't add it to defaults.h. Should
I nevertheless?
It survived bootstrap and regression tests (also with activated new
allocator).
Ciao,
Michael.
--
* i386/i386.h (SPILL_REGS): Define.
* ra-build.c (SPILL_REGS): Define if undefined.
(remember_web_was_spilled): Use it.
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.280
diff -u -p -r1.280 i386.h
--- config/i386/i386.h 31 Jul 2002 23:18:43 -0000 1.280
+++ config/i386/i386.h 22 Aug 2002 14:35:48 -0000
@@ -1178,6 +1178,7 @@ enum reg_class
};
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
+#define SPILL_REGS FLOAT_INT_SSE_REGS
#define INTEGER_CLASS_P(CLASS) \
reg_class_subset_p ((CLASS), GENERAL_REGS)
Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.7
diff -u -p -r1.7 ra-build.c
--- ra-build.c 14 Aug 2002 03:09:14 -0000 1.7
+++ ra-build.c 22 Aug 2002 14:35:48 -0000
@@ -121,6 +121,12 @@ static void init_bb_info PARAMS ((void))
static void free_bb_info PARAMS ((void));
static void build_web_parts_and_conflicts PARAMS ((struct df *));
+/* SPILL_REGS is a reg class of those register which can possibly
+ be used to load values for spilled webs (i.e. registers which are
+ allocated to the small webs in which a spilled web is split). */
+#ifndef SPILL_REGS
+#define SPILL_REGS ALL_REGS
+#endif
/* A sbitmap of DF_REF_IDs of uses, which are live over an abnormal
edge. */
@@ -2358,7 +2364,7 @@ remember_web_was_spilled (web)
}
else
COPY_HARD_REG_SET (web->usable_regs,
- reg_class_contents[(int) GENERAL_REGS]);
+ reg_class_contents[(int) SPILL_REGS]);
AND_COMPL_HARD_REG_SET (web->usable_regs, never_use_colors);
prune_hardregs_for_mode (&web->usable_regs, PSEUDO_REGNO_MODE (web->regno));
#ifdef CLASS_CANNOT_CHANGE_MODE
More information about the Gcc-patches
mailing list