From dd60a84ce04bbd5f33d500135fc9911a26ada6e2 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 26 Aug 2014 18:03:09 +0000 Subject: [PATCH] cselib and incdec gcc/ * rtl.h (for_each_inc_dec): Strengthen param 1 from rtx * to rtx_insn **. (check_for_inc_dec): Strengthen param "insn" from rtx to rtx_insn *. * cselib.h (cselib_process_insn): Likewise. * cselib.c (cselib_record_sets): Likewise. (cselib_process_insn): Likewise. * dse.c (struct insn_info): Likewise for field "insn". (check_for_inc_dec_1): Likewise for local "insn". (check_for_inc_dec): Likewise for param "insn". (scan_insn): Likewise. (dse_step1): Likewise for local "insn". * rtlanal.c (for_each_inc_dec): Strengthen param 1 from rtx * to rtx_insn **. Use for_each_rtx_in_insn rather than for_each_rtx. From-SVN: r214531 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/cselib.c | 6 +++--- gcc/cselib.h | 2 +- gcc/dse.c | 10 +++++----- gcc/rtl.h | 4 ++-- gcc/rtlanal.c | 6 +++--- 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6fbdb788da..798c50f96a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2014-08-26 David Malcolm + + * rtl.h (for_each_inc_dec): Strengthen param 1 from rtx * to + rtx_insn **. + (check_for_inc_dec): Strengthen param "insn" from rtx to + rtx_insn *. + + * cselib.h (cselib_process_insn): Likewise. + + * cselib.c (cselib_record_sets): Likewise. + (cselib_process_insn): Likewise. + + * dse.c (struct insn_info): Likewise for field "insn". + (check_for_inc_dec_1): Likewise for local "insn". + (check_for_inc_dec): Likewise for param "insn". + (scan_insn): Likewise. + (dse_step1): Likewise for local "insn". + + * rtlanal.c (for_each_inc_dec): Strengthen param 1 from rtx * to + rtx_insn **. Use for_each_rtx_in_insn rather than for_each_rtx. + 2014-08-26 David Malcolm * sched-int.h (struct _dep): Strengthen fields "pro" and "con" diff --git a/gcc/cselib.c b/gcc/cselib.c index d069f1095dd..090cd35c33c 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -67,7 +67,7 @@ static cselib_val *cselib_lookup_mem (rtx, int); static void cselib_invalidate_regno (unsigned int, enum machine_mode); static void cselib_invalidate_mem (rtx); static void cselib_record_set (rtx, cselib_val *, cselib_val *); -static void cselib_record_sets (rtx); +static void cselib_record_sets (rtx_insn *); struct expand_value_data { @@ -2469,7 +2469,7 @@ cselib_record_autoinc_cb (rtx mem ATTRIBUTE_UNUSED, rtx op ATTRIBUTE_UNUSED, /* Record the effects of any sets and autoincs in INSN. */ static void -cselib_record_sets (rtx insn) +cselib_record_sets (rtx_insn *insn) { int n_sets = 0; int i; @@ -2627,7 +2627,7 @@ fp_setter_insn (rtx insn) /* Record the effects of INSN. */ void -cselib_process_insn (rtx insn) +cselib_process_insn (rtx_insn *insn) { int i; rtx x; diff --git a/gcc/cselib.h b/gcc/cselib.h index 785f3b6d293..62374c0d546 100644 --- a/gcc/cselib.h +++ b/gcc/cselib.h @@ -75,7 +75,7 @@ extern cselib_val *cselib_lookup_from_insn (rtx, enum machine_mode, extern void cselib_init (int); extern void cselib_clear_table (void); extern void cselib_finish (void); -extern void cselib_process_insn (rtx); +extern void cselib_process_insn (rtx_insn *); extern bool fp_setter_insn (rtx); extern enum machine_mode cselib_reg_set_mode (const_rtx); extern int rtx_equal_for_cselib_p (rtx, rtx); diff --git a/gcc/dse.c b/gcc/dse.c index 8c3d84143e4..4f07b3c6d96 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -379,7 +379,7 @@ struct insn_info bool contains_cselib_groups; /* The insn. */ - rtx insn; + rtx_insn *insn; /* The list of mem sets or mem clobbers that are contained in this insn. If the insn is deletable, it contains only one mem set. @@ -903,7 +903,7 @@ emit_inc_dec_insn_before (rtx mem ATTRIBUTE_UNUSED, static bool check_for_inc_dec_1 (insn_info_t insn_info) { - rtx insn = insn_info->insn; + rtx_insn *insn = insn_info->insn; rtx note = find_reg_note (insn, REG_INC, NULL_RTX); if (note) return for_each_inc_dec (&insn, emit_inc_dec_insn_before, insn_info) == 0; @@ -916,7 +916,7 @@ check_for_inc_dec_1 (insn_info_t insn_info) and add a parameter to this function so that it can be passed down in insn_info.fixed_regs_live. */ bool -check_for_inc_dec (rtx insn) +check_for_inc_dec (rtx_insn *insn) { struct insn_info insn_info; rtx note; @@ -2442,7 +2442,7 @@ copy_fixed_regs (const_bitmap in) non-register target. */ static void -scan_insn (bb_info_t bb_info, rtx insn) +scan_insn (bb_info_t bb_info, rtx_insn *insn) { rtx body; insn_info_t insn_info = (insn_info_t) pool_alloc (insn_info_pool); @@ -2708,7 +2708,7 @@ dse_step1 (void) if (bb->index >= NUM_FIXED_BLOCKS) { - rtx insn; + rtx_insn *insn; cse_store_info_pool = create_alloc_pool ("cse_store_info_pool", diff --git a/gcc/rtl.h b/gcc/rtl.h index ec4aa258f4b..076f1653b95 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2648,7 +2648,7 @@ extern int for_each_rtx_in_insn (rtx_insn **, rtx_function, void *); for_each_inc_dec. */ typedef int (*for_each_inc_dec_fn) (rtx mem, rtx op, rtx dest, rtx src, rtx srcoff, void *arg); -extern int for_each_inc_dec (rtx *, for_each_inc_dec_fn, void *arg); +extern int for_each_inc_dec (rtx_insn **, for_each_inc_dec_fn, void *arg); typedef int (*rtx_equal_p_callback_function) (const_rtx *, const_rtx *, rtx *, rtx *); @@ -3056,7 +3056,7 @@ extern int exp_equiv_p (const_rtx, const_rtx, int, bool); extern unsigned hash_rtx (const_rtx x, enum machine_mode, int *, int *, bool); /* In dse.c */ -extern bool check_for_inc_dec (rtx insn); +extern bool check_for_inc_dec (rtx_insn *insn); /* In jump.c */ extern int comparison_dominates_p (enum rtx_code, enum rtx_code); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 42378fbbe5c..996e0f78759 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -3120,7 +3120,7 @@ for_each_inc_dec_find_mem (rtx *r, void *d) return 0; } -/* Traverse *X looking for MEMs, and for autoinc operations within +/* Traverse *INSN looking for MEMs, and for autoinc operations within them. For each such autoinc operation found, call FN, passing it the innermost enclosing MEM, the operation itself, the RTX modified by the operation, two RTXs (the second may be NULL) that, once @@ -3131,7 +3131,7 @@ for_each_inc_dec_find_mem (rtx *r, void *d) for_each_inc_dec. */ int -for_each_inc_dec (rtx *x, +for_each_inc_dec (rtx_insn **insn, for_each_inc_dec_fn fn, void *arg) { @@ -3141,7 +3141,7 @@ for_each_inc_dec (rtx *x, data.arg = arg; data.mem = NULL; - return for_each_rtx (x, for_each_inc_dec_find_mem, &data); + return for_each_rtx_in_insn (insn, for_each_inc_dec_find_mem, &data); } -- 2.30.2