diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2007-09-09 04:41:58 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2007-09-09 04:41:58 +0000 |
commit | cf7c4aa6af680063a0c08b79ce59cc3d0032cc9b (patch) | |
tree | 23db0441b293cca445046c70fba12a335a0c4ff2 /gcc/config | |
parent | 97c954f700eaf9b67909a322dcd780f6168b3aba (diff) | |
download | gcc-cf7c4aa6af680063a0c08b79ce59cc3d0032cc9b.zip gcc-cf7c4aa6af680063a0c08b79ce59cc3d0032cc9b.tar.gz gcc-cf7c4aa6af680063a0c08b79ce59cc3d0032cc9b.tar.bz2 |
Divide REG_LABEL notes into REG_LABEL_OPERAND and REG_LABEL_TARGET.
* doc/rtl.texi (Insns): Specify when a label_ref makes a jump_insn.
Similar for what label_refs can go in the JUMP_TARGET field. Split
REG_LABEL documentation into REG_LABEL_TARGET and REG_LABEL_OPERAND.
* reload.c (find_reloads): Generate REG_LABEL_OPERAND, not
REG_LABEL when replacing an operand with a LABEL_REF for a
non-jump insn.
(subst_reloads): When replacing a LABEL_REG with a register,
instead of generating a REG_LABEL note, assert that there already
is one or that the label is a known target for the insn.
* rtlanal.c (computed_jump_p): Instead of looking for a REG_LABEL
note, check the JUMP_LABEL field. Remove "else" after return.
* reorg.c (emit_delay_sequence): Replace case for REG_LABEL with
cases for REG_LABEL_OPERAND and REG_LABEL_TARGET.
(fill_slots_from_thread): Handle both REG_LABEL_OPERAND and
REG_LABEL_TARGET notes, including the JUMP_TARGET field on JUMP_P
insns. Iterate over all notes; don't assume there's only one.
* cse.c (recorded_label_ref): Adjust comment to refer to
REG_LABEL_OPERAND.
(cse_extended_basic_block): Do LABEL_REF check for all INSN_P
insns, not just NONJUMP_INSN_P.
(check_for_label_ref): For JUMP_P insns, check that the LABEL_REF
isn't a jump target.
* jump.c (rebuild_jump_labels): Adjust head comment.
(init_label_info): Ditto. Remove REG_LABEL_OPERAND notes only;
don't reset REG_LABEL_TARGET notes, including the JUMP_LABEL field.
(mark_all_labels): For JUMP_P insns without a target, check if the
the target is noted on the previous nonjump insn.
(mark_jump_label_1): New function, guts from mark_jump_label.
<case IF_THEN_ELSE>: Handle first operand as a non-target when
marking jump target labels.
<case LABEL_REF>: Adjust for whether to generate a
REG_LABEL_TARGET or a REG_LABEL_OPERAND note.
For 'E' format rtl, iterate in descending element order.
(delete_related_insns): Handle both REG_LABEL_TARGET and
REG_LABEL_OPERAND notes. For JUMP_P insns with labels with zero
reference count, delete and fallthrough. Move finding-next-
non-deleted insn last in the function. Look at all INSN_P insns
for REG_LABEL_OPERAND notes.
(redirect_jump_2): Assert that OLABEL equals the old JUMP_LABEL of
JUMP.
* print-rtl.c (print_rtx): For JUMP_P insns and a non-NULL
JUMP_LABEL, output the INSN_UID of it.
* gcse.c: Adjust comments as appropriate to say REG_LABEL_OPERAND
and/or REG_LABEL_TARGET.
(add_label_notes): Only add REG_LABEL_OPERAND notes. Put in line
with jump.c copy by only adding notes for labels actually
referenced in the insn.
* emit-rtl.c (try_split): Don't assume only NONJUMP_INSN_P need
usage count increment; handle all INSN_P trial insns.
(emit_copy_of_insn_after): Change to not copy REG_LABEL_OPERAND
notes.
* rtl.h (struct rtx_def) <volatil>: Adjust to mention
REG_LABEL_TARGET and REG_LABEL_OPERAND.
(LABEL_REF_NONLOCAL_P): Allow REG_LABEL_TARGET and
REG_LABEL_OPERAND.
* combine.c (distribute_notes): Adjust for REG_LABEL_TARGET on
JUMP_P insns and REG_LABEL_OPERAND everywhere.
* sched-rgn.c (is_cfg_nonregular): Check for REG_LABEL_OPERANDS
on all INSN_P insns.
* reg-notes.def (LABEL_TARGET, LABEL_OPERAND): Split from LABEL.
* cfgrtl.c (delete_insn): Adjust to handle REG_LABEL_TARGET and
REG_LABEL_OPERAND notes.
* reload1.c (calculate_needs_all_insns): Adjust comments.
(set_label_offsets): Adjust to look for REG_LABEL_OPERAND notes.
* config/alpha/alpha.md (split for load of an address into a
four-insn sequence on Unicos/Mk): Adjust to use
REG_LABEL_OPERAND.
* config/sh/sh.md (sh_reorg, final_prescan_insn): Ditto.
From-SVN: r128287
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/alpha.md | 12 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 24 |
2 files changed, 19 insertions, 17 deletions
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index f381dde..f4f3eb3 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -5375,9 +5375,9 @@ ;; Split the load of an address into a four-insn sequence on Unicos/Mk. ;; Always generate a REG_EQUAL note for the last instruction to facilitate -;; optimizations. If the symbolic operand is a label_ref, generate REG_LABEL -;; notes and update LABEL_NUSES because this is not done automatically. -;; Labels may be incorrectly deleted if we don't do this. +;; optimizations. If the symbolic operand is a label_ref, generate +;; REG_LABEL_OPERAND notes and update LABEL_NUSES because this is not done +;; automatically. Labels may be incorrectly deleted if we don't do this. ;; ;; Describing what the individual instructions do correctly is too complicated ;; so use UNSPECs for each of the three parts of an address. @@ -5401,11 +5401,11 @@ rtx label; label = XEXP (operands[1], 0); - REG_NOTES (insn1) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (insn1) = gen_rtx_EXPR_LIST (REG_LABEL_OPERAND, label, REG_NOTES (insn1)); - REG_NOTES (insn2) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (insn2) = gen_rtx_EXPR_LIST (REG_LABEL_OPERAND, label, REG_NOTES (insn2)); - REG_NOTES (insn3) = gen_rtx_EXPR_LIST (REG_LABEL, label, + REG_NOTES (insn3) = gen_rtx_EXPR_LIST (REG_LABEL_OPERAND, label, REG_NOTES (insn3)); LABEL_NUSES (label) += 3; } diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 927355f..ad9dd22 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -4716,8 +4716,8 @@ sh_reorg (void) mdep_reorg_phase = SH_INSERT_USES_LABELS; if (TARGET_RELAX) { - /* Remove all REG_LABEL notes. We want to use them for our own - purposes. This works because none of the remaining passes + /* Remove all REG_LABEL_OPERAND notes. We want to use them for our + own purposes. This works because none of the remaining passes need to look at them. ??? But it may break in the future. We should use a machine @@ -4728,7 +4728,8 @@ sh_reorg (void) { rtx note; - while ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != 0) + while ((note = find_reg_note (insn, REG_LABEL_OPERAND, + NULL_RTX)) != 0) remove_note (insn, note); } } @@ -4879,16 +4880,16 @@ sh_reorg (void) continue; } - /* Create a code label, and put it in a REG_LABEL note on - the insn which sets the register, and on each call insn - which uses the register. In final_prescan_insn we look - for the REG_LABEL notes, and output the appropriate label + /* Create a code label, and put it in a REG_LABEL_OPERAND note + on the insn which sets the register, and on each call insn + which uses the register. In final_prescan_insn we look for + the REG_LABEL_OPERAND notes, and output the appropriate label or pseudo-op. */ label = gen_label_rtx (); - REG_NOTES (link) = gen_rtx_INSN_LIST (REG_LABEL, label, + REG_NOTES (link) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label, REG_NOTES (link)); - REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, label, + REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label, REG_NOTES (insn)); if (rescan) { @@ -4904,7 +4905,8 @@ sh_reorg (void) || ((reg2 = sfunc_uses_reg (scan)) && REGNO (reg2) == REGNO (reg)))) REG_NOTES (scan) - = gen_rtx_INSN_LIST (REG_LABEL, label, REG_NOTES (scan)); + = gen_rtx_INSN_LIST (REG_LABEL_OPERAND, label, + REG_NOTES (scan)); } while (scan != dies); } @@ -5405,7 +5407,7 @@ final_prescan_insn (rtx insn, rtx *opvec ATTRIBUTE_UNUSED, { rtx note; - note = find_reg_note (insn, REG_LABEL, NULL_RTX); + note = find_reg_note (insn, REG_LABEL_OPERAND, NULL_RTX); if (note) { rtx pattern; |