]>
Commit | Line | Data |
---|---|---|
3250221d RS |
1 | /* Function integration definitions for GNU C-Compiler |
2 | Copyright (C) 1990 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GNU CC. | |
5 | ||
6 | GNU CC is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GNU CC is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GNU CC; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | /* This structure is used to remap objects in the function being inlined to | |
21 | those belonging to the calling function. It is passed by | |
22 | expand_inline_function to its children. | |
23 | ||
24 | This structure is also used when unrolling loops and otherwise | |
25 | replicating code, although not all fields are needed in this case; | |
26 | only those fields needed by copy_rtx_and_substitute() and its children | |
27 | are used. | |
28 | ||
29 | This structure is used instead of static variables because | |
30 | expand_inline_function may be called recursively via expand_expr. */ | |
31 | ||
32 | struct inline_remap | |
33 | { | |
11d1f673 JW |
34 | /* True if we are doing function integration, false otherwise. |
35 | Used to control whether RTX_UNCHANGING bits are copied by | |
36 | copy_rtx_and_substitute. */ | |
37 | int integrating; | |
3250221d RS |
38 | /* Definition of function be inlined. */ |
39 | union tree_node *fndecl; | |
40 | /* Place to put insns needed at start of function. */ | |
41 | rtx insns_at_start; | |
42 | /* Mapping from old registers to new registers. | |
43 | It is allocated and deallocated in `expand_inline_function' */ | |
44 | rtx *reg_map; | |
45 | /* Mapping from old code-labels to new code-labels. | |
46 | The first element of this map is label_map[min_labelno]. */ | |
47 | rtx *label_map; | |
48 | /* Mapping from old insn uid's to copied insns. The first element | |
49 | of this map is insn_map[min_insnno]; the last element is | |
50 | insn_map[max_insnno]. We keep the bounds here for when the map | |
51 | only covers a partial range of insns (such as loop unrolling or | |
52 | code replication). */ | |
53 | rtx *insn_map; | |
54 | int min_insnno, max_insnno; | |
55 | ||
56 | /* Map pseudo reg number in calling function to equivalent constant. We | |
57 | cannot in general substitute constants into parameter pseudo registers, | |
58 | since some machine descriptions (many RISCs) won't always handle | |
59 | the resulting insns. So if an incoming parameter has a constant | |
60 | equivalent, we record it here, and if the resulting insn is | |
61 | recognizable, we go with it. | |
62 | ||
63 | We also use this mechanism to convert references to incoming arguments | |
64 | and stacked variables. copy_rtx_and_substitute will replace the virtual | |
65 | incoming argument and virtual stacked variables registers with new | |
66 | pseudos that contain pointers into the replacement area allocated for | |
67 | this inline instance. These pseudos are then marked as being equivalent | |
68 | to the appropriate address and substituted if valid. */ | |
69 | rtx *const_equiv_map; | |
4c9c8227 CH |
70 | /* Number of entries in const_equiv_map and const_arg_map. */ |
71 | int const_equiv_map_size; | |
3250221d RS |
72 | /* This is incremented for each new basic block. |
73 | It is used to store in const_age_map to record the domain of validity | |
74 | of each entry in const_equiv_map. | |
75 | A value of -1 indicates an entry for a reg which is a parm. | |
76 | All other values are "positive". */ | |
77 | #define CONST_AGE_PARM (-1) | |
78 | unsigned int const_age; | |
79 | /* In parallel with const_equiv_map, record the valid age for each entry. | |
80 | The entry is invalid if its age is less than const_age. */ | |
81 | unsigned int *const_age_map; | |
82 | /* Target of the inline function being expanded, or NULL if none. */ | |
83 | rtx inline_target; | |
84 | /* When an insn is being copied by copy_rtx_and_substitute, | |
85 | this is nonzero if we have copied an ASM_OPERANDS. | |
86 | In that case, it is the original input-operand vector. */ | |
87 | rtvec orig_asm_operands_vector; | |
88 | /* When an insn is being copied by copy_rtx_and_substitute, | |
89 | this is nonzero if we have copied an ASM_OPERANDS. | |
90 | In that case, it is the copied input-operand vector. */ | |
91 | rtvec copy_asm_operands_vector; | |
92 | /* Likewise, this is the copied constraints vector. */ | |
93 | rtvec copy_asm_constraints_vector; | |
94 | ||
95 | /* The next few fields are used for subst_constants to record the SETs | |
96 | that it saw. */ | |
97 | int num_sets; | |
98 | struct equiv_table | |
99 | { | |
100 | rtx dest; | |
101 | rtx equiv; | |
102 | } equiv_sets[MAX_RECOG_OPERANDS]; | |
103 | /* Record the last thing assigned to pc. This is used for folded | |
104 | conditional branch insns. */ | |
105 | rtx last_pc_value; | |
106 | #ifdef HAVE_cc0 | |
107 | /* Record the last thing assigned to cc0. */ | |
108 | rtx last_cc0_value; | |
109 | #endif | |
110 | }; | |
111 | ||
112 | /* Return a copy of an rtx (as needed), substituting pseudo-register, | |
113 | labels, and frame-pointer offsets as necessary. */ | |
521f2d6f | 114 | extern rtx copy_rtx_and_substitute PROTO((rtx, struct inline_remap *)); |
3250221d | 115 | |
521f2d6f | 116 | extern void try_constants PROTO((rtx, struct inline_remap *)); |
3250221d | 117 | |
521f2d6f | 118 | extern void mark_stores PROTO((rtx, rtx)); |
3250221d RS |
119 | |
120 | extern rtx *global_const_equiv_map; |