Commit a31830a7 by Steven Bosscher

fwprop.c (try_fwprop_subst): Use set_unique_reg_note to add the REG_EQ* note.

	* fwprop.c (try_fwprop_subst): Use set_unique_reg_note
	to add the REG_EQ* note.
	* see.c (see_merge_one_use_extension): Likewise.
	* local-alloc.c (update_equiv_regs): Likewise.  Also don't
	turn REG_EQUAL notes into REG_EQUIV notes if the target
	register may have more than one set.
	* function.c (assign_parm_setup_reg): Use set_unique_reg_note.
	* gcse.c (try_replace_reg): Likewise.
	* alias.c (init_alias_analysis): Use find_reg_equal_equiv_note.
	* calls.c (fixup_tail_calls): Likewise.  Abort if there is
	more than one REG_EQUIV note.
	* reload1.c (gen_reload): Use set_unique_reg_note.

From-SVN: r121821
parent 4c38b6d9
2007-02-11 Steven Bosscher <steven@gcc.gnu.org>
* fwprop.c (try_fwprop_subst): Use set_unique_reg_note
to add the REG_EQ* note.
* see.c (see_merge_one_use_extension): Likewise.
* local-alloc.c (update_equiv_regs): Likewise. Also don't
turn REG_EQUAL notes into REG_EQUIV notes if the target
register may have more than one set.
* function.c (assign_parm_setup_reg): Use set_unique_reg_note.
* gcse.c (try_replace_reg): Likewise.
* alias.c (init_alias_analysis): Use find_reg_equal_equiv_note.
* calls.c (fixup_tail_calls): Likewise. Abort if there is
more than one REG_EQUIV note.
* reload1.c (gen_reload): Use set_unique_reg_note.
2007-02-11 Uros Bizjak <ubizjak@gmail.com> 2007-02-11 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (TARGET_VECTORIZE_BUILTIN_CONVERSION): Define. * config/i386/i386.c (TARGET_VECTORIZE_BUILTIN_CONVERSION): Define.
......
...@@ -2546,10 +2546,12 @@ init_alias_analysis (void) ...@@ -2546,10 +2546,12 @@ init_alias_analysis (void)
rtx src = SET_SRC (set); rtx src = SET_SRC (set);
rtx t; rtx t;
if (REG_NOTES (insn) != 0 note = find_reg_equal_equiv_note (insn);
&& (((note = find_reg_note (insn, REG_EQUAL, 0)) != 0 if (note && REG_NOTE_KIND (note) == REG_EQUAL
&& REG_N_SETS (regno) == 1) && REG_N_SETS (regno) != 1)
|| (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0) note = NULL_RTX;
if (note != NULL_RTX
&& GET_CODE (XEXP (note, 0)) != EXPR_LIST && GET_CODE (XEXP (note, 0)) != EXPR_LIST
&& ! rtx_varies_p (XEXP (note, 0), 1) && ! rtx_varies_p (XEXP (note, 0), 1)
&& ! reg_overlap_mentioned_p (SET_DEST (set), && ! reg_overlap_mentioned_p (SET_DEST (set),
......
...@@ -3130,24 +3130,19 @@ fixup_tail_calls (void) ...@@ -3130,24 +3130,19 @@ fixup_tail_calls (void)
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
rtx note;
/* There are never REG_EQUIV notes for the incoming arguments /* There are never REG_EQUIV notes for the incoming arguments
after the NOTE_INSN_FUNCTION_BEG note, so stop if we see it. */ after the NOTE_INSN_FUNCTION_BEG note, so stop if we see it. */
if (NOTE_P (insn) if (NOTE_P (insn)
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
break; break;
while (1) note = find_reg_note (insn, REG_EQUIV, 0);
{ if (note)
rtx note = find_reg_note (insn, REG_EQUIV, 0); remove_note (insn, note);
if (note) note = find_reg_note (insn, REG_EQUIV, 0);
{ gcc_assert (!note);
/* Remove the note and keep looking at the notes for
this insn. */
remove_note (insn, note);
continue;
}
break;
}
} }
} }
......
...@@ -2800,20 +2800,14 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm, ...@@ -2800,20 +2800,14 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
continue; continue;
if (SET_DEST (set) == regno_reg_rtx [regnoi]) if (SET_DEST (set) == regno_reg_rtx [regnoi])
REG_NOTES (sinsn) set_unique_reg_note (sinsn, REG_EQUIV, stacki);
= gen_rtx_EXPR_LIST (REG_EQUIV, stacki,
REG_NOTES (sinsn));
else if (SET_DEST (set) == regno_reg_rtx [regnor]) else if (SET_DEST (set) == regno_reg_rtx [regnor])
REG_NOTES (sinsn) set_unique_reg_note (sinsn, REG_EQUIV, stackr);
= gen_rtx_EXPR_LIST (REG_EQUIV, stackr,
REG_NOTES (sinsn));
} }
} }
else if ((set = single_set (linsn)) != 0 else if ((set = single_set (linsn)) != 0
&& SET_DEST (set) == parmreg) && SET_DEST (set) == parmreg)
REG_NOTES (linsn) set_unique_reg_note (linsn, REG_EQUIV, data->stack_parm);
= gen_rtx_EXPR_LIST (REG_EQUIV,
data->stack_parm, REG_NOTES (linsn));
} }
/* For pointer data type, suggest pointer register. */ /* For pointer data type, suggest pointer register. */
......
...@@ -691,9 +691,10 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_ ...@@ -691,9 +691,10 @@ try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_
if (dump_file) if (dump_file)
fprintf (dump_file, " Setting REG_EQUAL note\n"); fprintf (dump_file, " Setting REG_EQUAL note\n");
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (new), set_unique_reg_note (insn, REG_EQUAL, copy_rtx (new));
REG_NOTES (insn));
/* ??? Is this still necessary if we add the note through
set_unique_reg_note? */
if (!CONSTANT_P (new)) if (!CONSTANT_P (new))
update_df (insn, loc, DF_INSN_USES (df, def_insn), update_df (insn, loc, DF_INSN_USES (df, def_insn),
type, DF_REF_IN_NOTE); type, DF_REF_IN_NOTE);
......
...@@ -2668,7 +2668,8 @@ try_replace_reg (rtx from, rtx to, rtx insn) ...@@ -2668,7 +2668,8 @@ try_replace_reg (rtx from, rtx to, rtx insn)
/* If there is already a REG_EQUAL note, update the expression in it /* If there is already a REG_EQUAL note, update the expression in it
with our replacement. */ with our replacement. */
if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL) if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL)
XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), from, to); set_unique_reg_note (insn, REG_EQUAL,
simplify_replace_rtx (XEXP (note, 0), from, to));
if (!success && set && reg_mentioned_p (from, SET_SRC (set))) if (!success && set && reg_mentioned_p (from, SET_SRC (set)))
{ {
......
...@@ -930,8 +930,13 @@ update_equiv_regs (void) ...@@ -930,8 +930,13 @@ update_equiv_regs (void)
/* If this register is known to be equal to a constant, record that /* If this register is known to be equal to a constant, record that
it is always equivalent to the constant. */ it is always equivalent to the constant. */
if (note && ! rtx_varies_p (XEXP (note, 0), 0)) if (REG_N_SETS (regno) == 1
PUT_MODE (note, (enum machine_mode) REG_EQUIV); && note && ! rtx_varies_p (XEXP (note, 0), 0))
{
rtx note_value = XEXP (note, 0);
remove_note (insn, note);
set_unique_reg_note (insn, REG_EQUIV, note_value);
}
/* If this insn introduces a "constant" register, decrease the priority /* If this insn introduces a "constant" register, decrease the priority
of that register. Record this insn if the register is only used once of that register. Record this insn if the register is only used once
...@@ -953,9 +958,7 @@ update_equiv_regs (void) ...@@ -953,9 +958,7 @@ update_equiv_regs (void)
if (note == 0 && REG_BASIC_BLOCK (regno) >= 0 if (note == 0 && REG_BASIC_BLOCK (regno) >= 0
&& MEM_P (SET_SRC (set)) && MEM_P (SET_SRC (set))
&& validate_equiv_mem (insn, dest, SET_SRC (set))) && validate_equiv_mem (insn, dest, SET_SRC (set)))
REG_NOTES (insn) = note = gen_rtx_EXPR_LIST (REG_EQUIV, note = set_unique_reg_note (insn, REG_EQUIV, copy_rtx (SET_SRC (set)));
copy_rtx (SET_SRC (set)),
REG_NOTES (insn));
if (note) if (note)
{ {
...@@ -1061,9 +1064,8 @@ update_equiv_regs (void) ...@@ -1061,9 +1064,8 @@ update_equiv_regs (void)
if (validate_equiv_mem (init_insn, src, dest) if (validate_equiv_mem (init_insn, src, dest)
&& ! memref_used_between_p (dest, init_insn, insn)) && ! memref_used_between_p (dest, init_insn, insn))
{ {
REG_NOTES (init_insn) set_unique_reg_note (init_insn, REG_EQUIV, copy_rtx (dest));
= gen_rtx_EXPR_LIST (REG_EQUIV, copy_rtx (dest),
REG_NOTES (init_insn));
/* This insn makes the equivalence, not the one initializing /* This insn makes the equivalence, not the one initializing
the register. */ the register. */
reg_equiv_init[regno] reg_equiv_init[regno]
......
...@@ -7832,8 +7832,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type) ...@@ -7832,8 +7832,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
if (insn) if (insn)
{ {
/* Add a REG_EQUIV note so that find_equiv_reg can find it. */ /* Add a REG_EQUIV note so that find_equiv_reg can find it. */
REG_NOTES (insn) set_unique_reg_note (insn, REG_EQUIV, in);
= gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn));
return insn; return insn;
} }
...@@ -7842,7 +7841,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type) ...@@ -7842,7 +7841,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
gen_reload (out, op1, opnum, type); gen_reload (out, op1, opnum, type);
insn = emit_insn (gen_add2_insn (out, op0)); insn = emit_insn (gen_add2_insn (out, op0));
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn)); set_unique_reg_note (insn, REG_EQUIV, in);
} }
#ifdef SECONDARY_MEMORY_NEEDED #ifdef SECONDARY_MEMORY_NEEDED
...@@ -7902,8 +7901,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type) ...@@ -7902,8 +7901,7 @@ gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
insn = emit_insn_if_valid_for_reload (insn); insn = emit_insn_if_valid_for_reload (insn);
if (insn) if (insn)
{ {
REG_NOTES (insn) set_unique_reg_note (insn, REG_EQUIV, in);
= gen_rtx_EXPR_LIST (REG_EQUIV, in, REG_NOTES (insn));
return insn; return insn;
} }
......
...@@ -2612,7 +2612,8 @@ see_merge_one_use_extension (void **slot, void *b) ...@@ -2612,7 +2612,8 @@ see_merge_one_use_extension (void **slot, void *b)
/* Replacement failed. Remove the note. */ /* Replacement failed. Remove the note. */
remove_note (ref_copy, note); remove_note (ref_copy, note);
else else
XEXP (note, 0) = simplified_note; set_unique_reg_note (ref_copy, REG_NOTE_KIND (note),
simplified_note);
} }
if (!see_want_to_be_merged_with_extension (ref, use_se, USE_EXTENSION)) if (!see_want_to_be_merged_with_extension (ref, use_se, USE_EXTENSION))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment