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