/* Graph coloring register allocator
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Matz <matz@suse.de>
and Daniel Berlin <dan@cgsoftware.com>.
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "function.h"
#include "output.h"
#include "except.h"
#include "ra.h"
+#include "insn-config.h"
+#include "reload.h"
/* This file is part of the graph coloring register allocator, and
contains the functions to change the insn stream. I.e. it adds
static int slot_member_p PARAMS ((struct rtx_list *, rtx));
static void insert_stores PARAMS ((bitmap));
static int spill_same_color_p PARAMS ((struct web *, struct web *));
-static int is_partly_live_1 PARAMS ((sbitmap, struct web *));
+static bool is_partly_live_1 PARAMS ((sbitmap, struct web *));
static void update_spill_colors PARAMS ((HARD_REG_SET *, struct web *, int));
static int spill_is_free PARAMS ((HARD_REG_SET *, struct web *));
static void emit_loads PARAMS ((struct rewrite_info *, int, rtx));
}
/* Given two rtx' S1 and S2, either being REGs or MEMs (or SUBREGs
- thereof), return non-zero, if they overlap. REGs and MEMs don't
+ thereof), return nonzero, if they overlap. REGs and MEMs don't
overlap, and if they are MEMs they must have an easy address
(plus (basereg) (const_inst x)), otherwise they overlap. */
if (uid < insn_df_max_uid)
{
unsigned int n;
- struct ra_insn_info info = insn_df[uid];
rtx following = NEXT_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++)
{
struct web *web = def2web[DF_REF_ID (info.defs[n])];
/* Given the set of live web IDs LIVE, returns nonzero, if any of WEBs
subwebs (or WEB itself) is live. */
-static int
+static bool
is_partly_live_1 (live, web)
sbitmap live;
struct web *web;
rewrite_program2 (new_deaths)
bitmap new_deaths;
{
- basic_block bb;
+ basic_block bb = NULL;
int nl_first_reload;
struct rewrite_info ri;
rtx insn;
sbitmap_zero (already_webs);
/* We need to recheck all uses of all webs involved in spilling (and the
uses added by spill insns, but those are not analyzed yet).
- Those are the spilled webs themself, webs coalesced to spilled ones,
+ Those are the spilled webs themselves, webs coalesced to spilled ones,
and webs conflicting with any of them. */
for (pass = 0; pass < 2; pass++)
for (d = (pass == 0) ? WEBS(SPILLED) : WEBS(COALESCED); d; d = d->next)
}
}
-/* Due to resons documented elsewhere we create different pseudos
+/* Due to reasons documented elsewhere we create different pseudos
for all webs coalesced to hardregs. For these parts life_analysis()
might have added REG_DEAD notes without considering, that only this part
but not the whole coalesced web dies. The RTL is correct, there is no
dump_cost (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, " loads =%d cost=" LU "\n", emitted_spill_loads,
- spill_load_cost);
- ra_debug_msg (level, " stores=%d cost=" LU "\n", emitted_spill_stores,
- spill_store_cost);
- ra_debug_msg (level, " remat =%d cost=" LU "\n", emitted_remat,
- spill_remat_cost);
- ra_debug_msg (level, " removed:\n");
- ra_debug_msg (level, " moves =%d cost=" LU "\n", deleted_move_insns,
- deleted_move_cost);
- ra_debug_msg (level, " others=%d cost=" LU "\n", deleted_def_insns,
- deleted_def_cost);
-#undef LU
+ ra_debug_msg (level, " loads =%d cost=", emitted_spill_loads);
+ ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_load_cost);
+ ra_debug_msg (level, "\n stores=%d cost=", emitted_spill_stores);
+ ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_store_cost);
+ ra_debug_msg (level, "\n remat =%d cost=", emitted_remat);
+ ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_remat_cost);
+ ra_debug_msg (level, "\n removed:\n moves =%d cost=", deleted_move_insns);
+ ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_move_cost);
+ ra_debug_msg (level, "\n others=%d cost=", deleted_def_insns);
+ ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_def_cost);
+ ra_debug_msg (level, "\n");
}
/* Initialization of the rewrite phase. */