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/doc | |
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/doc')
-rw-r--r-- | gcc/doc/rtl.texi | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 83fa089..639aabe 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -3201,9 +3201,10 @@ mandatory ones listed above. These four are described in a table below. @findex jump_insn @item jump_insn The expression code @code{jump_insn} is used for instructions that may -jump (or, more generally, may contain @code{label_ref} expressions). If -there is an instruction to return from the current function, it is -recorded as a @code{jump_insn}. +jump (or, more generally, may contain @code{label_ref} expressions to +which @code{pc} can be set in that instruction). If there is an +instruction to return from the current function, it is recorded as a +@code{jump_insn}. @findex JUMP_LABEL @code{jump_insn} insns have the same extra fields as @code{insn} insns, @@ -3213,9 +3214,11 @@ accessed in the same way and in addition contain a field For simple conditional and unconditional jumps, this field contains the @code{code_label} to which this insn will (possibly conditionally) branch. In a more complex jump, @code{JUMP_LABEL} records one of the -labels that the insn refers to; the only way to find the others is to -scan the entire body of the insn. In an @code{addr_vec}, -@code{JUMP_LABEL} is @code{NULL_RTX}. +labels that the insn refers to; other jump target labels are recorded +as @code{REG_LABEL_TARGET} notes. The exception is @code{addr_vec} +and @code{addr_diff_vec}, where @code{JUMP_LABEL} is @code{NULL_RTX} +and the only way to find the labels is to scan the entire body of the +insn. Return insns count as jumps, but since they do not refer to any labels, their @code{JUMP_LABEL} is @code{NULL_RTX}. @@ -3531,14 +3534,25 @@ note giving the expression being computed. This block is encapsulated with @code{REG_LIBCALL} and @code{REG_RETVAL} notes on the first and last insns, respectively. -@findex REG_LABEL -@item REG_LABEL +@findex REG_LABEL_OPERAND +@item REG_LABEL_OPERAND This insn uses @var{op}, a @code{code_label} or a @code{note} of type -@code{NOTE_INSN_DELETED_LABEL}, but is not a -@code{jump_insn}, or it is a @code{jump_insn} that required the label to -be held in a register. The presence of this note allows jump -optimization to be aware that @var{op} is, in fact, being used, and flow -optimization to build an accurate flow graph. +@code{NOTE_INSN_DELETED_LABEL}, but is not a @code{jump_insn}, or it +is a @code{jump_insn} that refers to the operand as an ordinary +operand. The label may still eventually be a jump target, but if so +in an indirect jump in a subsequent insn. The presence of this note +allows jump optimization to be aware that @var{op} is, in fact, being +used, and flow optimization to build an accurate flow graph. + +@findex REG_LABEL_TARGET +@item REG_LABEL_TARGET +This insn is a @code{jump_insn} but not a @code{addr_vec} or +@code{addr_diff_vec}. It uses @var{op}, a @code{code_label} as a +direct or indirect jump target. Its purpose is similar to that of +@code{REG_LABEL_OPERAND}. This note is only present if the insn has +multiple targets; the last label in the insn (in the highest numbered +insn-field) goes into the @code{JUMP_LABEL} field and does not have a +@code{REG_LABEL_TARGET} note. @xref{Insns, JUMP_LABEL}. @findex REG_CROSSING_JUMP @item REG_CROSSING_JUMP |