Commit 533c4863 by Kaveh R. Ghazi Committed by Kaveh Ghazi

ra-build.c (check_conflict_numbers): Hide unused function.

	* ra-build.c (check_conflict_numbers): Hide unused function.
	(livethrough_conflicts_bb): Avoid automatic aggregate
	initialization.
	(parts_to_webs_1): Avoid `U' integer constant modifier.
	(conflicts_between_webs): Wrap a variable in the macro controlling
	its usage.
	* ra-debug.c (ra_debug_msg): Use VA_OPEN/VA_CLOSE.
	(dump_igraph, dump_graph_cost): Avoid string concatenation
	(dump_static_insn_cost): Avoid automatic aggregate
	initialization.
	* ra-rewrite.c (insert_stores): Avoid automatic aggregate
	initialization.
	(dump_cost): Avoid string concatenation

From-SVN: r55637
parent 8943a0b4
2002-07-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ra-build.c (check_conflict_numbers): Hide unused function.
(livethrough_conflicts_bb): Avoid automatic aggregate
initialization.
(parts_to_webs_1): Avoid `U' integer constant modifier.
(conflicts_between_webs): Wrap a variable in the macro controlling
its usage.
* ra-debug.c (ra_debug_msg): Use VA_OPEN/VA_CLOSE.
(dump_igraph, dump_graph_cost): Avoid string concatenation
(dump_static_insn_cost): Avoid automatic aggregate
initialization.
* ra-rewrite.c (insert_stores): Avoid automatic aggregate
initialization.
(dump_cost): Avoid string concatenation
2002-07-21 Richard Henderson <rth@redhat.com> 2002-07-21 Richard Henderson <rth@redhat.com>
* expr.c (expand_expr) [TRY_FINALLY_EXPR]: Don't use * expr.c (expand_expr) [TRY_FINALLY_EXPR]: Don't use
......
...@@ -101,7 +101,9 @@ static unsigned int parts_to_webs_1 PARAMS ((struct df *, struct web_link **, ...@@ -101,7 +101,9 @@ static unsigned int parts_to_webs_1 PARAMS ((struct df *, struct web_link **,
struct df_link *)); struct df_link *));
static void parts_to_webs PARAMS ((struct df *)); static void parts_to_webs PARAMS ((struct df *));
static void reset_conflicts PARAMS ((void)); static void reset_conflicts PARAMS ((void));
#if 0
static void check_conflict_numbers PARAMS ((void)); static void check_conflict_numbers PARAMS ((void));
#endif
static void conflicts_between_webs PARAMS ((struct df *)); static void conflicts_between_webs PARAMS ((struct df *));
static void remember_web_was_spilled PARAMS ((struct web *)); static void remember_web_was_spilled PARAMS ((struct web *));
static void detect_spill_temps PARAMS ((void)); static void detect_spill_temps PARAMS ((void));
...@@ -1069,8 +1071,10 @@ livethrough_conflicts_bb (bb) ...@@ -1069,8 +1071,10 @@ livethrough_conflicts_bb (bb)
{ {
if (INSN_P (insn)) if (INSN_P (insn))
{ {
struct ra_insn_info info = insn_df[INSN_UID (insn)];
unsigned int n; unsigned int n;
struct ra_insn_info info;
info = insn_df[INSN_UID (insn)];
for (n = 0; n < info.num_defs; n++) for (n = 0; n < info.num_defs; n++)
bitmap_set_bit (all_defs, DF_REF_ID (info.defs[n])); bitmap_set_bit (all_defs, DF_REF_ID (info.defs[n]));
if (TEST_BIT (insns_with_deaths, INSN_UID (insn))) if (TEST_BIT (insns_with_deaths, INSN_UID (insn)))
...@@ -1826,7 +1830,7 @@ parts_to_webs_1 (df, copy_webs, all_refs) ...@@ -1826,7 +1830,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
if (! wp->uplink) if (! wp->uplink)
{ {
/* If we have a web part root, create a new web. */ /* If we have a web part root, create a new web. */
unsigned int newid = ~0U; unsigned int newid = ~(unsigned)0;
unsigned int old_web = 0; unsigned int old_web = 0;
/* In the first pass, there are no old webs, so unconditionally /* In the first pass, there are no old webs, so unconditionally
...@@ -1871,7 +1875,7 @@ parts_to_webs_1 (df, copy_webs, all_refs) ...@@ -1871,7 +1875,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
} }
} }
/* The id is zeroed in init_one_web(). */ /* The id is zeroed in init_one_web(). */
if (newid == ~0U) if (newid == ~(unsigned)0)
newid = web->id; newid = web->id;
if (old_web) if (old_web)
reinit_one_web (web, GET_CODE (reg) == SUBREG reinit_one_web (web, GET_CODE (reg) == SUBREG
...@@ -2188,6 +2192,7 @@ reset_conflicts () ...@@ -2188,6 +2192,7 @@ reset_conflicts ()
/* For each web check it's num_conflicts member against that /* For each web check it's num_conflicts member against that
number, as calculated from scratch from all neighbors. */ number, as calculated from scratch from all neighbors. */
#if 0
static void static void
check_conflict_numbers () check_conflict_numbers ()
{ {
...@@ -2204,6 +2209,7 @@ check_conflict_numbers () ...@@ -2204,6 +2209,7 @@ check_conflict_numbers ()
abort (); abort ();
} }
} }
#endif
/* Convert the conflicts between web parts to conflicts between full webs. /* Convert the conflicts between web parts to conflicts between full webs.
...@@ -2223,7 +2229,9 @@ conflicts_between_webs (df) ...@@ -2223,7 +2229,9 @@ conflicts_between_webs (df)
struct df *df; struct df *df;
{ {
unsigned int i; unsigned int i;
#ifdef STACK_REGS
struct dlist *d; struct dlist *d;
#endif
bitmap ignore_defs = BITMAP_XMALLOC (); bitmap ignore_defs = BITMAP_XMALLOC ();
unsigned int have_ignored; unsigned int have_ignored;
unsigned int *pass_cache = (unsigned int *) xcalloc (num_webs, sizeof (int)); unsigned int *pass_cache = (unsigned int *) xcalloc (num_webs, sizeof (int));
......
...@@ -47,22 +47,12 @@ static const char *const reg_class_names[] = REG_CLASS_NAMES; ...@@ -47,22 +47,12 @@ static const char *const reg_class_names[] = REG_CLASS_NAMES;
void void
ra_debug_msg VPARAMS ((unsigned int level, const char *format, ...)) ra_debug_msg VPARAMS ((unsigned int level, const char *format, ...))
{ {
#ifndef ANSI_PROTOTYPES VA_OPEN (ap, format);
int level; VA_FIXEDARG (ap, unsigned int, level);
const char *format; VA_FIXEDARG (ap, const char *, format);
#endif
va_list ap;
if ((debug_new_regalloc & level) != 0 && rtl_dump_file != NULL) if ((debug_new_regalloc & level) != 0 && rtl_dump_file != NULL)
{ vfprintf (rtl_dump_file, format, ap);
VA_START (ap, format); VA_CLOSE (ap);
#ifndef ANSI_PROTOTYPES
format = va_arg (ap, const char *);
#endif
vfprintf (rtl_dump_file, format, ap);
va_end (ap);
}
} }
...@@ -720,10 +710,10 @@ dump_igraph (df) ...@@ -720,10 +710,10 @@ dump_igraph (df)
ra_debug_msg (DUMP_WEBS, " sub %d", SUBREG_BYTE (web->orig_x)); ra_debug_msg (DUMP_WEBS, " sub %d", SUBREG_BYTE (web->orig_x));
ra_debug_msg (DUMP_WEBS, " par %d", find_web_for_subweb (web)->id); ra_debug_msg (DUMP_WEBS, " par %d", find_web_for_subweb (web)->id);
} }
ra_debug_msg (DUMP_WEBS, " +%d (span %d, cost " ra_debug_msg (DUMP_WEBS, " +%d (span %d, cost ",
HOST_WIDE_INT_PRINT_DEC ") (%s)", web->add_hardregs, web->span_deaths);
web->add_hardregs, web->span_deaths, web->spill_cost, ra_debug_msg (DUMP_WEBS, HOST_WIDE_INT_PRINT_DEC, web->spill_cost);
reg_class_names[web->regclass]); ra_debug_msg (DUMP_WEBS, ") (%s)", reg_class_names[web->regclass]);
if (web->spill_temp == 1) if (web->spill_temp == 1)
ra_debug_msg (DUMP_WEBS, " (spilltemp)"); ra_debug_msg (DUMP_WEBS, " (spilltemp)");
else if (web->spill_temp == 2) else if (web->spill_temp == 2)
...@@ -866,7 +856,6 @@ dump_graph_cost (level, msg) ...@@ -866,7 +856,6 @@ dump_graph_cost (level, msg)
{ {
unsigned int i; unsigned int i;
unsigned HOST_WIDE_INT cost; unsigned HOST_WIDE_INT cost;
#define LU HOST_WIDE_INT_PRINT_UNSIGNED
if (!rtl_dump_file || (debug_new_regalloc & level) == 0) if (!rtl_dump_file || (debug_new_regalloc & level) == 0)
return; return;
...@@ -877,9 +866,9 @@ dump_graph_cost (level, msg) ...@@ -877,9 +866,9 @@ dump_graph_cost (level, msg)
if (alias (web)->type == SPILLED) if (alias (web)->type == SPILLED)
cost += web->orig_spill_cost; cost += web->orig_spill_cost;
} }
ra_debug_msg (level, " spill cost of graph (%s) = " LU "\n", ra_debug_msg (level, " spill cost of graph (%s) = ", msg ? msg : "");
msg ? msg : "", cost); ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, cost);
#undef LU ra_debug_msg (level, "\n");
} }
/* Dump the color assignment per web, the coalesced and spilled webs. */ /* Dump the color assignment per web, the coalesced and spilled webs. */
...@@ -930,12 +919,13 @@ dump_static_insn_cost (file, message, prefix) ...@@ -930,12 +919,13 @@ dump_static_insn_cost (file, message, prefix)
unsigned HOST_WIDE_INT cost; unsigned HOST_WIDE_INT cost;
unsigned int count; unsigned int count;
}; };
struct cost load = {0, 0};
struct cost store = {0, 0};
struct cost regcopy = {0, 0};
struct cost selfcopy = {0, 0};
struct cost overall = {0, 0};
basic_block bb; basic_block bb;
struct cost load, store, regcopy, selfcopy, overall;
memset (&load, 0, sizeof(load));
memset (&store, 0, sizeof(store));
memset (&regcopy, 0, sizeof(regcopy));
memset (&selfcopy, 0, sizeof(selfcopy));
memset (&overall, 0, sizeof(overall));
if (!file) if (!file)
return; return;
......
...@@ -666,9 +666,11 @@ insert_stores (new_deaths) ...@@ -666,9 +666,11 @@ insert_stores (new_deaths)
if (uid < insn_df_max_uid) if (uid < insn_df_max_uid)
{ {
unsigned int n; unsigned int n;
struct ra_insn_info info = insn_df[uid];
rtx following = NEXT_INSN (insn); rtx following = NEXT_INSN (insn);
basic_block bb = BLOCK_FOR_INSN (insn); basic_block bb = BLOCK_FOR_INSN (insn);
struct ra_insn_info info;
info = insn_df[uid];
for (n = 0; n < info.num_defs; n++) for (n = 0; n < info.num_defs; n++)
{ {
struct web *web = def2web[DF_REF_ID (info.defs[n])]; struct web *web = def2web[DF_REF_ID (info.defs[n])];
...@@ -1949,20 +1951,18 @@ void ...@@ -1949,20 +1951,18 @@ void
dump_cost (level) dump_cost (level)
unsigned int level; unsigned int level;
{ {
#define LU HOST_WIDE_INT_PRINT_UNSIGNED
ra_debug_msg (level, "Instructions for spilling\n added:\n"); ra_debug_msg (level, "Instructions for spilling\n added:\n");
ra_debug_msg (level, " loads =%d cost=" LU "\n", emitted_spill_loads, ra_debug_msg (level, " loads =%d cost=", emitted_spill_loads);
spill_load_cost); ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_load_cost);
ra_debug_msg (level, " stores=%d cost=" LU "\n", emitted_spill_stores, ra_debug_msg (level, "\n stores=%d cost=", emitted_spill_stores);
spill_store_cost); ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_store_cost);
ra_debug_msg (level, " remat =%d cost=" LU "\n", emitted_remat, ra_debug_msg (level, "\n remat =%d cost=", emitted_remat);
spill_remat_cost); ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_remat_cost);
ra_debug_msg (level, " removed:\n"); ra_debug_msg (level, "\n removed:\n moves =%d cost=", deleted_move_insns);
ra_debug_msg (level, " moves =%d cost=" LU "\n", deleted_move_insns, ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_move_cost);
deleted_move_cost); ra_debug_msg (level, "\n others=%d cost=", deleted_def_insns);
ra_debug_msg (level, " others=%d cost=" LU "\n", deleted_def_insns, ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_def_cost);
deleted_def_cost); ra_debug_msg (level, "\n");
#undef LU
} }
/* Initialization of the rewrite phase. */ /* Initialization of the rewrite phase. */
......
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