+2014-08-26 David Malcolm <dmalcolm@redhat.com>
+
+ * rtx-classes-status.txt (TODO): DF_REF_INSN is done.
+
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): SET_BB_HEAD, SET_BB_END,
+2014-08-26 David Malcolm <dmalcolm@redhat.com>
+
+ * df.h (df_dump_insn_problem_function): Strengthen first param of
+ this callback from const_rtx to const rtx_insn *.
+ (struct df_insn_info): Strengthen field "insn" from rtx to
+ rtx_insn *.
+ (DF_REF_INSN): Eliminate this function, reinstating the older
+ macro definition.
+ (df_find_def): Strengthen param 1 from rtx to rtx_insn *.
+ (df_reg_defined): Likewise.
+ (df_find_use): Likewise.
+ (df_reg_used): Likewise.
+ (df_dump_insn_top): Strengthen param 1 from const_rtx to
+ const rtx_insn *.
+ (df_dump_insn_bottom): Likewise.
+ (df_insn_debug): Strengthen param 1 from rtx to rtx_insn *.
+ (df_insn_debug_regno): Likewise.
+ (debug_df_insn): Likewise.
+ (df_rd_simulate_one_insn): Likewise for param 2.
+ (df_word_lr_simulate_defs): Likewise for param 1.
+ (df_word_lr_simulate_uses): Likewise.
+ (df_md_simulate_one_insn): Likewise for param 2.
+ (df_simulate_find_noclobber_defs): Likewise for param 1.
+ (df_simulate_find_defs): Likewise.
+ (df_simulate_defs): Likewise.
+ (df_simulate_uses): Likewise.
+ (df_simulate_one_insn_backwards): Likewise for param 2.
+ (df_simulate_one_insn_forwards): Likewise.
+ (df_uses_create): Likewise for param 2.
+ (df_insn_create_insn_record): Likewise for param 1.
+ (df_insn_delete): Likewise.
+ (df_insn_rescan): Likewise.
+ (df_insn_rescan_debug_internal): Likewise.
+ (df_insn_change_bb): Likewise.
+ (df_notes_rescan): Likewise.
+ * rtl.h (remove_death): Likewise for param 2.
+ (print_rtl_with_bb): Strengthen param 2 from const_rtx to
+ const rtx_insn *.
+ * sched-int.h (reemit_notes): Strengthen param from rtx to
+ rtx_insn *.
+ * valtrack.h (propagate_for_debug): Likewise for param 1.
+
+ * cfgrtl.c (print_rtl_with_bb): Strengthen param "rtx_first" and
+ local "tmp_rtx" from const_rtx to const rtx_insn *.
+ * combine.c (remove_death): Strengthen param "insn" from rtx to
+ rtx_insn *.
+ (move_deaths): Likewise for local "where_dead".
+ * cse.c (delete_trivially_dead_insns): Introduce local
+ "bind_var_loc" so that "bind" can be strengthened to an rtx_insn *.
+ * df-core.c (df_find_def): Strengthen param "insn" from rtx to
+ rtx_insn *.
+ (df_reg_defined): Likewise.
+ (df_find_use): Likewise.
+ (df_reg_used): Likewise.
+ (df_dump_insn_problem_data): Strengthen param "insn" from
+ const_rtx to const rtx_insn *.
+ (df_dump_insn_top): Likewise.
+ (df_dump_insn_bottom): Likewise.
+ (df_insn_debug): Strengthen param "insn" from rtx to rtx_insn *.
+ (df_insn_debug_regno): Likewise.
+ (debug_df_insn): Likewise.
+ (DF_REF_INSN): Delete.
+ * df-problems.c (df_rd_simulate_one_insn): Strengthen param "insn"
+ from rtx to rtx_insn *.
+ (df_chain_insn_top_dump): Strengthen param "insn" from
+ const_rtx to const rtx_insn *.
+ (df_chain_insn_bottom_dump): Likewise.
+ (df_word_lr_simulate_defs): Strengthen param "insn" from rtx to
+ rtx_insn *.
+ (df_word_lr_simulate_uses): Likewise.
+ (df_print_note): Likewise.
+ (df_remove_dead_and_unused_notes): Likewise.
+ (df_set_unused_notes_for_mw): Likewise.
+ (df_set_dead_notes_for_mw): Likewise.
+ (df_create_unused_note): Likewise.
+ (df_simulate_find_defs): Likewise.
+ (df_simulate_find_uses): Likewise.
+ (df_simulate_find_noclobber_defs): Likewise.
+ (df_simulate_defs): Likewise.
+ (df_simulate_uses): Likewise.
+ (df_simulate_one_insn_backwards): Likewise.
+ (df_simulate_one_insn_forwards): Likewise.
+ (df_md_simulate_one_insn): Likewise.
+ * df-scan.c (df_uses_create): Likewise.
+ (df_insn_create_insn_record): Likewise.
+ (df_insn_delete): Likewise.
+ (df_insn_rescan): Likewise.
+ (df_insn_rescan_debug_internal): Likewise.
+ (df_insn_change_bb): Likewise.
+ (df_notes_rescan): Likewise.
+ (df_refs_add_to_chains): Likewise.
+ (df_insn_refs_verify): Likewise.
+ * emit-rtl.c (set_insn_deleted): Add checked cast to rtx_insn *
+ when invoking df_insn_delete.
+ (reorder_insns): Strengthen local "x" from rtx to rtx_insn *.
+ (set_unique_reg_note): Add checked cast.
+ * final.c (cleanup_subreg_operands): Likewise.
+ * gcse.c (update_ld_motion_stores): Likewise, strengthening local
+ "insn" from rtx to rtx_insn *.
+ * haifa-sched.c (reemit_notes): Strengthen param "insn" and local
+ "last" from rtx to rtx_insn *.
+ * ira-emit.c (change_regs_in_insn): New function.
+ (change_loop): Strengthen local "insn" from rtx to rtx_insn *.
+ Invoke change_regs_in_insn rather than change_regs.
+ * ira.c (update_equiv_regs): Strengthen locals "insn",
+ "init_insn", "new_insn" from rtx to rtx_insn *. Invoke
+ for_each_rtx_in_insn rather than for_each_rtx.
+ * recog.c (confirm_change_group): Add checked casts.
+ (peep2_update_life): Strengthen local "x" from rtx to rtx_insn *.
+ Add checked cast.
+ (peep2_fill_buffer): Add checked cast.
+ * rtlanal.c (remove_note): Likewise.
+ * valtrack.c (propagate_for_debug): Strengthen param "insn" and
+ locals "next" "end" from rtx to rtx_insn *.
+
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* sched-int.h (sched_init_insn_luid): Strengthen param 1 from rtx
in dumpfile.h. */
void
-print_rtl_with_bb (FILE *outf, const_rtx rtx_first, int flags)
+print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, int flags)
{
- const_rtx tmp_rtx;
+ const rtx_insn *tmp_rtx;
if (rtx_first == 0)
fprintf (outf, "(nil)\n");
else
Return the note used to record the death, if there was one. */
rtx
-remove_death (unsigned int regno, rtx insn)
+remove_death (unsigned int regno, rtx_insn *insn)
{
rtx note = find_regno_note (insn, REG_DEAD, regno);
if (code == REG)
{
unsigned int regno = REGNO (x);
- rtx where_dead = reg_stat[regno].last_death;
+ rtx_insn *where_dead = reg_stat[regno].last_death;
/* Don't move the register if it gets killed in between from and to. */
if (maybe_kill_insn && reg_set_p (x, maybe_kill_insn)
&& !side_effects_p (SET_SRC (set))
&& asm_noperands (PATTERN (insn)) < 0)
{
- rtx dval, bind;
+ rtx dval, bind_var_loc;
+ rtx_insn *bind;
/* Create DEBUG_EXPR (and DEBUG_EXPR_DECL). */
dval = make_debug_expr_from_rtl (SET_DEST (set));
/* Emit a debug bind insn before the insn in which
reg dies. */
- bind = gen_rtx_VAR_LOCATION (GET_MODE (SET_DEST (set)),
- DEBUG_EXPR_TREE_DECL (dval),
- SET_SRC (set),
- VAR_INIT_STATUS_INITIALIZED);
- count_reg_usage (bind, counts + nreg, NULL_RTX, 1);
-
- bind = emit_debug_insn_before (bind, insn);
+ bind_var_loc =
+ gen_rtx_VAR_LOCATION (GET_MODE (SET_DEST (set)),
+ DEBUG_EXPR_TREE_DECL (dval),
+ SET_SRC (set),
+ VAR_INIT_STATUS_INITIALIZED);
+ count_reg_usage (bind_var_loc, counts + nreg, NULL_RTX, 1);
+
+ bind = emit_debug_insn_before (bind_var_loc, insn);
df_insn_rescan (bind);
if (replacements == NULL)
DF is the dataflow object. */
df_ref
-df_find_def (rtx insn, rtx reg)
+df_find_def (rtx_insn *insn, rtx reg)
{
df_ref def;
/* Return true if REG is defined in INSN, zero otherwise. */
bool
-df_reg_defined (rtx insn, rtx reg)
+df_reg_defined (rtx_insn *insn, rtx reg)
{
return df_find_def (insn, reg) != NULL;
}
DF is the dataflow object. */
df_ref
-df_find_use (rtx insn, rtx reg)
+df_find_use (rtx_insn *insn, rtx reg)
{
df_ref use;
/* Return true if REG is referenced in INSN, zero otherwise. */
bool
-df_reg_used (rtx insn, rtx reg)
+df_reg_used (rtx_insn *insn, rtx reg)
{
return df_find_use (insn, reg) != NULL;
}
/* Dump information about INSN just before or after dumping INSN itself. */
static void
-df_dump_insn_problem_data (const_rtx insn, FILE *file, bool top)
+df_dump_insn_problem_data (const rtx_insn *insn, FILE *file, bool top)
{
int i;
/* Dump information about INSN before dumping INSN itself. */
void
-df_dump_insn_top (const_rtx insn, FILE *file)
+df_dump_insn_top (const rtx_insn *insn, FILE *file)
{
df_dump_insn_problem_data (insn, file, /*top=*/true);
}
/* Dump information about INSN after dumping INSN itself. */
void
-df_dump_insn_bottom (const_rtx insn, FILE *file)
+df_dump_insn_bottom (const rtx_insn *insn, FILE *file)
{
df_dump_insn_problem_data (insn, file, /*top=*/false);
}
DEBUG_FUNCTION void
-df_insn_debug (rtx insn, bool follow_chain, FILE *file)
+df_insn_debug (rtx_insn *insn, bool follow_chain, FILE *file)
{
df_insn_uid_debug (INSN_UID (insn), follow_chain, file);
}
DEBUG_FUNCTION void
-df_insn_debug_regno (rtx insn, FILE *file)
+df_insn_debug_regno (rtx_insn *insn, FILE *file)
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
/* Functions for debugging from GDB. */
DEBUG_FUNCTION void
-debug_df_insn (rtx insn)
+debug_df_insn (rtx_insn *insn)
{
df_insn_debug (insn, true, stderr);
debug_rtx (insn);
df_chain_dump (link, stderr);
fputc ('\n', stderr);
}
-
-rtx_insn *DF_REF_INSN (df_ref ref)
-{
- rtx insn = ref->base.insn_info->insn;
- return safe_as_a <rtx_insn *> (insn);
-}
LOCAL_RD. */
void
-df_rd_simulate_one_insn (basic_block bb ATTRIBUTE_UNUSED, rtx insn,
+df_rd_simulate_one_insn (basic_block bb ATTRIBUTE_UNUSED, rtx_insn *insn,
bitmap local_rd)
{
df_ref def;
}
static void
-df_chain_insn_top_dump (const_rtx insn, FILE *file)
+df_chain_insn_top_dump (const rtx_insn *insn, FILE *file)
{
if (df_chain_problem_p (DF_UD_CHAIN) && INSN_P (insn))
{
}
static void
-df_chain_insn_bottom_dump (const_rtx insn, FILE *file)
+df_chain_insn_bottom_dump (const rtx_insn *insn, FILE *file)
{
if (df_chain_problem_p (DF_DU_CHAIN) && INSN_P (insn))
{
an insn. */
bool
-df_word_lr_simulate_defs (rtx insn, bitmap live)
+df_word_lr_simulate_defs (rtx_insn *insn, bitmap live)
{
bool changed = false;
df_ref def;
/* Simulate the effects of the uses of INSN on LIVE. */
void
-df_word_lr_simulate_uses (rtx insn, bitmap live)
+df_word_lr_simulate_uses (rtx_insn *insn, bitmap live)
{
df_ref use;
/* This is only used if REG_DEAD_DEBUGGING is in effect. */
static void
-df_print_note (const char *prefix, rtx insn, rtx note)
+df_print_note (const char *prefix, rtx_insn *insn, rtx note)
{
if (dump_file)
{
/* Remove all of the REG_DEAD or REG_UNUSED notes from INSN. */
static void
-df_remove_dead_and_unused_notes (rtx insn)
+df_remove_dead_and_unused_notes (rtx_insn *insn)
{
rtx *pprev = ®_NOTES (insn);
rtx link = *pprev;
*/
static void
-df_set_unused_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
+df_set_unused_notes_for_mw (rtx_insn *insn, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen,
bitmap artificial_uses,
struct dead_debug_local *debug)
register. */
static void
-df_set_dead_notes_for_mw (rtx insn, struct df_mw_hardreg *mws,
+df_set_dead_notes_for_mw (rtx_insn *insn, struct df_mw_hardreg *mws,
bitmap live, bitmap do_not_gen,
bitmap artificial_uses, bool *added_notes_p)
{
LIVE. Do not generate notes for registers in ARTIFICIAL_USES. */
static void
-df_create_unused_note (rtx insn, df_ref def,
+df_create_unused_note (rtx_insn *insn, df_ref def,
bitmap live, bitmap artificial_uses,
struct dead_debug_local *debug)
{
/* Find the set of DEFs for INSN. */
void
-df_simulate_find_defs (rtx insn, bitmap defs)
+df_simulate_find_defs (rtx_insn *insn, bitmap defs)
{
df_ref def;
/* Find the set of uses for INSN. This includes partial defs. */
static void
-df_simulate_find_uses (rtx insn, bitmap uses)
+df_simulate_find_uses (rtx_insn *insn, bitmap uses)
{
df_ref def, use;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
/* Find the set of real DEFs, which are not clobbers, for INSN. */
void
-df_simulate_find_noclobber_defs (rtx insn, bitmap defs)
+df_simulate_find_noclobber_defs (rtx_insn *insn, bitmap defs)
{
df_ref def;
/* Simulate the effects of the defs of INSN on LIVE. */
void
-df_simulate_defs (rtx insn, bitmap live)
+df_simulate_defs (rtx_insn *insn, bitmap live)
{
df_ref def;
/* Simulate the effects of the uses of INSN on LIVE. */
void
-df_simulate_uses (rtx insn, bitmap live)
+df_simulate_uses (rtx_insn *insn, bitmap live)
{
df_ref use;
/* Simulate the backwards effects of INSN on the bitmap LIVE. */
void
-df_simulate_one_insn_backwards (basic_block bb, rtx insn, bitmap live)
+df_simulate_one_insn_backwards (basic_block bb, rtx_insn *insn, bitmap live)
{
if (!NONDEBUG_INSN_P (insn))
return;
/* Simulate the forwards effects of INSN on the bitmap LIVE. */
void
-df_simulate_one_insn_forwards (basic_block bb, rtx insn, bitmap live)
+df_simulate_one_insn_forwards (basic_block bb, rtx_insn *insn, bitmap live)
{
rtx link;
if (! INSN_P (insn))
LOCAL_MD. */
void
-df_md_simulate_one_insn (basic_block bb ATTRIBUTE_UNUSED, rtx insn,
+df_md_simulate_one_insn (basic_block bb ATTRIBUTE_UNUSED, rtx_insn *insn,
bitmap local_md)
{
df_ref def;
static void df_ref_chain_delete (df_ref);
static void df_refs_add_to_chains (struct df_collection_rec *,
- basic_block, rtx, unsigned int);
+ basic_block, rtx_insn *, unsigned int);
-static bool df_insn_refs_verify (struct df_collection_rec *, basic_block, rtx, bool);
+static bool df_insn_refs_verify (struct df_collection_rec *, basic_block,
+ rtx_insn *, bool);
static void df_entry_block_defs_collect (struct df_collection_rec *, bitmap);
static void df_exit_block_uses_collect (struct df_collection_rec *, bitmap);
static void df_install_ref (df_ref, struct df_reg_info *,
depending on whether LOC is inside PATTERN (INSN) or a note. */
void
-df_uses_create (rtx *loc, rtx insn, int ref_flags)
+df_uses_create (rtx *loc, rtx_insn *insn, int ref_flags)
{
gcc_assert (!(ref_flags & ~DF_REF_IN_NOTE));
df_uses_record (NULL, loc, DF_REF_REG_USE,
out. */
struct df_insn_info *
-df_insn_create_insn_record (rtx insn)
+df_insn_create_insn_record (rtx_insn *insn)
{
struct df_scan_problem_data *problem_data
= (struct df_scan_problem_data *) df_scan->problem_data;
or marked for later in deferred mode. */
void
-df_insn_delete (rtx insn)
+df_insn_delete (rtx_insn *insn)
{
unsigned int uid;
basic_block bb;
/* Rescan INSN. Return TRUE if the rescanning produced any changes. */
bool
-df_insn_rescan (rtx insn)
+df_insn_rescan (rtx_insn *insn)
{
unsigned int uid = INSN_UID (insn);
struct df_insn_info *insn_info = NULL;
dirty. */
bool
-df_insn_rescan_debug_internal (rtx insn)
+df_insn_rescan_debug_internal (rtx_insn *insn)
{
unsigned int uid = INSN_UID (insn);
struct df_insn_info *insn_info;
instructions from one block to another. */
void
-df_insn_change_bb (rtx insn, basic_block new_bb)
+df_insn_change_bb (rtx_insn *insn, basic_block new_bb)
{
basic_block old_bb = BLOCK_FOR_INSN (insn);
struct df_insn_info *insn_info;
/* Rescan only the REG_EQUIV/REG_EQUAL notes part of INSN. */
void
-df_notes_rescan (rtx insn)
+df_notes_rescan (rtx_insn *insn)
{
struct df_insn_info *insn_info;
unsigned int uid = INSN_UID (insn);
static void
df_refs_add_to_chains (struct df_collection_rec *collection_rec,
- basic_block bb, rtx insn, unsigned int flags)
+ basic_block bb, rtx_insn *insn, unsigned int flags)
{
if (insn)
{
static bool
df_insn_refs_verify (struct df_collection_rec *collection_rec,
basic_block bb,
- rtx insn,
+ rtx_insn *insn,
bool abort_if_fail)
{
bool ret1, ret2, ret3, ret4;
typedef void (*df_dump_bb_problem_function) (basic_block, FILE *);
/* Function to dump before or after an insn to FILE. */
-typedef void (*df_dump_insn_problem_function) (const_rtx, FILE *);
+typedef void (*df_dump_insn_problem_function) (const rtx_insn *, FILE *);
/* Function to dump top or bottom of basic block results to FILE. */
typedef void (*df_verify_solution_start) (void);
/* One of these structures is allocated for every insn. */
struct df_insn_info
{
- rtx insn; /* The insn this info comes from. */
+ rtx_insn *insn; /* The insn this info comes from. */
df_ref defs; /* Head of insn-def chain. */
df_ref uses; /* Head of insn-use chain. */
/* Head of insn-use chain for uses in REG_EQUAL/EQUIV notes. */
: BLOCK_FOR_INSN (DF_REF_INSN (REF)))
#define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index)
#define DF_REF_INSN_INFO(REF) ((REF)->base.insn_info)
-extern rtx_insn *DF_REF_INSN (df_ref ref);
+#define DF_REF_INSN(REF) ((REF)->base.insn_info->insn)
#define DF_REF_INSN_UID(REF) (INSN_UID (DF_REF_INSN(REF)))
#define DF_REF_CLASS(REF) ((REF)->base.cl)
#define DF_REF_TYPE(REF) ((REF)->base.type)
#endif
extern df_ref df_bb_regno_first_def_find (basic_block, unsigned int);
extern df_ref df_bb_regno_last_def_find (basic_block, unsigned int);
-extern df_ref df_find_def (rtx, rtx);
-extern bool df_reg_defined (rtx, rtx);
-extern df_ref df_find_use (rtx, rtx);
-extern bool df_reg_used (rtx, rtx);
+extern df_ref df_find_def (rtx_insn *, rtx);
+extern bool df_reg_defined (rtx_insn *, rtx);
+extern df_ref df_find_use (rtx_insn *, rtx);
+extern bool df_reg_used (rtx_insn *, rtx);
extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int);
extern void df_print_regset (FILE *file, bitmap r);
extern void df_print_word_regset (FILE *file, bitmap r);
extern void df_dump_start (FILE *);
extern void df_dump_top (basic_block, FILE *);
extern void df_dump_bottom (basic_block, FILE *);
-extern void df_dump_insn_top (const_rtx, FILE *);
-extern void df_dump_insn_bottom (const_rtx, FILE *);
+extern void df_dump_insn_top (const rtx_insn *, FILE *);
+extern void df_dump_insn_bottom (const rtx_insn *, FILE *);
extern void df_refs_chain_dump (df_ref, bool, FILE *);
extern void df_regs_chain_dump (df_ref, FILE *);
-extern void df_insn_debug (rtx, bool, FILE *);
-extern void df_insn_debug_regno (rtx, FILE *);
+extern void df_insn_debug (rtx_insn *, bool, FILE *);
+extern void df_insn_debug_regno (rtx_insn *, FILE *);
extern void df_regno_debug (unsigned int, FILE *);
extern void df_ref_debug (df_ref, FILE *);
-extern void debug_df_insn (rtx);
+extern void debug_df_insn (rtx_insn *);
extern void debug_df_regno (unsigned int);
extern void debug_df_reg (rtx);
extern void debug_df_defno (unsigned int);
extern void df_print_bb_index (basic_block bb, FILE *file);
extern void df_rd_add_problem (void);
extern void df_rd_simulate_artificial_defs_at_top (basic_block, bitmap);
-extern void df_rd_simulate_one_insn (basic_block, rtx, bitmap);
+extern void df_rd_simulate_one_insn (basic_block, rtx_insn *, bitmap);
extern void df_lr_add_problem (void);
extern void df_lr_verify_transfer_functions (void);
extern void df_live_verify_transfer_functions (void);
extern void df_chain_add_problem (unsigned int);
extern void df_word_lr_add_problem (void);
extern bool df_word_lr_mark_ref (df_ref, bool, bitmap);
-extern bool df_word_lr_simulate_defs (rtx, bitmap);
-extern void df_word_lr_simulate_uses (rtx, bitmap);
+extern bool df_word_lr_simulate_defs (rtx_insn *, bitmap);
+extern void df_word_lr_simulate_uses (rtx_insn *, bitmap);
extern void df_word_lr_simulate_artificial_refs_at_top (basic_block, bitmap);
extern void df_word_lr_simulate_artificial_refs_at_end (basic_block, bitmap);
extern void df_note_add_problem (void);
extern void df_md_add_problem (void);
extern void df_md_simulate_artificial_defs_at_top (basic_block, bitmap);
-extern void df_md_simulate_one_insn (basic_block, rtx, bitmap);
-extern void df_simulate_find_noclobber_defs (rtx, bitmap);
-extern void df_simulate_find_defs (rtx, bitmap);
-extern void df_simulate_defs (rtx, bitmap);
-extern void df_simulate_uses (rtx, bitmap);
+extern void df_md_simulate_one_insn (basic_block, rtx_insn *, bitmap);
+extern void df_simulate_find_noclobber_defs (rtx_insn *, bitmap);
+extern void df_simulate_find_defs (rtx_insn *, bitmap);
+extern void df_simulate_defs (rtx_insn *, bitmap);
+extern void df_simulate_uses (rtx_insn *, bitmap);
extern void df_simulate_initialize_backwards (basic_block, bitmap);
-extern void df_simulate_one_insn_backwards (basic_block, rtx, bitmap);
+extern void df_simulate_one_insn_backwards (basic_block, rtx_insn *, bitmap);
extern void df_simulate_finalize_backwards (basic_block, bitmap);
extern void df_simulate_initialize_forwards (basic_block, bitmap);
-extern void df_simulate_one_insn_forwards (basic_block, rtx, bitmap);
+extern void df_simulate_one_insn_forwards (basic_block, rtx_insn *, bitmap);
extern void simulate_backwards_to_point (basic_block, regset, rtx);
extern bool can_move_insns_across (rtx_insn *, rtx_insn *,
rtx_insn *, rtx_insn *,
extern void df_grow_reg_info (void);
extern void df_grow_insn_info (void);
extern void df_scan_blocks (void);
-extern void df_uses_create (rtx *, rtx, int);
-extern struct df_insn_info * df_insn_create_insn_record (rtx);
-extern void df_insn_delete (rtx);
+extern void df_uses_create (rtx *, rtx_insn *, int);
+extern struct df_insn_info * df_insn_create_insn_record (rtx_insn *);
+extern void df_insn_delete (rtx_insn *);
extern void df_bb_refs_record (int, bool);
-extern bool df_insn_rescan (rtx);
-extern bool df_insn_rescan_debug_internal (rtx);
+extern bool df_insn_rescan (rtx_insn *);
+extern bool df_insn_rescan_debug_internal (rtx_insn *);
extern void df_insn_rescan_all (void);
extern void df_process_deferred_rescans (void);
extern void df_recompute_luids (basic_block);
-extern void df_insn_change_bb (rtx, basic_block);
+extern void df_insn_change_bb (rtx_insn *, basic_block);
extern void df_maybe_reorganize_use_refs (enum df_ref_order);
extern void df_maybe_reorganize_def_refs (enum df_ref_order);
extern void df_ref_change_reg_with_loc (int, int, rtx);
-extern void df_notes_rescan (rtx);
+extern void df_notes_rescan (rtx_insn *);
extern void df_hard_reg_init (void);
extern void df_update_entry_block_defs (void);
extern void df_update_exit_block_uses (void);
set_insn_deleted (rtx insn)
{
if (INSN_P (insn))
- df_insn_delete (insn);
+ df_insn_delete (as_a <rtx_insn *> (insn));
PUT_CODE (insn, NOTE);
NOTE_KIND (insn) = NOTE_INSN_DELETED;
}
if (!BARRIER_P (after)
&& (bb = BLOCK_FOR_INSN (after)))
{
- rtx x;
+ rtx_insn *x;
df_set_bb_dirty (bb);
if (!BARRIER_P (from)
{
case REG_EQUAL:
case REG_EQUIV:
- df_notes_rescan (insn);
+ df_notes_rescan (as_a <rtx_insn *> (insn));
break;
default:
break;
*recog_data.dup_loc[i] = walk_alter_subreg (recog_data.dup_loc[i], &changed);
}
if (changed)
- df_insn_rescan (insn);
+ df_insn_rescan (as_a <rtx_insn *> (insn));
}
/* If X is a SUBREG, try to replace it with a REG or a MEM, based on
for ( ; list != NULL_RTX; list = XEXP (list, 1))
{
- rtx insn = XEXP (list, 0);
+ rtx_insn *insn = as_a <rtx_insn *> (XEXP (list, 0));
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
rtx reg = expr->reaching_reg;
NOTEs. This is used for NOTE_INSN_EPILOGUE_BEG, so that sched-ebb
replaces the epilogue note in the correct basic block. */
void
-reemit_notes (rtx insn)
+reemit_notes (rtx_insn *insn)
{
- rtx note, last = insn;
+ rtx note;
+ rtx_insn *last = insn;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
{
return result;
}
+static bool
+change_regs_in_insn (rtx_insn **insn_ptr)
+{
+ rtx rtx = *insn_ptr;
+ bool result = change_regs (&rtx);
+ *insn_ptr = as_a <rtx_insn *> (rtx);
+ return result;
+}
+
/* Attach MOVE to the edge E. The move is attached to the head of the
list if HEAD_P is TRUE. */
static void
int regno;
bool used_p;
ira_allocno_t allocno, parent_allocno, *map;
- rtx insn, original_reg;
+ rtx_insn *insn;
+ rtx original_reg;
enum reg_class aclass, pclass;
ira_loop_tree_node_t parent;
if (node->bb != NULL)
{
FOR_BB_INSNS (node->bb, insn)
- if (INSN_P (insn) && change_regs (&insn))
+ if (INSN_P (insn) && change_regs_in_insn (&insn))
{
df_insn_rescan (insn);
df_notes_rescan (insn);
static int
update_equiv_regs (void)
{
- rtx insn;
+ rtx_insn *insn;
basic_block bb;
int loop_depth;
bitmap cleared_regs;
FOR_EACH_BB_FN (bb, cfun)
FOR_BB_INSNS (bb, insn)
if (NONDEBUG_INSN_P (insn))
- for_each_rtx (&insn, set_paradoxical_subreg, (void *) pdx_subregs);
+ for_each_rtx_in_insn (&insn, set_paradoxical_subreg,
+ (void *) pdx_subregs);
/* Scan the insns and find which registers have equivalences. Do this
in a separate scan of the insns because (due to -fcse-follow-jumps)
&& ! contains_replace_regs (XEXP (dest, 0))
&& ! pdx_subregs[regno])
{
- rtx init_insn = XEXP (reg_equiv[regno].init_insns, 0);
+ rtx_insn *init_insn =
+ as_a <rtx_insn *> (XEXP (reg_equiv[regno].init_insns, 0));
if (validate_equiv_mem (init_insn, src, dest)
&& ! memref_used_between_p (dest, init_insn, insn)
/* Attaching a REG_EQUIV note will fail if INIT_INSN has
INSN. Update the flow information. */
else if (prev_nondebug_insn (insn) != equiv_insn)
{
- rtx new_insn;
+ rtx_insn *new_insn;
new_insn = emit_insn_before (PATTERN (equiv_insn), insn);
REG_NOTES (new_insn) = REG_NOTES (equiv_insn);
if (object)
{
if (object != last_object && last_object && INSN_P (last_object))
- df_insn_rescan (last_object);
+ df_insn_rescan (as_a <rtx_insn *> (last_object));
last_object = object;
}
}
if (last_object && INSN_P (last_object))
- df_insn_rescan (last_object);
+ df_insn_rescan (as_a <rtx_insn *> (last_object));
num_changes = 0;
}
peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev)
{
int i = peep2_buf_position (peep2_current + match_len + 1);
- rtx x;
+ rtx_insn *x;
regset_head live;
INIT_REG_SET (&live);
gcc_assert (peep2_current_count >= match_len + 1);
peep2_current_count -= match_len + 1;
- x = last;
+ x = as_a <rtx_insn *> (last);
do
{
if (INSN_P (x))
COPY_REG_SET (peep2_insn_data[pos].live_before, live);
peep2_current_count++;
- df_simulate_one_insn_forwards (bb, insn, live);
+ df_simulate_one_insn_forwards (bb, as_a <rtx_insn *> (insn), live);
return true;
}
/* In combine.c */
extern unsigned int extended_count (const_rtx, enum machine_mode, int);
-extern rtx remove_death (unsigned int, rtx);
+extern rtx remove_death (unsigned int, rtx_insn *);
extern void dump_combine_stats (FILE *);
extern void dump_combine_total_stats (FILE *);
extern rtx make_compound_operation (rtx, enum rtx_code);
extern int fixup_args_size_notes (rtx, rtx, int);
/* In cfgrtl.c */
-extern void print_rtl_with_bb (FILE *, const_rtx, int);
+extern void print_rtl_with_bb (FILE *, const rtx_insn *, int);
extern rtx_insn *duplicate_insn_chain (rtx_insn *, rtx_insn *);
/* In expmed.c */
{
case REG_EQUAL:
case REG_EQUIV:
- df_notes_rescan (insn);
+ df_notes_rescan (as_a <rtx_insn *> (insn));
break;
default:
break;
extern void *xrecalloc (void *, size_t, size_t, size_t);
-extern void reemit_notes (rtx);
+extern void reemit_notes (rtx_insn *);
/* Functions in haifa-sched.c. */
extern int haifa_classify_insn (const_rtx);
of THIS_BASIC_BLOCK. */
void
-propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src,
+propagate_for_debug (rtx_insn *insn, rtx last, rtx dest, rtx src,
basic_block this_basic_block)
{
- rtx next, loc, end = NEXT_INSN (BB_END (this_basic_block));
+ rtx_insn *next, *end = NEXT_INSN (BB_END (this_basic_block));
+ rtx loc;
rtx (*saved_rtl_hook_no_emit) (enum machine_mode, rtx);
struct rtx_subst_pair p;
unsigned int uregno, rtx insn,
enum debug_temp_where);
-extern void propagate_for_debug (rtx, rtx, rtx, rtx, basic_block);
+extern void propagate_for_debug (rtx_insn *, rtx, rtx, rtx, basic_block);
#endif /* GCC_VALTRACK_H */
TODO: "Scaffolding" to be removed
=================================
-* DF_REF_INSN
* SET_NEXT_INSN, SET_PREV_INSN