aboutsummaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@freesoft.cz>1999-11-21 12:33:17 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>1999-11-21 12:33:17 +0000
commit246fd41f2d73a1ded9b7b1fd5d9c6ea7d5d82a11 (patch)
treefaad37a97de1c3583de42c43a416e945058c536d /gcc/regclass.c
parenteeae2112fae80a54aedef36282238a548d3fcf08 (diff)
downloadgcc-246fd41f2d73a1ded9b7b1fd5d9c6ea7d5d82a11.zip
gcc-246fd41f2d73a1ded9b7b1fd5d9c6ea7d5d82a11.tar.gz
gcc-246fd41f2d73a1ded9b7b1fd5d9c6ea7d5d82a11.tar.bz2
regclass.c (dump_regclass): New function.
* regclass.c (dump_regclass): New function. (regclass): New parameter DUMP, call DUMP_REGCLASS. * toplev.c (rest_of_compilation): Opent lreg dump file before regclass, pass rtl_dump_file to regclass. * rtl.h (regclass): Update prototype. From-SVN: r30600
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index d495fdc..f14433c 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -696,6 +696,7 @@ static int loop_depth;
static int loop_cost;
static rtx scan_one_insn PROTO((rtx, int));
+static void dump_regclass PROTO((FILE *));
static void record_reg_classes PROTO((int, int, rtx *, enum machine_mode *,
char *, const char **, rtx));
static int copy_cost PROTO((rtx, enum machine_mode,
@@ -745,6 +746,28 @@ regclass_init ()
prefclass = 0;
}
+/* Dump register costs. */
+void
+dump_regclass (dump)
+ FILE *dump;
+{
+ static const char *const reg_class_names[] = REG_CLASS_NAMES;
+ int i;
+ for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
+ {
+ enum reg_class class;
+ if (REG_N_REFS (i))
+ {
+ fprintf (dump, ";; Register %i costs:", i);
+ for (class = 0; class < N_REG_CLASSES; class++)
+ fprintf (dump, " %s:%i", reg_class_names[(int) class],
+ costs[i].cost[class]);
+ fprintf (dump, " MEM:%i\n\n", costs[i].mem_cost);
+ }
+ }
+}
+
+
/* Subroutine of regclass, processes one insn INSN. Scan it and record each
time it would save code to put a certain register in a certain class.
PASS, when nonzero, inhibits some optimizations which need only be done
@@ -951,9 +974,10 @@ scan_one_insn (insn, pass)
This pass comes just before local register allocation. */
void
-regclass (f, nregs)
+regclass (f, nregs, dump)
rtx f;
int nregs;
+ FILE *dump;
{
register rtx insn;
register int i;
@@ -1109,6 +1133,8 @@ regclass (f, nregs)
}
}
+ if (dump)
+ dump_regclass (dump);
#ifdef FORBIDDEN_INC_DEC_CLASSES
free (in_inc_dec);
#endif