]> gcc.gnu.org Git - gcc.git/commitdiff
loop-iv.c: Use rtx_insn (also touches cfgloop.h and loop-unroll.c)
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 22 Aug 2014 18:12:28 +0000 (18:12 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 22 Aug 2014 18:12:28 +0000 (18:12 +0000)
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".

From-SVN: r214344

gcc/ChangeLog
gcc/cfgloop.h
gcc/loop-iv.c
gcc/loop-unroll.c

index 4ee186b703a081e7c0088e1a16125b661f194254..c6b4d2905289384415ea4c88eadc6b2b236f4790 100644 (file)
@@ -1,3 +1,31 @@
+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
index 7d2c1de219d44b716f24a4407c49428c5ccaa047..b7f5d2a22a6c154af41a23a0f4dc42452236301b 100644 (file)
@@ -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);
 
index 1c204e9c1dafde3197f63bf259c5176f630115c5..7ff1accccc6169cfd7b5cd9ff8658a13aff49d3f 100644 (file)
@@ -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.  */
index 707ffff70b066c1bf28427ddcb37527ad8970bbb..1821ea0c44ffda2539c33dd3a3abf9e2f5833457 100644 (file)
@@ -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;
This page took 0.128788 seconds and 5 git commands to generate.