1169689Skan/* Register note definitions.
2169689Skan   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3169689Skan
4169689SkanThis file is part of GCC.
5169689Skan
6169689SkanGCC is free software; you can redistribute it and/or modify it under
7169689Skanthe terms of the GNU General Public License as published by the Free
8169689SkanSoftware Foundation; either version 2, or (at your option) any later
9169689Skanversion.
10169689Skan
11169689SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY
12169689SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or
13169689SkanFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14169689Skanfor more details.
15169689Skan
16169689SkanYou should have received a copy of the GNU General Public License
17169689Skanalong with GCC; see the file COPYING.  If not, write to the Free
18169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
19169689Skan02110-1301, USA.  */
20169689Skan
21169689Skan/* This file defines all the codes that may appear on individual
22169689Skan   EXPR_LIST rtxes in the REG_NOTES chain of an insn.  The codes are
23169689Skan   stored in the mode field of the EXPR_LIST.  Source files define
24169689Skan   DEF_REG_NOTE appropriately before including this file.  */
25169689Skan
26169689Skan/* Shorthand.  */
27169689Skan#define REG_NOTE(NAME) DEF_REG_NOTE (REG_##NAME)
28169689Skan
29169689Skan/* REG_DEP_TRUE is used in LOG_LINKS to represent a read-after-write
30169689Skan   dependency (i.e. a true data dependency).  This is here, not
31169689Skan   grouped with REG_DEP_ANTI and REG_DEP_OUTPUT, because some passes
32169689Skan   use a literal 0 for it.  */
33169689SkanREG_NOTE (DEP_TRUE)
34169689Skan
35169689Skan/* The value in REG dies in this insn (i.e., it is not needed past
36169689Skan   this insn).  If REG is set in this insn, the REG_DEAD note may,
37169689Skan   but need not, be omitted.  */
38169689SkanREG_NOTE (DEAD)
39169689Skan
40169689Skan/* The REG is autoincremented or autodecremented in this insn.  */
41169689SkanREG_NOTE (INC)
42169689Skan
43169689Skan/* Describes the insn as a whole; it says that the insn sets a
44169689Skan   register to a constant value or to be equivalent to a memory
45169689Skan   address.  If the register is spilled to the stack then the constant
46169689Skan   value should be substituted for it.  The contents of the REG_EQUIV
47169689Skan   is the constant value or memory address, which may be different
48169689Skan   from the source of the SET although it has the same value.  A
49169689Skan   REG_EQUIV note may also appear on an insn which copies a register
50169689Skan   parameter to a pseudo-register, if there is a memory address which
51169689Skan   could be used to hold that pseudo-register throughout the function.  */
52169689SkanREG_NOTE (EQUIV)
53169689Skan
54169689Skan/* Like REG_EQUIV except that the destination is only momentarily
55169689Skan   equal to the specified rtx.  Therefore, it cannot be used for
56169689Skan   substitution; but it can be used for cse.  */
57169689SkanREG_NOTE (EQUAL)
58169689Skan
59169689Skan/* This insn copies the return-value of a library call out of the hard
60169689Skan   reg for return values.  This note is actually an INSN_LIST and it
61169689Skan   points to the first insn involved in setting up arguments for the
62169689Skan   call.  flow.c uses this to delete the entire library call when its
63169689Skan   result is dead.  */
64169689SkanREG_NOTE (RETVAL)
65169689Skan
66169689Skan/* The inverse of REG_RETVAL: it goes on the first insn of the library
67169689Skan   call and points at the one that has the REG_RETVAL.  This note is
68169689Skan   also an INSN_LIST.  */
69169689SkanREG_NOTE (LIBCALL)
70169689Skan
71169689Skan/* The register is always nonnegative during the containing loop.
72169689Skan   This is used in branches so that decrement and branch instructions
73169689Skan   terminating on zero can be matched.  There must be an insn pattern
74169689Skan   in the md file named `decrement_and_branch_until_zero' or else this
75169689Skan   will never be added to any instructions.  */
76169689SkanREG_NOTE (NONNEG)
77169689Skan
78169689Skan/* There is no conflict *after this insn* between the register in the
79169689Skan   note and the destination of this insn.  */
80169689SkanREG_NOTE (NO_CONFLICT)
81169689Skan
82169689Skan/* Identifies a register set in this insn and never used.  */
83169689SkanREG_NOTE (UNUSED)
84169689Skan
85169689Skan/* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use
86169689Skan   CC0, respectively.  Normally, these are required to be consecutive
87169689Skan   insns, but we permit putting a cc0-setting insn in the delay slot
88169689Skan   of a branch as long as only one copy of the insn exists.  In that
89169689Skan   case, these notes point from one to the other to allow code
90169689Skan   generation to determine what any require information and to
91169689Skan   properly update CC_STATUS.  These notes are INSN_LISTs.  */
92169689SkanREG_NOTE (CC_SETTER)
93169689SkanREG_NOTE (CC_USER)
94169689Skan
95169689Skan/* Points to a CODE_LABEL.  Used by non-JUMP_INSNs to say that the
96169689Skan   CODE_LABEL contained in the REG_LABEL note is used by the insn.
97169689Skan   This note is an INSN_LIST.  */
98169689SkanREG_NOTE (LABEL)
99169689Skan
100169689Skan/* REG_DEP_ANTI and REG_DEP_OUTPUT are used in LOG_LINKS to represent
101169689Skan   write-after-read and write-after-write dependencies respectively.  */
102169689SkanREG_NOTE (DEP_OUTPUT)
103169689SkanREG_NOTE (DEP_ANTI)
104169689Skan
105169689Skan/* REG_BR_PROB is attached to JUMP_INSNs and CALL_INSNs.  It has an
106169689Skan   integer value.  For jumps, it is the probability that this is a
107169689Skan   taken branch.  For calls, it is the probability that this call
108169689Skan   won't return.  */
109169689SkanREG_NOTE (BR_PROB)
110169689Skan
111169689Skan/* REG_VALUE_PROFILE is attached when the profile is read in to an
112169689Skan   insn before that the code to profile the value is inserted.  It
113169689Skan   contains the results of profiling.  */
114169689SkanREG_NOTE (VALUE_PROFILE)
115169689Skan
116169689Skan/* Attached to a call insn; indicates that the call is malloc-like and
117169689Skan   that the pointer returned cannot alias anything else.  */
118169689SkanREG_NOTE (NOALIAS)
119169689Skan
120169689Skan/* REG_BR_PRED is attached to JUMP_INSNs and CALL_INSNSs.  It contains
121169689Skan   CONCAT of two integer value.  First specifies the branch predictor
122169689Skan   that added the note, second specifies the predicted hitrate of
123169689Skan   branch in the same format as REG_BR_PROB note uses.  */
124169689SkanREG_NOTE (BR_PRED)
125169689Skan
126169689Skan/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
127169689Skan   for DWARF to interpret what they imply.  The attached rtx is used
128169689Skan   instead of intuition.  */
129169689SkanREG_NOTE (FRAME_RELATED_EXPR)
130169689Skan
131169689Skan/* Indicates that REG holds the exception context for the function.
132169689Skan   This context is shared by inline functions, so the code to acquire
133169689Skan   the real exception context is delayed until after inlining.  */
134169689SkanREG_NOTE (EH_CONTEXT)
135169689Skan
136169689Skan/* Indicates what exception region an INSN belongs in.  This is used
137169689Skan   to indicate what region to which a call may throw.  REGION 0
138169689Skan   indicates that a call cannot throw at all.  REGION -1 indicates
139169689Skan   that it cannot throw, nor will it execute a non-local goto.  */
140169689SkanREG_NOTE (EH_REGION)
141169689Skan
142169689Skan/* Used by haifa-sched to save NOTE_INSN notes across scheduling.  */
143169689SkanREG_NOTE (SAVE_NOTE)
144169689Skan
145169689Skan/* Indicates that this insn (which is part of the prologue) computes a
146169689Skan   value which might not be used later, and if so it's OK to delete
147169689Skan   the insn.  Normally, deleting any insn in the prologue is an error.
148169689Skan   At present the parameter is unused and set to (const_int 0).  */
149169689SkanREG_NOTE (MAYBE_DEAD)
150169689Skan
151169689Skan/* Indicates that a call does not return.  */
152169689SkanREG_NOTE (NORETURN)
153169689Skan
154169689Skan/* Indicates that an indirect jump is a non-local goto instead of a
155169689Skan   computed goto.  */
156169689SkanREG_NOTE (NON_LOCAL_GOTO)
157169689Skan
158169689Skan/* Indicates that a jump crosses between hot and cold sections in a
159169689Skan   (partitioned) assembly or .o file, and therefore should not be
160169689Skan   reduced to a simpler jump by optimizations.  */
161169689SkanREG_NOTE (CROSSING_JUMP)
162169689Skan
163169689Skan/* This kind of note is generated at each to `setjmp', and similar
164169689Skan   functions that can return twice.  */
165169689SkanREG_NOTE (SETJMP)
166