rtlanal.c (add_reg_note): New function.

* rtlanal.c (add_reg_note): New function.
	* rtl.h (add_reg_note): Declare.
	* auto-inc-dec.c (attempt_change): Use add_reg_note.
	* bb-reorder.c (add_reg_crossing_jump_notes): Likewise.
	* builtins.c (expand_builtin_longjmp): Likewise.
	(expand_builtin_nonlocal_goto): Likewise.
	* calls.c (emit_call_1, expand_call): Likewise.
	* cfgexpand.c (add_reg_br_prob_note): Likewise.
	* cfglayout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	(commit_one_edge_insertion): Likewise.
	* combine.c (move_deaths, distribute_notes): Likewise.
	* df-problems.c (df_set_note): Likewise.
	* emit-rtl.c (link_cc0_insns, try_split): Likewise.
	(set_unique_reg_note): Likewise.
	(emit_copy_of_insn_after): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* gcse.c (add_label_notes): Likewise.
	* haifa-sched.c (create_check_block_twin): Likewise.
	* jump.c (mark_jump_label_1): Likewise.
	* loop-doloop.c (add_test, doloop_modify): Likewise.
	* loop-unswitch.c (compare_and_jump_seq): Likewise.
	* lower-subreg.c (move_eh_region_note): Likewise.
	* optabs.c (emit_libcall_block): Likewise.
	* predict.c (predict_insn): Likewise.
	(combine_predictions_for_insn): Likewise.
	* recog.c (peephole2_optimize): Likewise.
	* regmove.c (try_auto_increment): Likewise.
	* reg-stack.c (emit_pop_insn, move_for_stack_reg): Likewise.
	* reload.c (find_reloads): Likewise.
	* reload1.c (fixup_eh_region_note): Likewise.
	(reload_as_needed, add_auto_inc_notes, copy_eh_notes): Likewise.
	* reorg.c (delete_prior_computation): Likewise.
	(delete_computation, dbr_schedule): Likewise.
	* config/pa/pa.c (legitimize_pic_address): Likewise.
	* config/sh/sh.c (sh_reorg): Likewise.

From-SVN: r137374
This commit is contained in:
Ian Lance Taylor 2008-07-02 18:01:18 +00:00 committed by Ian Lance Taylor
parent ff47328005
commit 65c5f2a63f
30 changed files with 137 additions and 160 deletions

View File

@ -1,3 +1,42 @@
2008-07-02 Ian Lance Taylor <iant@google.com>
* rtlanal.c (add_reg_note): New function.
* rtl.h (add_reg_note): Declare.
* auto-inc-dec.c (attempt_change): Use add_reg_note.
* bb-reorder.c (add_reg_crossing_jump_notes): Likewise.
* builtins.c (expand_builtin_longjmp): Likewise.
(expand_builtin_nonlocal_goto): Likewise.
* calls.c (emit_call_1, expand_call): Likewise.
* cfgexpand.c (add_reg_br_prob_note): Likewise.
* cfglayout.c (fixup_reorder_chain): Likewise.
* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
(commit_one_edge_insertion): Likewise.
* combine.c (move_deaths, distribute_notes): Likewise.
* df-problems.c (df_set_note): Likewise.
* emit-rtl.c (link_cc0_insns, try_split): Likewise.
(set_unique_reg_note): Likewise.
(emit_copy_of_insn_after): Likewise.
* expr.c (expand_expr_real): Likewise.
* gcse.c (add_label_notes): Likewise.
* haifa-sched.c (create_check_block_twin): Likewise.
* jump.c (mark_jump_label_1): Likewise.
* loop-doloop.c (add_test, doloop_modify): Likewise.
* loop-unswitch.c (compare_and_jump_seq): Likewise.
* lower-subreg.c (move_eh_region_note): Likewise.
* optabs.c (emit_libcall_block): Likewise.
* predict.c (predict_insn): Likewise.
(combine_predictions_for_insn): Likewise.
* recog.c (peephole2_optimize): Likewise.
* regmove.c (try_auto_increment): Likewise.
* reg-stack.c (emit_pop_insn, move_for_stack_reg): Likewise.
* reload.c (find_reloads): Likewise.
* reload1.c (fixup_eh_region_note): Likewise.
(reload_as_needed, add_auto_inc_notes, copy_eh_notes): Likewise.
* reorg.c (delete_prior_computation): Likewise.
(delete_computation, dbr_schedule): Likewise.
* config/pa/pa.c (legitimize_pic_address): Likewise.
* config/sh/sh.c (sh_reorg): Likewise.
2008-07-02 H.J. Lu <hongjiu.lu@intel.com>
PR target/36669

View File

@ -621,8 +621,7 @@ attempt_change (rtx new_addr, rtx inc_reg)
}
/* Record that this insn has an implicit side effect. */
REG_NOTES (mem_insn.insn)
= alloc_EXPR_LIST (REG_INC, inc_reg, REG_NOTES (mem_insn.insn));
add_reg_note (mem_insn.insn, REG_INC, inc_reg);
if (dump_file)
{

View File

@ -1785,10 +1785,7 @@ add_reg_crossing_jump_notes (void)
FOR_EACH_EDGE (e, ei, bb->succs)
if ((e->flags & EDGE_CROSSING)
&& JUMP_P (BB_END (e->src)))
REG_NOTES (BB_END (e->src)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP,
NULL_RTX,
REG_NOTES (BB_END
(e->src)));
add_reg_note (BB_END (e->src), REG_CROSSING_JUMP, NULL_RTX);
}
/* Hot and cold basic blocks are partitioned and put in separate

View File

@ -845,8 +845,7 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
if (JUMP_P (insn))
{
REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
REG_NOTES (insn));
add_reg_note (insn, REG_NON_LOCAL_GOTO, const0_rtx);
break;
}
else if (CALL_P (insn))
@ -929,8 +928,7 @@ expand_builtin_nonlocal_goto (tree exp)
{
if (JUMP_P (insn))
{
REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO,
const0_rtx, REG_NOTES (insn));
add_reg_note (insn, REG_NON_LOCAL_GOTO, const0_rtx);
break;
}
else if (CALL_P (insn))

View File

@ -377,8 +377,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
/* If this call can't throw, attach a REG_EH_REGION reg note to that
effect. */
if (ecf_flags & ECF_NOTHROW)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, const0_rtx,
REG_NOTES (call_insn));
add_reg_note (call_insn, REG_EH_REGION, const0_rtx);
else
{
int rn = lookup_stmt_eh_region (fntree);
@ -386,18 +385,15 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
/* If rn < 0, then either (1) tree-ssa not used or (2) doesn't
throw, which we already took care of. */
if (rn > 0)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, GEN_INT (rn),
REG_NOTES (call_insn));
add_reg_note (call_insn, REG_EH_REGION, GEN_INT (rn));
}
if (ecf_flags & ECF_NORETURN)
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_NORETURN, const0_rtx,
REG_NOTES (call_insn));
add_reg_note (call_insn, REG_NORETURN, const0_rtx);
if (ecf_flags & ECF_RETURNS_TWICE)
{
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx,
REG_NOTES (call_insn));
add_reg_note (call_insn, REG_SETJMP, const0_rtx);
cfun->calls_setjmp = 1;
}
@ -2814,8 +2810,7 @@ expand_call (tree exp, rtx target, int ignore)
/* The return value from a malloc-like function can not alias
anything else. */
last = get_last_insn ();
REG_NOTES (last) =
gen_rtx_EXPR_LIST (REG_NOALIAS, temp, REG_NOTES (last));
add_reg_note (last, REG_NOALIAS, temp);
/* Write out the sequence. */
insns = get_insns ();

View File

@ -67,18 +67,14 @@ add_reg_br_prob_note (rtx last, int probability)
|| NEXT_INSN (NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))))
goto failed;
gcc_assert (!find_reg_note (last, REG_BR_PROB, 0));
REG_NOTES (last)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (REG_BR_PROB_BASE - probability),
REG_NOTES (last));
add_reg_note (last, REG_BR_PROB,
GEN_INT (REG_BR_PROB_BASE - probability));
return;
}
if (!last || !JUMP_P (last) || !any_condjump_p (last))
goto failed;
gcc_assert (!find_reg_note (last, REG_BR_PROB, 0));
REG_NOTES (last)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (probability), REG_NOTES (last));
add_reg_note (last, REG_BR_PROB, GEN_INT (probability));
return;
failed:
if (dump_file)

View File

@ -855,8 +855,7 @@ fixup_reorder_chain (void)
&& JUMP_P (BB_END (bb))
&& !any_condjump_p (BB_END (bb))
&& (EDGE_SUCC (bb, 0)->flags & EDGE_CROSSING))
REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST
(REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb)));
add_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX);
}
}

View File

@ -1111,11 +1111,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
&& JUMP_P (BB_END (jump_block))
&& !any_condjump_p (BB_END (jump_block))
&& (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING))
REG_NOTES (BB_END (jump_block)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP,
NULL_RTX,
REG_NOTES
(BB_END
(jump_block)));
add_reg_note (BB_END (jump_block), REG_CROSSING_JUMP, NULL_RTX);
/* Wire edge in. */
new_edge = make_edge (e->src, jump_block, EDGE_FALLTHRU);
@ -1418,8 +1414,7 @@ commit_one_edge_insertion (edge e)
if (JUMP_P (BB_END (bb))
&& !any_condjump_p (BB_END (bb))
&& (single_succ_edge (bb)->flags & EDGE_CROSSING))
REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST
(REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb)));
add_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX);
}
}
}

View File

@ -12149,10 +12149,7 @@ move_deaths (rtx x, rtx maybe_kill_insn, int from_luid, rtx to_insn,
for (i = deadregno; i < deadend; i++)
if (i < regno || i >= ourend)
REG_NOTES (where_dead)
= gen_rtx_EXPR_LIST (REG_DEAD,
regno_reg_rtx[i],
REG_NOTES (where_dead));
add_reg_note (where_dead, REG_DEAD, regno_reg_rtx[i]);
}
/* If we didn't find any note, or if we found a REG_DEAD note that
@ -12774,9 +12771,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
|| reg_bitfield_target_p (piece,
PATTERN (tem)))
{
REG_NOTES (tem)
= gen_rtx_EXPR_LIST (REG_UNUSED, piece,
REG_NOTES (tem));
add_reg_note (tem, REG_UNUSED, piece);
break;
}
}

View File

@ -694,8 +694,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
orig = XEXP (XEXP (orig, 0), 0);
/* Extract CODE_LABEL. */
orig = XEXP (orig, 0);
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, orig,
REG_NOTES (insn));
add_reg_note (insn, REG_LABEL_OPERAND, orig);
LABEL_NUSES (orig)++;
}
crtl->uses_pic_offset_table = 1;

View File

@ -4983,10 +4983,8 @@ sh_reorg (void)
or pseudo-op. */
label = gen_label_rtx ();
REG_NOTES (link) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label,
REG_NOTES (link));
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label,
REG_NOTES (insn));
add_reg_note (link, REG_LABEL_OPERAND, label);
add_reg_note (insn, REG_LABEL_OPERAND, label);
if (rescan)
{
scan = link;
@ -5000,9 +4998,7 @@ sh_reorg (void)
&& reg_mentioned_p (reg, scan))
|| ((reg2 = sfunc_uses_reg (scan))
&& REGNO (reg2) == REGNO (reg))))
REG_NOTES (scan)
= gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label,
REG_NOTES (scan));
add_reg_note (scan, REG_LABEL_OPERAND, label);
}
while (scan != dies);
}

View File

@ -3191,7 +3191,7 @@ df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg)
}
/* Did not find the note. */
REG_NOTES (insn) = alloc_EXPR_LIST (note_type, reg, REG_NOTES (insn));
add_reg_note (insn, note_type, reg);
return old;
}

View File

@ -3044,9 +3044,8 @@ link_cc0_insns (rtx insn)
if (NONJUMP_INSN_P (user) && GET_CODE (PATTERN (user)) == SEQUENCE)
user = XVECEXP (PATTERN (user), 0, 0);
REG_NOTES (user) = gen_rtx_INSN_LIST (REG_CC_SETTER, insn,
REG_NOTES (user));
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_CC_USER, user, REG_NOTES (insn));
add_reg_note (user, REG_CC_SETTER, insn);
add_reg_note (insn, REG_CC_USER, user);
}
/* Return the next insn that uses CC0 after INSN, which is assumed to
@ -3223,10 +3222,7 @@ try_split (rtx pat, rtx trial, int last)
is responsible for this step using
split_branch_probability variable. */
gcc_assert (njumps == 1);
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (probability),
REG_NOTES (insn));
add_reg_note (insn, REG_BR_PROB, GEN_INT (probability));
}
}
}
@ -3257,10 +3253,7 @@ try_split (rtx pat, rtx trial, int last)
if (CALL_P (insn)
|| (flag_non_call_exceptions && INSN_P (insn)
&& may_trap_p (PATTERN (insn))))
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_EH_REGION,
XEXP (note, 0),
REG_NOTES (insn));
add_reg_note (insn, REG_EH_REGION, XEXP (note, 0));
}
break;
@ -3269,10 +3262,7 @@ try_split (rtx pat, rtx trial, int last)
for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn))
{
if (CALL_P (insn))
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
XEXP (note, 0),
REG_NOTES (insn));
add_reg_note (insn, REG_NOTE_KIND (note), XEXP (note, 0));
}
break;
@ -3280,10 +3270,7 @@ try_split (rtx pat, rtx trial, int last)
for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn))
{
if (JUMP_P (insn))
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
XEXP (note, 0),
REG_NOTES (insn));
add_reg_note (insn, REG_NOTE_KIND (note), XEXP (note, 0));
}
break;
@ -3294,8 +3281,7 @@ try_split (rtx pat, rtx trial, int last)
rtx reg = XEXP (note, 0);
if (!FIND_REG_INC_NOTE (insn, reg)
&& for_each_rtx (&PATTERN (insn), find_auto_inc, reg) > 0)
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_INC, reg,
REG_NOTES (insn));
add_reg_note (insn, REG_INC, reg);
}
break;
#endif
@ -4600,7 +4586,6 @@ rtx
set_unique_reg_note (rtx insn, enum reg_note kind, rtx datum)
{
rtx note = find_reg_note (insn, kind, NULL_RTX);
rtx new_note = NULL;
switch (kind)
{
@ -4638,8 +4623,7 @@ set_unique_reg_note (rtx insn, enum reg_note kind, rtx datum)
break;
}
new_note = gen_rtx_EXPR_LIST (kind, datum, REG_NOTES (insn));
REG_NOTES (insn) = new_note;
add_reg_note (insn, kind, datum);
switch (kind)
{
@ -5525,13 +5509,10 @@ emit_copy_of_insn_after (rtx insn, rtx after)
if (REG_NOTE_KIND (link) != REG_LABEL_OPERAND)
{
if (GET_CODE (link) == EXPR_LIST)
REG_NOTES (new)
= gen_rtx_EXPR_LIST (REG_NOTE_KIND (link),
copy_insn_1 (XEXP (link, 0)), REG_NOTES (new));
add_reg_note (new, REG_NOTE_KIND (link),
copy_insn_1 (XEXP (link, 0)));
else
REG_NOTES (new)
= gen_rtx_INSN_LIST (REG_NOTE_KIND (link),
XEXP (link, 0), REG_NOTES (new));
add_reg_note (new, REG_NOTE_KIND (link), XEXP (link, 0));
}
INSN_CODE (new) = INSN_CODE (insn);

View File

@ -7102,10 +7102,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
&& GET_CODE (PATTERN (insn)) != CLOBBER
&& GET_CODE (PATTERN (insn)) != USE
&& (CALL_P (insn) || may_trap_p (PATTERN (insn))))
{
REG_NOTES (insn) = alloc_EXPR_LIST (REG_EH_REGION, GEN_INT (rn),
REG_NOTES (insn));
}
add_reg_note (insn, REG_EH_REGION, GEN_INT (rn));
}
}

View File

@ -4562,9 +4562,8 @@ add_label_notes (rtx x, rtx insn)
such a LABEL_REF, so we don't have to handle REG_LABEL_TARGET
notes. */
gcc_assert (!JUMP_P (insn));
REG_NOTES (insn)
= gen_rtx_INSN_LIST (REG_LABEL_OPERAND, XEXP (x, 0),
REG_NOTES (insn));
add_reg_note (insn, REG_LABEL_OPERAND, XEXP (x, 0));
if (LABEL_P (XEXP (x, 0)))
LABEL_NUSES (XEXP (x, 0))++;

View File

@ -3773,11 +3773,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
/* any_condjump_p (jump) == false.
We don't need the same note for the check because
any_condjump_p (check) == true. */
{
REG_NOTES (jump) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP,
NULL_RTX,
REG_NOTES (jump));
}
add_reg_note (jump, REG_CROSSING_JUMP, NULL_RTX);
edge_flags = EDGE_CROSSING;
}
else

View File

@ -1068,8 +1068,7 @@ mark_jump_label_1 (rtx x, rtx insn, bool in_mem, bool is_target)
a label, except for the primary target of a jump,
must have such a note. */
if (! find_reg_note (insn, kind, label))
REG_NOTES (insn)
= gen_rtx_INSN_LIST (kind, label, REG_NOTES (insn));
add_reg_note (insn, kind, label);
}
}
return;

View File

@ -321,9 +321,8 @@ add_test (rtx cond, edge *e, basic_block dest)
JUMP_LABEL (jump) = label;
/* The jump is supposed to handle an unlikely special case. */
REG_NOTES (jump)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
const0_rtx, REG_NOTES (jump));
add_reg_note (jump, REG_BR_PROB, const0_rtx);
LABEL_NUSES (label)++;
make_edge (bb, dest, (*e)->flags & ~EDGE_FALLTHRU);
@ -518,18 +517,14 @@ doloop_modify (struct loop *loop, struct niter_desc *desc,
/* Add a REG_NONNEG note if the actual or estimated maximum number
of iterations is non-negative. */
if (nonneg)
{
REG_NOTES (jump_insn)
= gen_rtx_EXPR_LIST (REG_NONNEG, NULL_RTX, REG_NOTES (jump_insn));
}
add_reg_note (jump_insn, REG_NONNEG, NULL_RTX);
/* Update the REG_BR_PROB note. */
if (true_prob_val)
{
/* Seems safer to use the branch probability. */
REG_NOTES (jump_insn) =
gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (desc->in_edge->probability),
REG_NOTES (jump_insn));
add_reg_note (jump_insn, REG_BR_PROB,
GEN_INT (desc->in_edge->probability));
}
}

View File

@ -125,8 +125,8 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob,
JUMP_LABEL (jump) = label;
LABEL_NUSES (label)++;
}
REG_NOTES (jump) = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
REG_NOTES (jump));
add_reg_note (jump, REG_BR_PROB, GEN_INT (prob));
seq = get_insns ();
end_sequence ();

View File

@ -551,8 +551,7 @@ move_eh_region_note (rtx insn, rtx insns)
|| (flag_non_call_exceptions
&& INSN_P (p)
&& may_trap_p (PATTERN (p))))
REG_NOTES (p) = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (note, 0),
REG_NOTES (p));
add_reg_note (p, REG_EH_REGION, XEXP (note, 0));
}
}

View File

@ -3879,8 +3879,7 @@ emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
if (note != 0)
XEXP (note, 0) = constm1_rtx;
else
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_REGION, constm1_rtx,
REG_NOTES (insn));
add_reg_note (insn, REG_EH_REGION, constm1_rtx);
}
/* First emit all insns that set pseudos. Remove them from the list as

View File

@ -263,12 +263,10 @@ predict_insn (rtx insn, enum br_predictor predictor, int probability)
if (!flag_guess_branch_prob)
return;
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_BR_PRED,
gen_rtx_CONCAT (VOIDmode,
GEN_INT ((int) predictor),
GEN_INT ((int) probability)),
REG_NOTES (insn));
add_reg_note (insn, REG_BR_PRED,
gen_rtx_CONCAT (VOIDmode,
GEN_INT ((int) predictor),
GEN_INT ((int) probability)));
}
/* Predict insn by given predictor. */
@ -561,9 +559,7 @@ combine_predictions_for_insn (rtx insn, basic_block bb)
if (!prob_note)
{
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (combined_probability), REG_NOTES (insn));
add_reg_note (insn, REG_BR_PROB, GEN_INT (combined_probability));
/* Save the prediction into CFG in case we are seeing non-degenerated
conditional jump. */

View File

@ -3045,10 +3045,9 @@ peephole2_optimize (void)
{
case REG_NORETURN:
case REG_SETJMP:
REG_NOTES (new_insn)
= gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
XEXP (note, 0),
REG_NOTES (new_insn));
add_reg_note (new_insn, REG_NOTE_KIND (note),
XEXP (note, 0));
break;
default:
/* Discard all other reg notes. */
break;
@ -3096,10 +3095,7 @@ peephole2_optimize (void)
&& !find_reg_note (x, REG_EH_REGION, NULL)))
{
if (note)
REG_NOTES (x)
= gen_rtx_EXPR_LIST (REG_EH_REGION,
XEXP (note, 0),
REG_NOTES (x));
add_reg_note (x, REG_EH_REGION, XEXP (note, 0));
if (x != BB_END (bb) && eh_edge)
{

View File

@ -788,9 +788,7 @@ emit_pop_insn (rtx insn, stack regstack, rtx reg, enum emit_where where)
else
pop_insn = emit_insn_before (pop_rtx, insn);
REG_NOTES (pop_insn)
= gen_rtx_EXPR_LIST (REG_DEAD, FP_MODE_REG (FIRST_STACK_REG, DFmode),
REG_NOTES (pop_insn));
add_reg_note (pop_insn, REG_DEAD, FP_MODE_REG (FIRST_STACK_REG, DFmode));
regstack->reg[regstack->top - (hard_regno - FIRST_STACK_REG)]
= regstack->reg[regstack->top];
@ -1064,8 +1062,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
push_rtx = gen_movxf (top_stack_reg, top_stack_reg);
emit_insn_before (push_rtx, insn);
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD, top_stack_reg,
REG_NOTES (insn));
add_reg_note (insn, REG_DEAD, top_stack_reg);
}
replace_reg (psrc, FIRST_STACK_REG);

View File

@ -200,9 +200,8 @@ try_auto_increment (rtx insn, rtx inc_insn, rtx inc_insn_set, rtx reg,
if (note)
PUT_MODE (note, REG_UNUSED);
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_INC,
reg, REG_NOTES (insn));
add_reg_note (insn, REG_INC, reg);
if (! inc_insn_set)
delete_insn (inc_insn);
return 1;

View File

@ -4145,9 +4145,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
&& (!JUMP_P (insn)
|| !label_is_jump_target_p (XEXP (substitution, 0),
insn)))
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND,
XEXP (substitution, 0),
REG_NOTES (insn));
add_reg_note (insn, REG_LABEL_OPERAND, XEXP (substitution, 0));
}
else
retval |= (substed_operand[i] != *recog_data.operand_loc[i]);

View File

@ -4000,8 +4000,7 @@ fixup_eh_region_note (rtx insn, rtx prev, rtx next)
if (INSN_P (i) && i != insn && may_trap_p (PATTERN (i)))
{
trap_count++;
REG_NOTES (i)
= gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (note, 0), REG_NOTES (i));
add_reg_note (i, REG_EH_REGION, XEXP (note, 0));
}
}
@ -4235,9 +4234,7 @@ reload_as_needed (int live_known)
}
if (n == 1)
{
REG_NOTES (p)
= gen_rtx_EXPR_LIST (REG_INC, reload_reg,
REG_NOTES (p));
add_reg_note (p, REG_INC, reload_reg);
/* Mark this as having an output reload so that the
REG_INC processing code below won't invalidate
the reload for inheritance. */
@ -8535,8 +8532,7 @@ add_auto_inc_notes (rtx insn, rtx x)
if (code == MEM && auto_inc_p (XEXP (x, 0)))
{
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_INC, XEXP (XEXP (x, 0), 0), REG_NOTES (insn));
add_reg_note (insn, REG_INC, XEXP (XEXP (x, 0), 0));
return;
}
@ -8563,9 +8559,7 @@ copy_eh_notes (rtx insn, rtx x)
for (; x != 0; x = NEXT_INSN (x))
{
if (may_trap_p (PATTERN (x)))
REG_NOTES (x)
= gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (eh_note, 0),
REG_NOTES (x));
add_reg_note (x, REG_EH_REGION, XEXP (eh_note, 0));
}
}
}

View File

@ -3217,9 +3217,7 @@ delete_prior_computation (rtx note, rtx insn)
{
int i;
REG_NOTES (our_prev)
= gen_rtx_EXPR_LIST (REG_UNUSED, reg,
REG_NOTES (our_prev));
add_reg_note (our_prev, REG_UNUSED, reg);
for (i = dest_regno; i < dest_endregno; i++)
if (! find_regno_note (our_prev, REG_UNUSED, i))
@ -3281,8 +3279,7 @@ delete_computation (rtx insn)
delete_computation (prev);
else
/* Otherwise, show that cc0 won't be used. */
REG_NOTES (prev) = gen_rtx_EXPR_LIST (REG_UNUSED,
cc0_rtx, REG_NOTES (prev));
add_reg_note (prev, REG_UNUSED, cc0_rtx);
}
}
#endif
@ -4024,9 +4021,7 @@ dbr_schedule (rtx first)
continue;
pred_flags = get_jump_flags (insn, JUMP_LABEL (insn));
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_BR_PRED,
GEN_INT (pred_flags),
REG_NOTES (insn));
add_reg_note (insn, REG_BR_PRED, GEN_INT (pred_flags));
}
free_resource_info ();
free (uid_to_ruid);

View File

@ -1755,6 +1755,7 @@ extern rtx find_reg_equal_equiv_note (const_rtx);
extern rtx find_constant_src (const_rtx);
extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
extern void add_reg_note (rtx, enum reg_note, rtx);
extern void remove_note (rtx, const_rtx);
extern void remove_reg_equal_equiv_notes (rtx);
extern int side_effects_p (const_rtx);

View File

@ -1842,6 +1842,34 @@ find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno)
}
/* Add register note with kind KIND and datum DATUM to INSN. */
void
add_reg_note (rtx insn, enum reg_note kind, rtx datum)
{
rtx note;
switch (kind)
{
case REG_CC_SETTER:
case REG_CC_USER:
case REG_LABEL_TARGET:
case REG_LABEL_OPERAND:
/* These types of register notes use an INSN_LIST rather than an
EXPR_LIST, so that copying is done right and dumps look
better. */
note = alloc_INSN_LIST (datum, REG_NOTES (insn));
PUT_REG_NOTE_KIND (note, kind);
break;
default:
note = alloc_EXPR_LIST (kind, datum, REG_NOTES (insn));
break;
}
REG_NOTES (insn) = note;
}
/* Remove register note NOTE from the REG_NOTES of INSN. */
void