reg-notes.def 10 KB

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