|
|
1.1 root 1: /* Define per-register tables for data flow info and register allocation.
2: Copyright (C) 1987 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is distributed in the hope that it will be useful,
7: but WITHOUT ANY WARRANTY. No author or distributor
8: accepts responsibility to anyone for the consequences of using it
9: or for whether it serves any particular purpose or works at all,
10: unless he says so in writing. Refer to the GNU CC General Public
11: License for full details.
12:
13: Everyone is granted permission to copy, modify and redistribute
14: GNU CC, but only under the conditions described in the
15: GNU CC General Public License. A copy of this license is
16: supposed to have been given to you along with GNU CC so you
17: can know your rights and responsibilities. It should be in a
18: file named COPYING. Among other things, the copyright notice
19: and this notice must be preserved on all copies. */
20:
21:
22:
23: #define REG_BYTES(R) mode_size[(int) GET_MODE (R)]
24:
25: /* Get the number of consecutive hard regs required to hold the REG rtx R.
26: When something may be an explicit hard reg, REG_SIZE is the only
27: valid way to get this value. You cannot get it from the regno. */
28:
29: #define REG_SIZE(R) \
30: ((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
31:
32: /* Maximum register number used in this function, plus one. */
33:
34: extern int max_regno;
35:
36: /* Indexed by n, gives number of times (REG n) is used or set.
37: References within loops may be counted more times. */
38:
39: extern short *reg_n_refs;
40:
41: /* Indexed by n, gives number of times (REG n) is set. */
42:
43: extern short *reg_n_sets;
44:
45: /* Indexed by N, gives number of insns in which register N dies.
46: Note that if register N is live around loops, it can die
47: in transitions between basic blocks, and that is not counted here.
48: So this is only a reliable indicator of how many regions of life there are
49: for registers that are contained in one basic block. */
50:
51: extern short *reg_n_deaths;
52:
53: /* Get the number of consecutive words required to hold pseudo-reg N. */
54:
55: #define PSEUDO_REGNO_SIZE(N) \
56: ((GET_MODE_SIZE (PSEUDO_REGNO_MODE (N)) + UNITS_PER_WORD - 1) \
57: / UNITS_PER_WORD)
58:
59: /* Get the number of bytes required to hold pseudo-reg N. */
60:
61: #define PSEUDO_REGNO_BYTES(N) \
62: GET_MODE_SIZE (PSEUDO_REGNO_MODE (N))
63:
64: /* Get the machine mode of pseudo-reg N. */
65:
66: #define PSEUDO_REGNO_MODE(N) GET_MODE (regno_reg_rtx[N])
67:
68: /* Indexed by N, gives 1 if (REG n) is live across a CALL_INSN. */
69:
70: extern char *reg_crosses_call;
71:
72: /* Total number of instructions at which (REG n) is live.
73: The larger this is, the less priority (REG n) gets for
74: allocation in a hard register (in global-alloc).
75: This is set in flow.c and remains valid for the rest of the compilation
76: of the function; it is used to control register allocation.
77:
78: local-alloc.c may alter this number to change the priority.
79:
80: Negative values are special.
81: -1 is used to mark a pseudo reg which has a constant or memory equivalent
82: and is used infrequently enough that it should not get a hard register.
83: -2 is used to mark a pseudo reg for a parameter, when a frame pointer
84: is not required. global-alloc.c makes an allocno for this but does
85: not try to assign a hard register to it. */
86:
87: extern int *reg_live_length;
88:
89: /* Vector of substitutions of register numbers,
90: used to map pseudo regs into hardware regs. */
91:
92: extern short *reg_renumber;
93:
94: /* Vector indexed by hardware reg
95: saying whether that reg is ever used. */
96:
97: extern char regs_ever_live[FIRST_PSEUDO_REGISTER];
98:
99: /* Vector indexed by regno; gives uid of first insn using that reg.
100: This is computed by reg_scan and not adjusted for subsequent changes. */
101:
102: extern short *regno_first_uid;
103:
104: /* Vector indexed by regno; gives uid of last insn using that reg.
105: This is computed by reg_scan and not adjusted for subsequent changes. */
106:
107: extern short *regno_last_uid;
108:
109: /* Vector indexed by regno; contains 1 for a register is considered a pointer.
110: Reloading, etc. will use a pointer register rather than a non-pointer
111: as the base register in an address, when there is a choice of two regs. */
112:
113: extern char *regno_pointer_flag;
114: #define REGNO_POINTER_FLAG(REGNO) regno_pointer_flag[REGNO]
115:
116: /* Vector mapping pseudo regno into the REG rtx for that register.
117: This is computed by reg_scan. */
118:
119: extern rtx *regno_reg_rtx;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.