/* Graph coloring register allocator
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Matz <matz@suse.de>
and Daniel Berlin <dan@cgsoftware.com>.
&& HARD_REGNO_MODE_OK (c, PSEUDO_REGNO_MODE (web->regno)))
{
int i, size;
- size = HARD_REGNO_NREGS (c, PSEUDO_REGNO_MODE (web->regno));
+ size = hard_regno_nregs[c][PSEUDO_REGNO_MODE (web->regno)];
for (i = 1; i < size
&& TEST_HARD_REG_BIT (avail, c + i); i++);
if (i == size)
end_sequence ();
emit_insn_before (insns, insn);
- if (bb->head == insn)
- bb->head = NEXT_INSN (prev);
+ if (BB_HEAD (bb) == insn)
+ BB_HEAD (bb) = NEXT_INSN (prev);
for (insn = PREV_INSN (insn); insn != prev;
insn = PREV_INSN (insn))
{
if (insns)
{
emit_insn_after (insns, insn);
- if (bb->end == insn)
- bb->end = PREV_INSN (following);
+ if (BB_END (bb) == insn)
+ BB_END (bb) = PREV_INSN (following);
for (insn = insns; insn != following; insn = NEXT_INSN (insn))
{
set_block_for_insn (insn, bb);
if (GET_CODE (s1) != GET_CODE (s2))
return 0;
- if (GET_CODE (s1) == REG && GET_CODE (s2) == REG)
+ if (REG_P (s1) && REG_P (s2))
{
if (REGNO (s1) != REGNO (s2))
return 0;
return 0;
return 1;
}
- if (GET_CODE (s1) != MEM || GET_CODE (s2) != MEM)
+ if (!MEM_P (s1) || GET_CODE (s2) != MEM)
abort ();
s1 = XEXP (s1, 0);
s2 = XEXP (s2, 0);
- if (GET_CODE (s1) != PLUS || GET_CODE (XEXP (s1, 0)) != REG
+ if (GET_CODE (s1) != PLUS || !REG_P (XEXP (s1, 0))
|| GET_CODE (XEXP (s1, 1)) != CONST_INT)
return 1;
- if (GET_CODE (s2) != PLUS || GET_CODE (XEXP (s2, 0)) != REG
+ if (GET_CODE (s2) != PLUS || !REG_P (XEXP (s2, 0))
|| GET_CODE (XEXP (s2, 1)) != CONST_INT)
return 1;
base1 = XEXP (s1, 0);
/* If we reach a basic block border, which has more than one
outgoing edge, we simply forget all already emitted stores. */
- if (GET_CODE (insn) == BARRIER
+ if (BARRIER_P (insn)
|| JUMP_P (insn) || can_throw_internal (insn))
{
last_slot = NULL_RTX;
if (insns)
{
emit_insn_after (insns, insn);
- if (bb->end == insn)
- bb->end = PREV_INSN (following);
+ if (BB_END (bb) == insn)
+ BB_END (bb) = PREV_INSN (following);
for (ni = insns; ni != following; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
slots = NULL;
else
{
- if (1 || GET_CODE (SET_SRC (set)) == MEM)
+ if (1 || MEM_P (SET_SRC (set)))
delete_overlapping_slots (&slots, SET_SRC (set));
}
}
return 0;
size1 = web1->type == PRECOLORED
- ? 1 : HARD_REGNO_NREGS (c1, PSEUDO_REGNO_MODE (web1->regno));
+ ? 1 : hard_regno_nregs[c1][PSEUDO_REGNO_MODE (web1->regno)];
size2 = web2->type == PRECOLORED
- ? 1 : HARD_REGNO_NREGS (c2, PSEUDO_REGNO_MODE (web2->regno));
+ ? 1 : hard_regno_nregs[c2][PSEUDO_REGNO_MODE (web2->regno)];
if (c1 >= c2 + size2 || c2 >= c1 + size1)
return 0;
return 1;
if ((c = alias (find_web_for_subweb (web))->color) < 0
|| c == an_unusable_color)
return;
- size = HARD_REGNO_NREGS (c, GET_MODE (web->orig_x));
+ size = hard_regno_nregs[c][GET_MODE (web->orig_x)];
if (SUBWEB_P (web))
{
c += subreg_regno_offset (c, GET_MODE (SUBREG_REG (web->orig_x)),
if (c == an_unusable_color)
return 1;
size = web->type == PRECOLORED
- ? 1 : HARD_REGNO_NREGS (c, PSEUDO_REGNO_MODE (web->regno));
+ ? 1 : hard_regno_nregs[c][PSEUDO_REGNO_MODE (web->regno)];
for (; size--;)
if (TEST_HARD_REG_BIT (*in_use, c + size))
return 0;
rtx foll = NEXT_INSN (after);
bb = BLOCK_FOR_INSN (after);
emit_insn_after (ni, after);
- if (bb->end == after)
- bb->end = PREV_INSN (foll);
+ if (BB_END (bb) == after)
+ BB_END (bb) = PREV_INSN (foll);
for (ni = NEXT_INSN (after); ni != foll; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
rtx prev = PREV_INSN (before);
bb = BLOCK_FOR_INSN (before);
emit_insn_before (ni, before);
- if (bb->head == before)
- bb->head = NEXT_INSN (prev);
+ if (BB_HEAD (bb) == before)
+ BB_HEAD (bb) = NEXT_INSN (prev);
for (; ni != before; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
struct ra_insn_info info;
unsigned int n;
+ memset (&info, 0, sizeof info);
+
if (INSN_P (insn) && BLOCK_FOR_INSN (insn) != last_bb)
{
int index = BLOCK_FOR_INSN (insn)->index + 2;
XXX Note, that sometimes reload barfs when we emit insns between
a call and the insn which copies the return register into a
pseudo. */
- if (GET_CODE (insn) == CALL_INSN)
+ if (CALL_P (insn))
ri.need_load = 1;
else if (INSN_P (insn))
for (n = 0; n < info.num_uses; n++)
web->one_load = 0;
}
- if (GET_CODE (insn) == CODE_LABEL)
+ if (LABEL_P (insn))
break;
}
And because we sometimes delete insn referring to hardregs (when
they became useless because they setup a rematerializable pseudo, which
then was rematerialized), some of those uses will go away with the next
- df_analyse(). This means we even _must_ delete those uses from
+ df_analyze(). This means we even _must_ delete those uses from
the live_at_end[] bitmaps. For simplicity we simply delete
all of them. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
BITMAP_AND_COMPL);
live_at_end += 2;
- if (rtl_dump_file && (debug_new_regalloc & DUMP_REBUILD) != 0)
+ if (dump_file && (debug_new_regalloc & DUMP_REBUILD) != 0)
{
ra_debug_msg (DUMP_REBUILD, "need to check these uses:\n");
- dump_sbitmap_file (rtl_dump_file, last_check_uses);
+ dump_sbitmap_file (dump_file, last_check_uses);
}
sbitmap_free (already_webs);
BITMAP_XFREE (uses_as_bitmap);
place = assign_stack_local (PSEUDO_REGNO_MODE (web->regno),
total_size,
inherent_size == total_size ? 0 : -1);
- RTX_UNCHANGING_P (place) =
- RTX_UNCHANGING_P (regno_reg_rtx[web->regno]);
set_mem_alias_set (place, new_alias_set ());
}
else
rtx note = *pnote;
if ((REG_NOTE_KIND (note) == REG_DEAD
|| REG_NOTE_KIND (note) == REG_UNUSED)
- && (GET_CODE (XEXP (note, 0)) == REG
+ && (REG_P (XEXP (note, 0))
&& bitmap_bit_p (regnos_coalesced_to_hardregs,
REGNO (XEXP (note, 0)))))
*pnote = XEXP (note, 1);