+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
};
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);
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
/* 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;
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;
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;
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;
/* 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;
/* 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;
/* 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;
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;
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;
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;
(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;
/* 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. */
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);
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;
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;