static void df_ref_record (struct df_collection_rec *,
rtx, rtx *,
- basic_block, rtx, enum df_ref_type,
- enum df_ref_flags, int, int, enum machine_mode);
-static void df_def_record_1 (struct df_collection_rec *,
- rtx, basic_block, rtx,
+ basic_block, struct df_insn_info *,
+ enum df_ref_type, enum df_ref_flags,
+ int, int, enum machine_mode);
+static void df_def_record_1 (struct df_collection_rec *, rtx,
+ basic_block, struct df_insn_info *,
enum df_ref_flags);
-static void df_defs_record (struct df_collection_rec *,
- rtx, basic_block, rtx,
+static void df_defs_record (struct df_collection_rec *, rtx,
+ basic_block, struct df_insn_info *,
enum df_ref_flags);
static void df_uses_record (struct df_collection_rec *,
rtx *, enum df_ref_type,
- basic_block, rtx, enum df_ref_flags,
+ basic_block, struct df_insn_info *,
+ enum df_ref_flags,
int, int, enum machine_mode);
static struct df_ref *df_ref_create_structure (struct df_collection_rec *, rtx, rtx *,
- basic_block, rtx, enum df_ref_type,
- enum df_ref_flags,
+ basic_block, struct df_insn_info *,
+ enum df_ref_type, enum df_ref_flags,
int, int, enum machine_mode);
static void df_insn_refs_collect (struct df_collection_rec*,
- basic_block, rtx);
+ basic_block, struct df_insn_info *);
static void df_canonize_collection_rec (struct df_collection_rec *);
static void df_get_regular_block_artificial_uses (bitmap);
/* You cannot hack artificial refs. */
gcc_assert (insn);
- ref = df_ref_create_structure (NULL, reg, loc, bb, insn,
+ ref = df_ref_create_structure (NULL, reg, loc, bb, DF_INSN_INFO_GET (insn),
ref_type, ref_flags,
width, offset, mode);
struct df_insn_info *insn_rec;
df_grow_insn_info ();
- insn_rec = DF_INSN_GET (insn);
+ insn_rec = DF_INSN_INFO_GET (insn);
if (!insn_rec)
{
insn_rec = pool_alloc (problem_data->insn_pool);
- DF_INSN_SET (insn, insn_rec);
+ DF_INSN_INFO_SET (insn, insn_rec);
}
memset (insn_rec, 0, sizeof (struct df_insn_info));
insn_rec->insn = insn;
}
else
{
- df_insn_create_insn_record (insn);
- df_insn_refs_collect (&collection_rec, bb, insn);
+ struct df_insn_info *insn_info = df_insn_create_insn_record (insn);
+ df_insn_refs_collect (&collection_rec, bb, insn_info);
if (dump_file)
fprintf (dump_file, "scanning new insn with uid = %d.\n", uid);
}
}
else
{
- struct df_insn_info *insn_info
- = DF_INSN_GET (DF_REF_INSN (the_ref));
+ struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);
if (DF_REF_FLAGS (the_ref) & DF_REF_IN_NOTE)
ref_vec = insn_info->eq_uses;
else
case REG_EQUAL:
df_uses_record (&collection_rec,
&XEXP (note, 0), DF_REF_REG_USE,
- bb, insn, DF_REF_IN_NOTE, -1, -1, 0);
+ bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
default:
break;
}
(DF_REF_REG (ref1) == DF_REF_REG (ref2)
&& DF_REF_REGNO (ref1) == DF_REF_REGNO (ref2)
&& DF_REF_LOC (ref1) == DF_REF_LOC (ref2)
- && DF_REF_INSN (ref1) == DF_REF_INSN (ref2)
+ && DF_REF_INSN_INFO (ref1) == DF_REF_INSN_INFO (ref2)
&& DF_REF_TYPE (ref1) == DF_REF_TYPE (ref2)
&& ((DF_REF_FLAGS (ref1) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG))
== (DF_REF_FLAGS (ref2) & ~(DF_REF_REG_MARKER + DF_REF_MW_HARDREG)))
{
if (insn)
{
- struct df_insn_info *insn_rec = DF_INSN_GET (insn);
+ struct df_insn_info *insn_rec = DF_INSN_INFO_GET (insn);
/* If there is a vector in the collection rec, add it to the
insn. A null rec is a signal that the caller will handle the
chain specially. */
static struct df_ref *
df_ref_create_structure (struct df_collection_rec *collection_rec,
rtx reg, rtx *loc,
- basic_block bb, rtx insn,
+ basic_block bb, struct df_insn_info *info,
enum df_ref_type ref_type,
enum df_ref_flags ref_flags,
int width, int offset, enum machine_mode mode)
DF_REF_REG (this_ref) = reg;
DF_REF_REGNO (this_ref) = regno;
DF_REF_LOC (this_ref) = loc;
- DF_REF_INSN (this_ref) = insn;
+ DF_REF_INSN_INFO (this_ref) = info;
DF_REF_CHAIN (this_ref) = NULL;
DF_REF_TYPE (this_ref) = ref_type;
DF_REF_FLAGS (this_ref) = ref_flags;
static void
df_ref_record (struct df_collection_rec *collection_rec,
rtx reg, rtx *loc,
- basic_block bb, rtx insn,
+ basic_block bb, struct df_insn_info *insn_info,
enum df_ref_type ref_type,
enum df_ref_flags ref_flags,
int width, int offset, enum machine_mode mode)
/* If this is a multiword hardreg, we create some extra
datastructures that will enable us to easily build REG_DEAD
and REG_UNUSED notes. */
- if ((endregno != regno + 1) && insn)
+ if ((endregno != regno + 1) && insn_info)
{
/* Sets to a subreg of a multiword register are partial.
Sets to a non-subreg of a multiword register are not. */
for (i = regno; i < endregno; i++)
{
ref = df_ref_create_structure (collection_rec, regno_reg_rtx[i], loc,
- bb, insn, ref_type, ref_flags,
+ bb, insn_info, ref_type, ref_flags,
width, offset, mode);
gcc_assert (ORIGINAL_REGNO (DF_REF_REG (ref)) == i);
else
{
struct df_ref *ref;
- ref = df_ref_create_structure (collection_rec, reg, loc, bb, insn,
+ ref = df_ref_create_structure (collection_rec, reg, loc, bb, insn_info,
ref_type, ref_flags, width, offset, mode);
}
}
static void
df_def_record_1 (struct df_collection_rec *collection_rec,
- rtx x, basic_block bb, rtx insn,
+ rtx x, basic_block bb, struct df_insn_info *insn_info,
enum df_ref_flags flags)
{
rtx *loc;
if (GET_CODE (temp) == EXPR_LIST || GET_CODE (temp) == CLOBBER
|| GET_CODE (temp) == SET)
df_def_record_1 (collection_rec,
- temp, bb, insn,
+ temp, bb, insn_info,
GET_CODE (temp) == CLOBBER
? flags | DF_REF_MUST_CLOBBER : flags);
}
if (REG_P (dst))
{
df_ref_record (collection_rec,
- dst, loc, bb, insn, DF_REF_REG_DEF, flags,
+ dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
width, offset, mode);
/* We want to keep sp alive everywhere - by making all
writes to sp also use of sp. */
if (REGNO (dst) == STACK_POINTER_REGNUM)
df_ref_record (collection_rec,
- dst, NULL, bb, insn, DF_REF_REG_USE, flags,
+ dst, NULL, bb, insn_info, DF_REF_REG_USE, flags,
width, offset, mode);
}
else if (GET_CODE (dst) == SUBREG && REG_P (SUBREG_REG (dst)))
flags |= DF_REF_SUBREG;
df_ref_record (collection_rec,
- dst, loc, bb, insn, DF_REF_REG_DEF, flags,
+ dst, loc, bb, insn_info, DF_REF_REG_DEF, flags,
width, offset, mode);
}
}
static void
df_defs_record (struct df_collection_rec *collection_rec,
- rtx x, basic_block bb, rtx insn, enum df_ref_flags flags)
+ rtx x, basic_block bb, struct df_insn_info *insn_info,
+ enum df_ref_flags flags)
{
RTX_CODE code = GET_CODE (x);
/* Mark the single def within the pattern. */
enum df_ref_flags clobber_flags = flags;
clobber_flags |= (code == CLOBBER) ? DF_REF_MUST_CLOBBER : 0;
- df_def_record_1 (collection_rec, x, bb, insn, clobber_flags);
+ df_def_record_1 (collection_rec, x, bb, insn_info, clobber_flags);
}
else if (code == COND_EXEC)
{
df_defs_record (collection_rec, COND_EXEC_CODE (x),
- bb, insn, DF_REF_CONDITIONAL);
+ bb, insn_info, DF_REF_CONDITIONAL);
}
else if (code == PARALLEL)
{
/* Mark the multiple defs within the pattern. */
for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- df_defs_record (collection_rec, XVECEXP (x, 0, i), bb, insn, flags);
+ df_defs_record (collection_rec, XVECEXP (x, 0, i), bb, insn_info, flags);
}
}
static void
df_uses_record (struct df_collection_rec *collection_rec,
rtx *loc, enum df_ref_type ref_type,
- basic_block bb, rtx insn, enum df_ref_flags flags,
+ basic_block bb, struct df_insn_info *insn_info,
+ enum df_ref_flags flags,
int width, int offset, enum machine_mode mode)
{
RTX_CODE code;
if (MEM_P (XEXP (x, 0)))
df_uses_record (collection_rec,
&XEXP (XEXP (x, 0), 0),
- DF_REF_REG_MEM_STORE, bb, insn, flags,
- width, offset, mode);
+ DF_REF_REG_MEM_STORE,
+ bb, insn_info,
+ flags, width, offset, mode);
/* If we're clobbering a REG then we have a def so ignore. */
return;
case MEM:
df_uses_record (collection_rec,
&XEXP (x, 0), DF_REF_REG_MEM_LOAD,
- bb, insn, flags & DF_REF_IN_NOTE,
+ bb, insn_info, flags & DF_REF_IN_NOTE,
width, offset, mode);
return;
if (!REG_P (SUBREG_REG (x)))
{
loc = &SUBREG_REG (x);
- df_uses_record (collection_rec, loc, ref_type, bb, insn, flags,
+ df_uses_record (collection_rec, loc, ref_type, bb, insn_info, flags,
width, offset, mode);
return;
}
case REG:
df_ref_record (collection_rec,
- x, loc, bb, insn, ref_type, flags,
+ x, loc, bb, insn_info,
+ ref_type, flags,
width, offset, mode);
return;
flags |= DF_REF_SIGN_EXTRACT;
df_uses_record (collection_rec,
- &XEXP (x, 0), ref_type, bb, insn, flags,
+ &XEXP (x, 0), ref_type, bb, insn_info, flags,
width, offset, mode);
return;
}
rtx dst = SET_DEST (x);
gcc_assert (!(flags & DF_REF_IN_NOTE));
df_uses_record (collection_rec,
- &SET_SRC (x), DF_REF_REG_USE, bb, insn, flags,
+ &SET_SRC (x), DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
switch (GET_CODE (dst))
if (df_read_modify_subreg_p (dst))
{
df_uses_record (collection_rec, &SUBREG_REG (dst),
- DF_REF_REG_USE, bb, insn,
+ DF_REF_REG_USE, bb, insn_info,
flags | DF_REF_READ_WRITE | DF_REF_SUBREG,
width, offset, mode);
break;
break;
case MEM:
df_uses_record (collection_rec, &XEXP (dst, 0),
- DF_REF_REG_MEM_STORE, bb, insn, flags,
+ DF_REF_REG_MEM_STORE, bb, insn_info, flags,
width, offset, mode);
break;
case STRICT_LOW_PART:
dst = XEXP (dst, 0);
df_uses_record (collection_rec,
(GET_CODE (dst) == SUBREG) ? &SUBREG_REG (dst) : temp,
- DF_REF_REG_USE, bb, insn,
+ DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_STRICT_LOW_PART,
width, offset, mode);
}
else
{
df_uses_record (collection_rec, &XEXP (dst, 1),
- DF_REF_REG_USE, bb, insn, flags,
+ DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
df_uses_record (collection_rec, &XEXP (dst, 2),
- DF_REF_REG_USE, bb, insn, flags,
+ DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
}
df_uses_record (collection_rec, &XEXP (dst, 0),
- DF_REF_REG_USE, bb, insn,
+ DF_REF_REG_USE, bb, insn_info,
DF_REF_READ_WRITE | DF_REF_ZERO_EXTRACT,
width, offset, mode);
}
for (j = 0; j < ASM_OPERANDS_INPUT_LENGTH (x); j++)
df_uses_record (collection_rec, &ASM_OPERANDS_INPUT (x, j),
- DF_REF_REG_USE, bb, insn, flags,
+ DF_REF_REG_USE, bb, insn_info, flags,
width, offset, mode);
return;
}
case PRE_MODIFY:
case POST_MODIFY:
/* Catch the def of the register being modified. */
- df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0), bb, insn,
+ df_ref_record (collection_rec, XEXP (x, 0), &XEXP (x, 0),
+ bb, insn_info,
DF_REF_REG_DEF,
flags | DF_REF_READ_WRITE | DF_REF_PRE_POST_MODIFY,
width, offset, mode);
goto retry;
}
df_uses_record (collection_rec, &XEXP (x, i), ref_type,
- bb, insn, flags,
+ bb, insn_info, flags,
width, offset, mode);
}
else if (fmt[i] == 'E')
for (j = 0; j < XVECLEN (x, i); j++)
df_uses_record (collection_rec,
&XVECEXP (x, i, j), ref_type,
- bb, insn, flags,
+ bb, insn_info, flags,
width, offset, mode);
}
}
use = df_ref_create_structure (collection_rec, DF_REF_REG (ref),
DF_REF_LOC (ref), DF_REF_BB (ref),
- DF_REF_INSN (ref), DF_REF_REG_USE,
+ DF_REF_INSN_INFO (ref), DF_REF_REG_USE,
DF_REF_FLAGS (ref) & ~DF_REF_CONDITIONAL,
width, offset, mode);
DF_REF_REGNO (use) = DF_REF_REGNO (ref);
static void
df_get_call_refs (struct df_collection_rec * collection_rec,
basic_block bb,
- rtx insn,
+ struct df_insn_info *insn_info,
enum df_ref_flags flags)
{
rtx note;
/* Record the registers used to pass arguments, and explicitly
noted as clobbered. */
- for (note = CALL_INSN_FUNCTION_USAGE (insn); note;
+ for (note = CALL_INSN_FUNCTION_USAGE (insn_info->insn); note;
note = XEXP (note, 1))
{
if (GET_CODE (XEXP (note, 0)) == USE)
df_uses_record (collection_rec, &XEXP (XEXP (note, 0), 0),
- DF_REF_REG_USE, bb, insn, flags, -1, -1, 0);
+ DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
else if (GET_CODE (XEXP (note, 0)) == CLOBBER)
{
if (REG_P (XEXP (XEXP (note, 0), 0)))
unsigned int regno = REGNO (XEXP (XEXP (note, 0), 0));
if (!bitmap_bit_p (defs_generated, regno))
df_defs_record (collection_rec, XEXP (note, 0), bb,
- insn, flags);
+ insn_info, flags);
}
else
df_uses_record (collection_rec, &XEXP (note, 0),
- DF_REF_REG_USE, bb, insn, flags, -1, -1, 0);
+ DF_REF_REG_USE, bb, insn_info, flags, -1, -1, 0);
}
}
/* The stack ptr is used (honorarily) by a CALL insn. */
df_ref_record (collection_rec, regno_reg_rtx[STACK_POINTER_REGNUM],
- NULL, bb, insn, DF_REF_REG_USE, DF_REF_CALL_STACK_USAGE | flags,
+ NULL, bb, insn_info, DF_REF_REG_USE,
+ DF_REF_CALL_STACK_USAGE | flags,
-1, -1, 0);
/* Calls may also reference any of the global registers,
if (global_regs[i])
{
df_ref_record (collection_rec, regno_reg_rtx[i],
- NULL, bb, insn, DF_REF_REG_USE, flags, -1, -1, 0);
+ NULL, bb, insn_info, DF_REF_REG_USE, flags, -1, -1, 0);
df_ref_record (collection_rec, regno_reg_rtx[i],
- NULL, bb, insn, DF_REF_REG_DEF, flags, -1, -1, 0);
+ NULL, bb, insn_info, DF_REF_REG_DEF, flags, -1, -1, 0);
}
- is_sibling_call = SIBLING_CALL_P (insn);
+ is_sibling_call = SIBLING_CALL_P (insn_info->insn);
EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
{
if (!global_regs[ui]
|| refers_to_regno_p (ui, ui+1,
crtl->return_rtx, NULL)))
df_ref_record (collection_rec, regno_reg_rtx[ui],
- NULL, bb, insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER | flags,
+ NULL, bb, insn_info, DF_REF_REG_DEF,
+ DF_REF_MAY_CLOBBER | flags,
-1, -1, 0);
}
static void
df_insn_refs_collect (struct df_collection_rec* collection_rec,
- basic_block bb, rtx insn)
+ basic_block bb, struct df_insn_info *insn_info)
{
rtx note;
- bool is_cond_exec = (GET_CODE (PATTERN (insn)) == COND_EXEC);
+ bool is_cond_exec = (GET_CODE (PATTERN (insn_info->insn)) == COND_EXEC);
/* Clear out the collection record. */
collection_rec->next_def = 0;
collection_rec->next_mw = 0;
/* Record register defs. */
- df_defs_record (collection_rec, PATTERN (insn), bb, insn, 0);
+ df_defs_record (collection_rec, PATTERN (insn_info->insn), bb, insn_info, 0);
- /* Process REG_EQUIV/REG_EQUAL notes */
- for (note = REG_NOTES (insn); note;
+ /* Process REG_EQUIV/REG_EQUAL notes. */
+ for (note = REG_NOTES (insn_info->insn); note;
note = XEXP (note, 1))
{
switch (REG_NOTE_KIND (note))
case REG_EQUAL:
df_uses_record (collection_rec,
&XEXP (note, 0), DF_REF_REG_USE,
- bb, insn, DF_REF_IN_NOTE, -1, -1, 0);
+ bb, insn_info, DF_REF_IN_NOTE, -1, -1, 0);
break;
case REG_NON_LOCAL_GOTO:
/* The frame ptr is used by a non-local goto. */
df_ref_record (collection_rec,
regno_reg_rtx[FRAME_POINTER_REGNUM],
- NULL,
- bb, insn,
+ NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, 0);
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
df_ref_record (collection_rec,
regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
- NULL,
- bb, insn,
+ NULL, bb, insn_info,
DF_REF_REG_USE, 0, -1, -1, 0);
#endif
break;
}
}
- if (CALL_P (insn))
- df_get_call_refs (collection_rec, bb, insn,
+ if (CALL_P (insn_info->insn))
+ df_get_call_refs (collection_rec, bb, insn_info,
(is_cond_exec) ? DF_REF_CONDITIONAL : 0);
/* Record the register uses. */
df_uses_record (collection_rec,
- &PATTERN (insn), DF_REF_REG_USE, bb, insn, 0,
+ &PATTERN (insn_info->insn), DF_REF_REG_USE, bb, insn_info, 0,
-1, -1, 0);
/* DF_REF_CONDITIONAL needs corresponding USES. */
/* Scan the block an insn at a time from beginning to end. */
FOR_BB_INSNS (bb, insn)
{
- struct df_insn_info *insn_info = DF_INSN_GET (insn);
+ struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
/* Inserting labels does not always trigger the incremental
rescanning. */
if (!insn_info)
{
gcc_assert (!INSN_P (insn));
- df_insn_create_insn_record (insn);
+ insn_info = df_insn_create_insn_record (insn);
}
- DF_INSN_LUID (insn) = luid;
+ DF_INSN_INFO_LUID (insn_info) = luid;
if (INSN_P (insn))
luid++;
}
/* Scan the block an insn at a time from beginning to end. */
FOR_BB_INSNS (bb, insn)
{
- struct df_insn_info *insn_info = DF_INSN_GET (insn);
+ struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
gcc_assert (!insn_info);
- df_insn_create_insn_record (insn);
+ insn_info = df_insn_create_insn_record (insn);
if (INSN_P (insn))
{
/* Record refs within INSN. */
- DF_INSN_LUID (insn) = luid++;
- df_insn_refs_collect (&collection_rec, bb, insn);
+ DF_INSN_INFO_LUID (insn_info) = luid++;
+ df_insn_refs_collect (&collection_rec, bb, DF_INSN_INFO_GET (insn));
df_refs_add_to_chains (&collection_rec, bb, insn);
}
- DF_INSN_LUID (insn) = luid;
+ DF_INSN_INFO_LUID (insn_info) = luid;
}
/* Other block level artificial refs */
{
bool ret1, ret2, ret3, ret4;
unsigned int uid = INSN_UID (insn);
+ struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
- df_insn_refs_collect (collection_rec, bb, insn);
+ df_insn_refs_collect (collection_rec, bb, insn_info);
if (!DF_INSN_UID_DEFS (uid))
{