Commit 246fd41f by Jan Hubicka Committed by Jan Hubicka

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
parent eeae2112
Fro Nov 19 05:48:45 CET 1999 Jan Hubicka <hubicka@freesoft.cz>
* 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.
Sun Nov 21 17:11:13 1999 Geoffrey Keating <geoffk@cygnus.com> Sun Nov 21 17:11:13 1999 Geoffrey Keating <geoffk@cygnus.com>
* varasm.c (output_constructor): Solve problem with long long * varasm.c (output_constructor): Solve problem with long long
......
...@@ -696,6 +696,7 @@ static int loop_depth; ...@@ -696,6 +696,7 @@ static int loop_depth;
static int loop_cost; static int loop_cost;
static rtx scan_one_insn PROTO((rtx, int)); 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 *, static void record_reg_classes PROTO((int, int, rtx *, enum machine_mode *,
char *, const char **, rtx)); char *, const char **, rtx));
static int copy_cost PROTO((rtx, enum machine_mode, static int copy_cost PROTO((rtx, enum machine_mode,
...@@ -745,6 +746,28 @@ regclass_init () ...@@ -745,6 +746,28 @@ regclass_init ()
prefclass = 0; 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 /* 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. 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 PASS, when nonzero, inhibits some optimizations which need only be done
...@@ -951,9 +974,10 @@ scan_one_insn (insn, pass) ...@@ -951,9 +974,10 @@ scan_one_insn (insn, pass)
This pass comes just before local register allocation. */ This pass comes just before local register allocation. */
void void
regclass (f, nregs) regclass (f, nregs, dump)
rtx f; rtx f;
int nregs; int nregs;
FILE *dump;
{ {
register rtx insn; register rtx insn;
register int i; register int i;
...@@ -1109,6 +1133,8 @@ regclass (f, nregs) ...@@ -1109,6 +1133,8 @@ regclass (f, nregs)
} }
} }
if (dump)
dump_regclass (dump);
#ifdef FORBIDDEN_INC_DEC_CLASSES #ifdef FORBIDDEN_INC_DEC_CLASSES
free (in_inc_dec); free (in_inc_dec);
#endif #endif
......
...@@ -1571,7 +1571,7 @@ extern void init_regs PROTO ((void)); ...@@ -1571,7 +1571,7 @@ extern void init_regs PROTO ((void));
extern void init_reg_sets PROTO ((void)); extern void init_reg_sets PROTO ((void));
extern void regset_release_memory PROTO ((void)); extern void regset_release_memory PROTO ((void));
extern void regclass_init PROTO ((void)); extern void regclass_init PROTO ((void));
extern void regclass PROTO ((rtx, int)); extern void regclass PROTO ((rtx, int, FILE *));
extern void reg_scan PROTO ((rtx, int, int)); extern void reg_scan PROTO ((rtx, int, int));
extern void reg_scan_update PROTO ((rtx, rtx, int)); extern void reg_scan_update PROTO ((rtx, rtx, int));
extern void fix_register PROTO ((const char *, int, int)); extern void fix_register PROTO ((const char *, int, int));
......
...@@ -4032,7 +4032,7 @@ rest_of_compilation (decl) ...@@ -4032,7 +4032,7 @@ rest_of_compilation (decl)
{ {
TIMEVAR (flow_time, TIMEVAR (flow_time,
{ {
regclass (insns, max_reg_num ()); regclass (insns, max_reg_num (), NULL);
stupid_life_analysis (insns, max_reg_num (), stupid_life_analysis (insns, max_reg_num (),
rtl_dump_file); rtl_dump_file);
}); });
...@@ -4146,6 +4146,9 @@ rest_of_compilation (decl) ...@@ -4146,6 +4146,9 @@ rest_of_compilation (decl)
epilogue thus changing register elimination offsets. */ epilogue thus changing register elimination offsets. */
current_function_is_leaf = leaf_function_p (); current_function_is_leaf = leaf_function_p ();
if (local_reg_dump)
open_dump_file (".12.lreg", decl_printable_name (decl, 2));
/* Unless we did stupid register allocation, /* Unless we did stupid register allocation,
allocate pseudo-regs that are used only within 1 basic block. allocate pseudo-regs that are used only within 1 basic block.
...@@ -4159,7 +4162,7 @@ rest_of_compilation (decl) ...@@ -4159,7 +4162,7 @@ rest_of_compilation (decl)
of life info during sched. */ of life info during sched. */
if (! flag_schedule_insns) if (! flag_schedule_insns)
recompute_reg_usage (insns, ! optimize_size); recompute_reg_usage (insns, ! optimize_size);
regclass (insns, max_reg_num ()); regclass (insns, max_reg_num (), rtl_dump_file);
rebuild_label_notes_after_reload = local_alloc (); rebuild_label_notes_after_reload = local_alloc ();
}); });
else else
...@@ -4169,8 +4172,6 @@ rest_of_compilation (decl) ...@@ -4169,8 +4172,6 @@ rest_of_compilation (decl)
if (local_reg_dump) if (local_reg_dump)
{ {
open_dump_file (".12.lreg", decl_printable_name (decl, 2));
TIMEVAR (dump_time, dump_flow_info (rtl_dump_file)); TIMEVAR (dump_time, dump_flow_info (rtl_dump_file));
TIMEVAR (dump_time, dump_local_alloc (rtl_dump_file)); TIMEVAR (dump_time, dump_local_alloc (rtl_dump_file));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment