xref: /dflybsd-src/contrib/gcc-8.0/gcc/reg-notes.def (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj/* Register note definitions.
2*38fd1498Szrj   Copyright (C) 2004-2018 Free Software Foundation, Inc.
3*38fd1498Szrj
4*38fd1498SzrjThis file is part of GCC.
5*38fd1498Szrj
6*38fd1498SzrjGCC is free software; you can redistribute it and/or modify it under
7*38fd1498Szrjthe terms of the GNU General Public License as published by the Free
8*38fd1498SzrjSoftware Foundation; either version 3, or (at your option) any later
9*38fd1498Szrjversion.
10*38fd1498Szrj
11*38fd1498SzrjGCC is distributed in the hope that it will be useful, but WITHOUT ANY
12*38fd1498SzrjWARRANTY; without even the implied warranty of MERCHANTABILITY or
13*38fd1498SzrjFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14*38fd1498Szrjfor more details.
15*38fd1498Szrj
16*38fd1498SzrjYou should have received a copy of the GNU General Public License
17*38fd1498Szrjalong with GCC; see the file COPYING3.  If not see
18*38fd1498Szrj<http://www.gnu.org/licenses/>.  */
19*38fd1498Szrj
20*38fd1498Szrj/* This file defines all the codes that may appear on individual
21*38fd1498Szrj   EXPR_LIST, INSN_LIST and INT_LIST rtxes in the REG_NOTES chain of an insn.
22*38fd1498Szrj   The codes are stored in the mode field of the rtx.  Source files
23*38fd1498Szrj   define DEF_REG_NOTE appropriately before including this file.
24*38fd1498Szrj
25*38fd1498Szrj   CFA related notes meant for RTX_FRAME_RELATED_P instructions
26*38fd1498Szrj   should be declared with REG_CFA_NOTE macro instead of REG_NOTE.  */
27*38fd1498Szrj
28*38fd1498Szrj/* Shorthand.  */
29*38fd1498Szrj#define REG_NOTE(NAME) DEF_REG_NOTE (REG_##NAME)
30*38fd1498Szrj#ifndef REG_CFA_NOTE
31*38fd1498Szrj# define REG_CFA_NOTE(NAME) REG_NOTE (NAME)
32*38fd1498Szrj#endif
33*38fd1498Szrj
34*38fd1498Szrj/* REG_DEP_TRUE is used in scheduler dependencies lists to represent a
35*38fd1498Szrj   read-after-write dependency (i.e. a true data dependency).  This is
36*38fd1498Szrj   here, not grouped with REG_DEP_ANTI and REG_DEP_OUTPUT, because some
37*38fd1498Szrj   passes use a literal 0 for it.  */
38*38fd1498SzrjREG_NOTE (DEP_TRUE)
39*38fd1498Szrj
40*38fd1498Szrj/* The value in REG dies in this insn (i.e., it is not needed past
41*38fd1498Szrj   this insn).  If REG is set in this insn, the REG_DEAD note may,
42*38fd1498Szrj   but need not, be omitted.  */
43*38fd1498SzrjREG_NOTE (DEAD)
44*38fd1498Szrj
45*38fd1498Szrj/* The REG is autoincremented or autodecremented in this insn.  */
46*38fd1498SzrjREG_NOTE (INC)
47*38fd1498Szrj
48*38fd1498Szrj/* Describes the insn as a whole; it says that the insn sets a
49*38fd1498Szrj   register to a constant value or to be equivalent to a memory
50*38fd1498Szrj   address.  If the register is spilled to the stack then the constant
51*38fd1498Szrj   value should be substituted for it.  The contents of the REG_EQUIV
52*38fd1498Szrj   is the constant value or memory address, which may be different
53*38fd1498Szrj   from the source of the SET although it has the same value.  A
54*38fd1498Szrj   REG_EQUIV note may also appear on an insn which copies a register
55*38fd1498Szrj   parameter to a pseudo-register, if there is a memory address which
56*38fd1498Szrj   could be used to hold that pseudo-register throughout the function.  */
57*38fd1498SzrjREG_NOTE (EQUIV)
58*38fd1498Szrj
59*38fd1498Szrj/* Like REG_EQUIV except that the destination is only momentarily
60*38fd1498Szrj   equal to the specified rtx.  Therefore, it cannot be used for
61*38fd1498Szrj   substitution; but it can be used for cse.  */
62*38fd1498SzrjREG_NOTE (EQUAL)
63*38fd1498Szrj
64*38fd1498Szrj/* The register is always nonnegative during the containing loop.
65*38fd1498Szrj   This is used in branches so that decrement and branch instructions
66*38fd1498Szrj   terminating on zero can be matched.  There must be an insn pattern
67*38fd1498Szrj   in the md file named `decrement_and_branch_until_zero' or else this
68*38fd1498Szrj   will never be added to any instructions.  */
69*38fd1498SzrjREG_NOTE (NONNEG)
70*38fd1498Szrj
71*38fd1498Szrj/* Identifies a register set in this insn and never used.  */
72*38fd1498SzrjREG_NOTE (UNUSED)
73*38fd1498Szrj
74*38fd1498Szrj/* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use
75*38fd1498Szrj   CC0, respectively.  Normally, these are required to be consecutive
76*38fd1498Szrj   insns, but we permit putting a cc0-setting insn in the delay slot
77*38fd1498Szrj   of a branch as long as only one copy of the insn exists.  In that
78*38fd1498Szrj   case, these notes point from one to the other to allow code
79*38fd1498Szrj   generation to determine what any require information and to
80*38fd1498Szrj   properly update CC_STATUS.  These notes are INSN_LISTs.  */
81*38fd1498SzrjREG_NOTE (CC_SETTER)
82*38fd1498SzrjREG_NOTE (CC_USER)
83*38fd1498Szrj
84*38fd1498Szrj/* Points to a CODE_LABEL.  Used by JUMP_INSNs to say that the CODE_LABEL
85*38fd1498Szrj   contained in the REG_LABEL_TARGET note is a possible jump target of
86*38fd1498Szrj   this insn.  This note is an INSN_LIST.  */
87*38fd1498SzrjREG_NOTE (LABEL_TARGET)
88*38fd1498Szrj
89*38fd1498Szrj/* Points to a CODE_LABEL.  Used by any insn to say that the CODE_LABEL
90*38fd1498Szrj   contained in the REG_LABEL_OPERAND note is used by the insn, but as an
91*38fd1498Szrj   operand, not as a jump target (though it may indirectly be a jump
92*38fd1498Szrj   target for a later jump insn).  This note is an INSN_LIST.  */
93*38fd1498SzrjREG_NOTE (LABEL_OPERAND)
94*38fd1498Szrj
95*38fd1498Szrj/* REG_DEP_OUTPUT and REG_DEP_ANTI are used in scheduler dependencies lists
96*38fd1498Szrj   to represent write-after-write and write-after-read dependencies
97*38fd1498Szrj   respectively.  */
98*38fd1498SzrjREG_NOTE (DEP_OUTPUT)
99*38fd1498SzrjREG_NOTE (DEP_ANTI)
100*38fd1498SzrjREG_NOTE (DEP_CONTROL)
101*38fd1498Szrj
102*38fd1498Szrj/* REG_BR_PROB is attached to JUMP_INSNs.  It has an
103*38fd1498Szrj   integer value (in an INT_LIST).  For jumps, it is the probability
104*38fd1498Szrj   that this is a taken branch. The integer represents a value of
105*38fd1498Szrj   profile_probability type. Use to_reg_br_prob_note and from_reg_br_prob_note
106*38fd1498Szrj   to extract the actual value.  */
107*38fd1498SzrjREG_NOTE (BR_PROB)
108*38fd1498Szrj
109*38fd1498Szrj/* Attached to a call insn; indicates that the call is malloc-like and
110*38fd1498Szrj   that the pointer returned cannot alias anything else.  */
111*38fd1498SzrjREG_NOTE (NOALIAS)
112*38fd1498Szrj
113*38fd1498Szrj/* REG_BR_PRED is attached to JUMP_INSNs.  It contains
114*38fd1498Szrj   CONCAT of two integer value.  First specifies the branch predictor
115*38fd1498Szrj   that added the note, second specifies the predicted hitrate of
116*38fd1498Szrj   branch in a fixed point arithmetic based on REG_BR_PROB_BASE.  */
117*38fd1498SzrjREG_NOTE (BR_PRED)
118*38fd1498Szrj
119*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
120*38fd1498Szrj   for DWARF to interpret what they imply.  The attached rtx is used
121*38fd1498Szrj   instead of intuition.  */
122*38fd1498SzrjREG_CFA_NOTE (FRAME_RELATED_EXPR)
123*38fd1498Szrj
124*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
125*38fd1498Szrj   for FRAME_RELATED_EXPR intuition.  The insn's first pattern must be
126*38fd1498Szrj   a SET, and the destination must be the CFA register.  The attached
127*38fd1498Szrj   rtx is an expression that defines the CFA.  In the simplest case, the
128*38fd1498Szrj   rtx could be just the stack_pointer_rtx; more common would be a PLUS
129*38fd1498Szrj   with a base register and a constant offset.  In the most complicated
130*38fd1498Szrj   cases, this will result in a DW_CFA_def_cfa_expression with the rtx
131*38fd1498Szrj   expression rendered in a dwarf location expression.  */
132*38fd1498SzrjREG_CFA_NOTE (CFA_DEF_CFA)
133*38fd1498Szrj
134*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
135*38fd1498Szrj   for FRAME_RELATED_EXPR intuition.  This note adjusts the expression
136*38fd1498Szrj   from which the CFA is computed.  The attached rtx defines a new CFA
137*38fd1498Szrj   expression, relative to the old CFA expression.  This rtx must be of
138*38fd1498Szrj   the form (SET new-cfa-reg (PLUS old-cfa-reg const_int)).  If the note
139*38fd1498Szrj   rtx is NULL, we use the first SET of the insn.  */
140*38fd1498SzrjREG_CFA_NOTE (CFA_ADJUST_CFA)
141*38fd1498Szrj
142*38fd1498Szrj/* Similar to FRAME_RELATED_EXPR, with the additional information that
143*38fd1498Szrj   this is a save to memory, i.e. will result in DW_CFA_offset or the
144*38fd1498Szrj   like.  The pattern or the insn should be a simple store relative to
145*38fd1498Szrj   the CFA.  */
146*38fd1498SzrjREG_CFA_NOTE (CFA_OFFSET)
147*38fd1498Szrj
148*38fd1498Szrj/* Similar to FRAME_RELATED_EXPR, with the additional information that this
149*38fd1498Szrj   is a save to a register, i.e. will result in DW_CFA_register.  The insn
150*38fd1498Szrj   or the pattern should be simple reg-reg move.  */
151*38fd1498SzrjREG_CFA_NOTE (CFA_REGISTER)
152*38fd1498Szrj
153*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
154*38fd1498Szrj   for FRAME_RELATED_EXPR intuition.  This is a save to memory, i.e. will
155*38fd1498Szrj   result in a DW_CFA_expression.  The pattern or the insn should be a
156*38fd1498Szrj   store of a register to an arbitrary (non-validated) memory address.  */
157*38fd1498SzrjREG_CFA_NOTE (CFA_EXPRESSION)
158*38fd1498Szrj
159*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
160*38fd1498Szrj   for FRAME_RELATED_EXPR intuition.  The DWARF expression computes the value of
161*38fd1498Szrj   the given register.  */
162*38fd1498SzrjREG_CFA_NOTE (CFA_VAL_EXPRESSION)
163*38fd1498Szrj
164*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, with the information
165*38fd1498Szrj   that this is a restore operation, i.e. will result in DW_CFA_restore
166*38fd1498Szrj   or the like.  Either the attached rtx, or the destination of the insn's
167*38fd1498Szrj   first pattern is the register to be restored.  */
168*38fd1498SzrjREG_CFA_NOTE (CFA_RESTORE)
169*38fd1498Szrj
170*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, marks insn that sets
171*38fd1498Szrj   vDRAP from DRAP.  If vDRAP is a register, vdrap_reg is initalized
172*38fd1498Szrj   to the argument, if it is a MEM, it is ignored.  */
173*38fd1498SzrjREG_CFA_NOTE (CFA_SET_VDRAP)
174*38fd1498Szrj
175*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, indicating a window
176*38fd1498Szrj   save operation, i.e. will result in a DW_CFA_GNU_window_save.
177*38fd1498Szrj   The argument is ignored.  */
178*38fd1498SzrjREG_CFA_NOTE (CFA_WINDOW_SAVE)
179*38fd1498Szrj
180*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, marks the insn as
181*38fd1498Szrj   requiring that all queued information should be flushed *before* insn,
182*38fd1498Szrj   regardless of what is visible in the rtl.  The argument is ignored.
183*38fd1498Szrj   This is normally used for a call instruction which is not exposed to
184*38fd1498Szrj   the rest of the compiler as a CALL_INSN.  */
185*38fd1498SzrjREG_CFA_NOTE (CFA_FLUSH_QUEUE)
186*38fd1498Szrj
187*38fd1498Szrj/* Attached to insns that are RTX_FRAME_RELATED_P, toggling the mangling status
188*38fd1498Szrj   of return address.  Currently it's only used by AArch64.  The argument is
189*38fd1498Szrj   ignored.  */
190*38fd1498SzrjREG_CFA_NOTE (CFA_TOGGLE_RA_MANGLE)
191*38fd1498Szrj
192*38fd1498Szrj/* Indicates what exception region an INSN belongs in.  This is used
193*38fd1498Szrj   to indicate what region to which a call may throw.  REGION 0
194*38fd1498Szrj   indicates that a call cannot throw at all.  REGION -1 indicates
195*38fd1498Szrj   that it cannot throw, nor will it execute a non-local goto.  */
196*38fd1498SzrjREG_NOTE (EH_REGION)
197*38fd1498Szrj
198*38fd1498Szrj/* Used by haifa-sched to save NOTE_INSN notes across scheduling.  */
199*38fd1498SzrjREG_NOTE (SAVE_NOTE)
200*38fd1498Szrj
201*38fd1498Szrj/* Indicates that a call does not return.  */
202*38fd1498SzrjREG_NOTE (NORETURN)
203*38fd1498Szrj
204*38fd1498Szrj/* Indicates that an indirect jump is a non-local goto instead of a
205*38fd1498Szrj   computed goto.  */
206*38fd1498SzrjREG_NOTE (NON_LOCAL_GOTO)
207*38fd1498Szrj
208*38fd1498Szrj/* This kind of note is generated at each to `setjmp', and similar
209*38fd1498Szrj   functions that can return twice.  */
210*38fd1498SzrjREG_NOTE (SETJMP)
211*38fd1498Szrj
212*38fd1498Szrj/* This kind of note is generated at each transactional memory
213*38fd1498Szrj   builtin, to indicate we need to generate transaction restart
214*38fd1498Szrj   edges for this insn.  */
215*38fd1498SzrjREG_NOTE (TM)
216*38fd1498Szrj
217*38fd1498Szrj/* Indicates the cumulative offset of the stack pointer accounting
218*38fd1498Szrj   for pushed arguments.  This will only be generated when
219*38fd1498Szrj   ACCUMULATE_OUTGOING_ARGS is false.  */
220*38fd1498SzrjREG_NOTE (ARGS_SIZE)
221*38fd1498Szrj
222*38fd1498Szrj/* Used for communication between IRA and caller-save.c, indicates
223*38fd1498Szrj   that the return value of a call can be used to reinitialize a
224*38fd1498Szrj   pseudo reg.  */
225*38fd1498SzrjREG_NOTE (RETURNED)
226*38fd1498Szrj
227*38fd1498Szrj/* Indicates the instruction is a stack check probe that should not
228*38fd1498Szrj   be combined with other stack adjustments.  */
229*38fd1498SzrjREG_NOTE (STACK_CHECK)
230*38fd1498Szrj
231*38fd1498Szrj/* Used to mark a call with the function decl called by the call.
232*38fd1498Szrj   The decl might not be available in the call due to splitting of the call
233*38fd1498Szrj   insn.  This note is a SYMBOL_REF.  */
234*38fd1498SzrjREG_NOTE (CALL_DECL)
235*38fd1498Szrj
236*38fd1498Szrj/* Indicate that a call should not be verified for control-flow consistency.
237*38fd1498Szrj   The target address of the call is assumed as a valid address and no check
238*38fd1498Szrj   to validate a branch to the target address is needed.  The call is marked
239*38fd1498Szrj   when a called function has a 'notrack' attribute.  This note is used by the
240*38fd1498Szrj   compiler when the option -fcf-protection=branch is specified.  */
241*38fd1498SzrjREG_NOTE (CALL_NOCF_CHECK)
242*38fd1498Szrj
243*38fd1498Szrj/* The values passed to callee, for debuginfo purposes.  */
244*38fd1498SzrjREG_NOTE (CALL_ARG_LOCATION)
245