diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-22 18:12:28 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-22 18:12:28 +0000 |
commit | 3eeb4f9ab7055b331483f5e52b9a6d73268e41dd (patch) | |
tree | b829f3eb94775bdb055fb9b037e1c8d49a4a4825 | |
parent | ff395cd99b275350aab515d8d010b3c699d2d234 (diff) | |
download | gcc-3eeb4f9ab7055b331483f5e52b9a6d73268e41dd.tar.gz |
loop-iv.c: Use rtx_insn (also touches cfgloop.h and loop-unroll.c)
gcc/
* cfgloop.h (iv_analyze): Strengthen param 1 "insn" from rtx to
rtx_insn *.
(iv_analyze_result): Likewise.
(iv_analyze_expr): Likewise.
(biv_p): Likewise.
* loop-iv.c (iv_get_reaching_def): Strengthen param "insn" and
local "def_insn" from rtx to rtx_insn *.
(get_biv_step_1): Likewise for local "insn".
(iv_analyze_expr): Likewise for param "insn".
(iv_analyze_def): Likewise for local "insn".
(iv_analyze_op): Likewise for param "insn".
(iv_analyze): Likewise.
(iv_analyze_result): Likewise.
(biv_p): Likewise.
(suitable_set_for_replacement): Likewise.
(simplify_using_initial_values): Likewise for local "insn".
(iv_number_of_iterations): Likewise for param "insn".
(check_simple_exit): Add checked cast to rtx_insn when invoking
iv_number_of_iterations for now (until get_condition is
strengthened).
* loop-unroll.c (analyze_iv_to_split_insn): Strengthen param
"insn" from rtx to rtx_insn *.
(analyze_insns_in_loop): Likewise for local "insn".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214344 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 28 | ||||
-rw-r--r-- | gcc/cfgloop.h | 9 | ||||
-rw-r--r-- | gcc/loop-iv.c | 31 | ||||
-rw-r--r-- | gcc/loop-unroll.c | 6 |
4 files changed, 53 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4ee186b703a..c6b4d290528 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,33 @@ 2014-08-22 David Malcolm <dmalcolm@redhat.com> + * cfgloop.h (iv_analyze): Strengthen param 1 "insn" from rtx to + rtx_insn *. + (iv_analyze_result): Likewise. + (iv_analyze_expr): Likewise. + (biv_p): Likewise. + + * loop-iv.c (iv_get_reaching_def): Strengthen param "insn" and + local "def_insn" from rtx to rtx_insn *. + (get_biv_step_1): Likewise for local "insn". + (iv_analyze_expr): Likewise for param "insn". + (iv_analyze_def): Likewise for local "insn". + (iv_analyze_op): Likewise for param "insn". + (iv_analyze): Likewise. + (iv_analyze_result): Likewise. + (biv_p): Likewise. + (suitable_set_for_replacement): Likewise. + (simplify_using_initial_values): Likewise for local "insn". + (iv_number_of_iterations): Likewise for param "insn". + (check_simple_exit): Add checked cast to rtx_insn when invoking + iv_number_of_iterations for now (until get_condition is + strengthened). + + * loop-unroll.c (analyze_iv_to_split_insn): Strengthen param + "insn" from rtx to rtx_insn *. + (analyze_insns_in_loop): Likewise for local "insn". + +2014-08-22 David Malcolm <dmalcolm@redhat.com> + * loop-invariant.c (struct use): Strengthen field "insn" from rtx to rtx_insn *. (struct invariant): Likewise. diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 7d2c1de219d..b7f5d2a22a6 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -423,11 +423,12 @@ struct GTY(()) niter_desc }; extern void iv_analysis_loop_init (struct loop *); -extern bool iv_analyze (rtx, rtx, struct rtx_iv *); -extern bool iv_analyze_result (rtx, rtx, struct rtx_iv *); -extern bool iv_analyze_expr (rtx, rtx, enum machine_mode, struct rtx_iv *); +extern bool iv_analyze (rtx_insn *, rtx, struct rtx_iv *); +extern bool iv_analyze_result (rtx_insn *, rtx, struct rtx_iv *); +extern bool iv_analyze_expr (rtx_insn *, rtx, enum machine_mode, + struct rtx_iv *); extern rtx get_iv_value (struct rtx_iv *, rtx); -extern bool biv_p (rtx, rtx); +extern bool biv_p (rtx_insn *, rtx); extern void find_simple_exit (struct loop *, struct niter_desc *); extern void iv_analysis_done (void); diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 1c204e9c1da..7ff1accccc6 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -136,7 +136,7 @@ biv_entry_hasher::equal (const value_type *b, const compare_type *r) static hash_table<biv_entry_hasher> *bivs; -static bool iv_analyze_op (rtx, rtx, struct rtx_iv *); +static bool iv_analyze_op (rtx_insn *, rtx, struct rtx_iv *); /* Return the RTX code corresponding to the IV extend code EXTEND. */ static inline enum rtx_code @@ -339,11 +339,11 @@ latch_dominating_def (rtx reg, df_ref *def) /* Gets definition of REG reaching its use in INSN and stores it to DEF. */ static enum iv_grd_result -iv_get_reaching_def (rtx insn, rtx reg, df_ref *def) +iv_get_reaching_def (rtx_insn *insn, rtx reg, df_ref *def) { df_ref use, adef; basic_block def_bb, use_bb; - rtx def_insn; + rtx_insn *def_insn; bool dom_p; *def = NULL; @@ -650,7 +650,7 @@ get_biv_step_1 (df_ref def, rtx reg, rtx set, rhs, op0 = NULL_RTX, op1 = NULL_RTX; rtx next, nextr, tmp; enum rtx_code code; - rtx insn = DF_REF_INSN (def); + rtx_insn *insn = DF_REF_INSN (def); df_ref next_def; enum iv_grd_result res; @@ -946,7 +946,8 @@ iv_analyze_biv (rtx def, struct rtx_iv *iv) The mode of the induction variable is MODE. */ bool -iv_analyze_expr (rtx insn, rtx rhs, enum machine_mode mode, struct rtx_iv *iv) +iv_analyze_expr (rtx_insn *insn, rtx rhs, enum machine_mode mode, + struct rtx_iv *iv) { rtx mby = NULL_RTX, tmp; rtx op0 = NULL_RTX, op1 = NULL_RTX; @@ -1073,7 +1074,7 @@ iv_analyze_expr (rtx insn, rtx rhs, enum machine_mode mode, struct rtx_iv *iv) static bool iv_analyze_def (df_ref def, struct rtx_iv *iv) { - rtx insn = DF_REF_INSN (def); + rtx_insn *insn = DF_REF_INSN (def); rtx reg = DF_REF_REG (def); rtx set, rhs; @@ -1134,7 +1135,7 @@ iv_analyze_def (df_ref def, struct rtx_iv *iv) /* Analyzes operand OP of INSN and stores the result to *IV. */ static bool -iv_analyze_op (rtx insn, rtx op, struct rtx_iv *iv) +iv_analyze_op (rtx_insn *insn, rtx op, struct rtx_iv *iv) { df_ref def = NULL; enum iv_grd_result res; @@ -1192,7 +1193,7 @@ iv_analyze_op (rtx insn, rtx op, struct rtx_iv *iv) /* Analyzes value VAL at INSN and stores the result to *IV. */ bool -iv_analyze (rtx insn, rtx val, struct rtx_iv *iv) +iv_analyze (rtx_insn *insn, rtx val, struct rtx_iv *iv) { rtx reg; @@ -1217,7 +1218,7 @@ iv_analyze (rtx insn, rtx val, struct rtx_iv *iv) /* Analyzes definition of DEF in INSN and stores the result to IV. */ bool -iv_analyze_result (rtx insn, rtx def, struct rtx_iv *iv) +iv_analyze_result (rtx_insn *insn, rtx def, struct rtx_iv *iv) { df_ref adef; @@ -1233,7 +1234,7 @@ iv_analyze_result (rtx insn, rtx def, struct rtx_iv *iv) iv_analysis_loop_init) for this function to produce a result. */ bool -biv_p (rtx insn, rtx reg) +biv_p (rtx_insn *insn, rtx reg) { struct rtx_iv iv; df_ref def, last_def; @@ -1454,7 +1455,7 @@ replace_single_def_regs (rtx *reg, void *expr1) the set; return false otherwise. */ static bool -suitable_set_for_replacement (rtx insn, rtx *dest, rtx *src) +suitable_set_for_replacement (rtx_insn *insn, rtx *dest, rtx *src) { rtx set = single_set (insn); rtx lhs = NULL_RTX, rhs; @@ -1872,7 +1873,8 @@ static void simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) { bool expression_valid; - rtx head, tail, insn, cond_list, last_valid_expr; + rtx head, tail, cond_list, last_valid_expr; + rtx_insn *insn; rtx neutral, aggr; regset altered, this_altered; edge e; @@ -2323,7 +2325,7 @@ determine_max_iter (struct loop *loop, struct niter_desc *desc, rtx old_niter) (basically its rtl version), complicated by things like subregs. */ static void -iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, +iv_number_of_iterations (struct loop *loop, rtx_insn *insn, rtx condition, struct niter_desc *desc) { rtx op0, op1, delta, step, bound, may_xform, tmp, tmp0, tmp1; @@ -2929,7 +2931,8 @@ check_simple_exit (struct loop *loop, edge e, struct niter_desc *desc) /* Check that we are able to determine number of iterations and fill in information about it. */ - iv_number_of_iterations (loop, at, condition, desc); + iv_number_of_iterations (loop, safe_as_a <rtx_insn *> (at), + condition, desc); } /* Finds a simple exit of LOOP and stores its description into DESC. */ diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 707ffff70b0..1821ea0c44f 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -189,7 +189,7 @@ static void apply_opt_in_copies (struct opt_info *, unsigned, bool, bool); static void free_opt_info (struct opt_info *); static struct var_to_expand *analyze_insn_to_expand_var (struct loop*, rtx); static bool referenced_in_one_insn_in_loop_p (struct loop *, rtx, int *); -static struct iv_to_split *analyze_iv_to_split_insn (rtx); +static struct iv_to_split *analyze_iv_to_split_insn (rtx_insn *); static void expand_var_during_unrolling (struct var_to_expand *, rtx); static void insert_var_expansion_initialization (struct var_to_expand *, basic_block); @@ -1893,7 +1893,7 @@ analyze_insn_to_expand_var (struct loop *loop, rtx insn) pointer to it. */ static struct iv_to_split * -analyze_iv_to_split_insn (rtx insn) +analyze_iv_to_split_insn (rtx_insn *insn) { rtx set, dest; struct rtx_iv iv; @@ -1952,7 +1952,7 @@ analyze_insns_in_loop (struct loop *loop) basic_block *body, bb; unsigned i; struct opt_info *opt_info = XCNEW (struct opt_info); - rtx insn; + rtx_insn *insn; struct iv_to_split *ivts = NULL; struct var_to_expand *ves = NULL; iv_to_split **slot1; |