2014-08-22 David Malcolm <dmalcolm@redhat.com>
+ * basic-block.h (basic_block split_edge_and_insert): Strengthen
+ param "insns" from rtx to rtx_insn *.
+
+ * loop-unroll.c (struct iv_to_split): Strengthen field "insn" from
+ rtx to rtx_insn *.
+ (struct iv_to_split): Likewise.
+ (loop_exit_at_end_p): Likewise for local "insn".
+ (split_edge_and_insert): Likewise for param "insns".
+ (compare_and_jump_seq): Likewise for return type, param "cinsn",
+ and locals "seq", "jump".
+ (unroll_loop_runtime_iterations): Likewise for locals "init_code",
+ "branch_code"; update invocations of compare_and_jump_seq to
+ eliminate NULL_RTX in favor of NULL.
+ (referenced_in_one_insn_in_loop_p): Strengthen local "insn" from
+ rtx to rtx_insn *.
+ (reset_debug_uses_in_loop): Likewise.
+ (analyze_insn_to_expand_var): Likewise for param "insn".
+ (analyze_iv_to_split_insn): Likewise.
+ (analyze_insns_in_loop): Likewise for local "insn".
+ (insert_base_initialization): Likewise for param
+ "insn" and local "seq".
+ (split_iv): Likewise for param "insn" and local "seq".
+ (expand_var_during_unrolling): Likewise for param "insn".
+ (insert_var_expansion_initialization): Likewise for local "seq".
+ (combine_var_copies_in_loop_exit): Likewise.
+ (combine_var_copies_in_loop_exit): Likewise for locals "seq" and
+ "insn".
+ (maybe_strip_eq_note_for_split_iv): Likewise for param "insn".
+ (apply_opt_in_copies): Likewise for locals "insn", "orig_insn",
+ "next".
+
+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.
struct iv_to_split
{
- rtx insn; /* The insn in that the induction variable occurs. */
+ rtx_insn *insn; /* The insn in that the induction variable occurs. */
rtx orig_var; /* The variable (register) for the IV before split. */
rtx base_var; /* The variable on that the values in the further
iterations are based. */
struct var_to_expand
{
- rtx insn; /* The insn in that the variable expansion occurs. */
+ rtx_insn *insn; /* The insn in that the variable expansion occurs. */
rtx reg; /* The accumulator which is expanded. */
vec<rtx> var_expansions; /* The copies of the accumulator which is expanded. */
struct var_to_expand *next; /* Next entry in walking order. */
static void opt_info_start_duplication (struct opt_info *);
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 struct var_to_expand *analyze_insn_to_expand_var (struct loop*, rtx_insn *);
static bool referenced_in_one_insn_in_loop_p (struct loop *, rtx, int *);
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 expand_var_during_unrolling (struct var_to_expand *, rtx_insn *);
static void insert_var_expansion_initialization (struct var_to_expand *,
basic_block);
static void combine_var_copies_in_loop_exit (struct var_to_expand *,
loop_exit_at_end_p (struct loop *loop)
{
struct niter_desc *desc = get_simple_loop_desc (loop);
- rtx insn;
+ rtx_insn *insn;
if (desc->in_edge->dest != loop->latch)
return false;
and NULL is returned instead. */
basic_block
-split_edge_and_insert (edge e, rtx insns)
+split_edge_and_insert (edge e, rtx_insn *insns)
{
basic_block bb;
true, with probability PROB. If CINSN is not NULL, it is the insn to copy
in order to create a jump. */
-static rtx
+static rtx_insn *
compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob,
- rtx cinsn)
+ rtx_insn *cinsn)
{
- rtx seq, jump, cond;
+ rtx_insn *seq, *jump;
+ rtx cond;
enum machine_mode mode;
mode = GET_MODE (op0);
static void
unroll_loop_runtime_iterations (struct loop *loop)
{
- rtx old_niter, niter, init_code, branch_code, tmp;
+ rtx old_niter, niter, tmp;
+ rtx_insn *init_code, *branch_code;
unsigned i, j, p;
basic_block preheader, *body, swtch, ezc_swtch;
sbitmap wont_exit;
preheader = split_edge (loop_preheader_edge (loop));
branch_code = compare_and_jump_seq (copy_rtx (niter), GEN_INT (j), EQ,
block_label (preheader), p,
- NULL_RTX);
+ NULL);
/* We rely on the fact that the compare and jump cannot be optimized out,
and hence the cfg we create is correct. */
preheader = split_edge (loop_preheader_edge (loop));
branch_code = compare_and_jump_seq (copy_rtx (niter), const0_rtx, EQ,
block_label (preheader), p,
- NULL_RTX);
+ NULL);
gcc_assert (branch_code != NULL_RTX);
swtch = split_edge_and_insert (single_succ_edge (swtch), branch_code);
basic_block *body, bb;
unsigned i;
int count_ref = 0;
- rtx insn;
+ rtx_insn *insn;
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
{
basic_block *body, bb;
unsigned i;
- rtx insn;
+ rtx_insn *insn;
body = get_loop_body (loop);
for (i = 0; debug_uses && i < loop->num_nodes; i++)
*/
static struct var_to_expand *
-analyze_insn_to_expand_var (struct loop *loop, rtx insn)
+analyze_insn_to_expand_var (struct loop *loop, rtx_insn *insn)
{
rtx set, dest, src;
struct var_to_expand *ves;
the initial value from INSN. */
static void
-insert_base_initialization (struct iv_to_split *ivts, rtx insn)
+insert_base_initialization (struct iv_to_split *ivts, rtx_insn *insn)
{
rtx expr = copy_rtx (SET_SRC (single_set (insn)));
- rtx seq;
+ rtx_insn *seq;
start_sequence ();
expr = force_operand (expr, ivts->base_var);
by base variable + DELTA * step. */
static void
-split_iv (struct iv_to_split *ivts, rtx insn, unsigned delta)
+split_iv (struct iv_to_split *ivts, rtx_insn *insn, unsigned delta)
{
- rtx expr, *loc, seq, incr, var;
+ rtx expr, *loc, incr, var;
+ rtx_insn *seq;
enum machine_mode mode = GET_MODE (ivts->base_var);
rtx src, dest, set;
with a new register. */
static void
-expand_var_during_unrolling (struct var_to_expand *ve, rtx insn)
+expand_var_during_unrolling (struct var_to_expand *ve, rtx_insn *insn)
{
rtx new_reg, set;
bool really_new_expansion = false;
insert_var_expansion_initialization (struct var_to_expand *ve,
basic_block place)
{
- rtx seq, var, zero_init;
+ rtx_insn *seq;
+ rtx var, zero_init;
unsigned i;
enum machine_mode mode = GET_MODE (ve->reg);
bool honor_signed_zero_p = HONOR_SIGNED_ZEROS (mode);
combine_var_copies_in_loop_exit (struct var_to_expand *ve, basic_block place)
{
rtx sum = ve->reg;
- rtx expr, seq, var, insn;
+ rtx expr, var;
+ rtx_insn *seq, *insn;
unsigned i;
if (ve->var_expansions.length () == 0)
any notes attached to them. So resort to old techniques... */
static void
-maybe_strip_eq_note_for_split_iv (struct opt_info *opt_info, rtx insn)
+maybe_strip_eq_note_for_split_iv (struct opt_info *opt_info, rtx_insn *insn)
{
struct iv_to_split *ivts;
rtx note = find_reg_equal_equiv_note (insn);
{
unsigned i, delta;
basic_block bb, orig_bb;
- rtx insn, orig_insn, next;
+ rtx_insn *insn, *orig_insn, *next;
struct iv_to_split ivts_templ, *ivts;
struct var_to_expand ve_templ, *ves;