Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-inline.h @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Tree inlining hooks and declarations. | 1 /* Tree inlining hooks and declarations. |
2 Copyright 2001, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. | 2 Copyright 2001, 2003, 2004, 2005, 2007, 2008, 2009 |
3 Free Software Foundation, Inc. | |
3 Contributed by Alexandre Oliva <aoliva@redhat.com> | 4 Contributed by Alexandre Oliva <aoliva@redhat.com> |
4 | 5 |
5 This file is part of GCC. | 6 This file is part of GCC. |
6 | 7 |
7 GCC is free software; you can redistribute it and/or modify | 8 GCC is free software; you can redistribute it and/or modify |
19 <http://www.gnu.org/licenses/>. */ | 20 <http://www.gnu.org/licenses/>. */ |
20 | 21 |
21 #ifndef GCC_TREE_INLINE_H | 22 #ifndef GCC_TREE_INLINE_H |
22 #define GCC_TREE_INLINE_H | 23 #define GCC_TREE_INLINE_H |
23 | 24 |
24 #include "varray.h" | 25 #include "gimple.h" |
25 #include "pointer-set.h" | |
26 | 26 |
27 struct cgraph_edge; | |
28 | |
29 /* Indicate the desired behavior wrt call graph edges. We can either | |
30 duplicate the edge (inlining, cloning), move the edge (versioning, | |
31 parallelization), or move the edges of the clones (saving). */ | |
32 | |
33 enum copy_body_cge_which | |
34 { | |
35 CB_CGE_DUPLICATE, | |
36 CB_CGE_MOVE, | |
37 CB_CGE_MOVE_CLONES | |
38 }; | |
27 | 39 |
28 /* Data required for function body duplication. */ | 40 /* Data required for function body duplication. */ |
29 | 41 |
30 typedef struct copy_body_data | 42 typedef struct copy_body_data |
31 { | 43 { |
63 | 75 |
64 /* GIMPLE_CALL if va arg parameter packs should be expanded or NULL | 76 /* GIMPLE_CALL if va arg parameter packs should be expanded or NULL |
65 is not. */ | 77 is not. */ |
66 gimple gimple_call; | 78 gimple gimple_call; |
67 | 79 |
68 /* Exception region the inlined call lie in. */ | 80 /* Exception landing pad the inlined call lies in. */ |
69 int eh_region; | 81 int eh_lp_nr; |
70 | 82 |
71 /* Take region number in the function being copied, add this value and | 83 /* Maps region and landing pad structures from the function being copied |
72 get eh region number of the duplicate in the function we inline into. */ | 84 to duplicates created within the function we inline into. */ |
73 int eh_region_offset; | 85 struct pointer_map_t *eh_map; |
74 | 86 |
75 /* We use the same mechanism do all sorts of different things. Rather | 87 /* We use the same mechanism do all sorts of different things. Rather |
76 than enumerating the different cases, we categorize the behavior | 88 than enumerating the different cases, we categorize the behavior |
77 in the various situations. */ | 89 in the various situations. */ |
78 | 90 |
79 /* Indicate the desired behavior wrt call graph edges. We can either | 91 /* What to do with call graph edges. */ |
80 duplicate the edge (inlining, cloning), move the edge (versioning, | 92 enum copy_body_cge_which transform_call_graph_edges; |
81 parallelization), or move the edges of the clones (saving). */ | |
82 enum copy_body_cge_which { | |
83 CB_CGE_DUPLICATE, | |
84 CB_CGE_MOVE, | |
85 CB_CGE_MOVE_CLONES | |
86 } transform_call_graph_edges; | |
87 | 93 |
88 /* True if a new CFG should be created. False for inlining, true for | 94 /* True if a new CFG should be created. False for inlining, true for |
89 everything else. */ | 95 everything else. */ |
90 bool transform_new_cfg; | 96 bool transform_new_cfg; |
91 | 97 |
95 bool transform_return_to_modify; | 101 bool transform_return_to_modify; |
96 | 102 |
97 /* True if this statement will need to be regimplified. */ | 103 /* True if this statement will need to be regimplified. */ |
98 bool regimplify; | 104 bool regimplify; |
99 | 105 |
106 /* True if trees should not be unshared. */ | |
107 bool do_not_unshare; | |
108 | |
100 /* > 0 if we are remapping a type currently. */ | 109 /* > 0 if we are remapping a type currently. */ |
101 int remapping_type_depth; | 110 int remapping_type_depth; |
102 | 111 |
103 /* A function to be called when duplicating BLOCK nodes. */ | 112 /* A function to be called when duplicating BLOCK nodes. */ |
104 void (*transform_lang_insert_block) (tree); | 113 void (*transform_lang_insert_block) (tree); |
106 /* Statements that might be possibly folded. */ | 115 /* Statements that might be possibly folded. */ |
107 struct pointer_set_t *statements_to_fold; | 116 struct pointer_set_t *statements_to_fold; |
108 | 117 |
109 /* Entry basic block to currently copied body. */ | 118 /* Entry basic block to currently copied body. */ |
110 struct basic_block_def *entry_bb; | 119 struct basic_block_def *entry_bb; |
120 | |
121 /* Debug statements that need processing. */ | |
122 VEC(gimple,heap) *debug_stmts; | |
123 | |
124 /* A map from local declarations in the inlined function to | |
125 equivalents in the function into which it is being inlined, where | |
126 the originals have been mapped to a value rather than to a | |
127 variable. */ | |
128 struct pointer_map_t *debug_map; | |
111 } copy_body_data; | 129 } copy_body_data; |
112 | 130 |
113 /* Weights of constructions for estimate_num_insns. */ | 131 /* Weights of constructions for estimate_num_insns. */ |
114 | 132 |
115 typedef struct eni_weights_d | 133 typedef struct eni_weights_d |
123 /* Cost of "expensive" div and mod operations. */ | 141 /* Cost of "expensive" div and mod operations. */ |
124 unsigned div_mod_cost; | 142 unsigned div_mod_cost; |
125 | 143 |
126 /* Cost for omp construct. */ | 144 /* Cost for omp construct. */ |
127 unsigned omp_cost; | 145 unsigned omp_cost; |
146 | |
147 /* True when time of statemnt should be estimated. Thus i.e | |
148 cost of switch statement is logarithmic rather than linear in number | |
149 of cases. */ | |
150 bool time_based; | |
128 } eni_weights; | 151 } eni_weights; |
129 | 152 |
130 /* Weights that estimate_num_insns uses for heuristics in inlining. */ | 153 /* Weights that estimate_num_insns uses for heuristics in inlining. */ |
131 | 154 |
132 extern eni_weights eni_inlining_weights; | 155 extern eni_weights eni_inlining_weights; |
145 | 168 |
146 extern tree copy_tree_body_r (tree *, int *, void *); | 169 extern tree copy_tree_body_r (tree *, int *, void *); |
147 extern void insert_decl_map (copy_body_data *, tree, tree); | 170 extern void insert_decl_map (copy_body_data *, tree, tree); |
148 | 171 |
149 unsigned int optimize_inline_calls (tree); | 172 unsigned int optimize_inline_calls (tree); |
173 tree maybe_inline_call_in_expr (tree); | |
150 bool tree_inlinable_function_p (tree); | 174 bool tree_inlinable_function_p (tree); |
151 tree copy_tree_r (tree *, int *, void *); | 175 tree copy_tree_r (tree *, int *, void *); |
152 tree copy_decl_no_change (tree decl, copy_body_data *id); | 176 tree copy_decl_no_change (tree decl, copy_body_data *id); |
153 void save_body (tree, tree *, tree *); | 177 void save_body (tree, tree *, tree *); |
154 int estimate_move_cost (tree type); | 178 int estimate_move_cost (tree type); |
155 int estimate_num_insns (gimple, eni_weights *); | 179 int estimate_num_insns (gimple, eni_weights *); |
156 int estimate_num_insns_fn (tree, eni_weights *); | 180 int estimate_num_insns_fn (tree, eni_weights *); |
157 int count_insns_seq (gimple_seq, eni_weights *); | 181 int count_insns_seq (gimple_seq, eni_weights *); |
158 bool tree_versionable_function_p (tree); | 182 bool tree_versionable_function_p (tree); |
159 void tree_function_versioning (tree, tree, varray_type, bool, bitmap); | 183 bool tree_can_inline_p (struct cgraph_edge *e); |
160 bool tree_can_inline_p (tree, tree); | |
161 | 184 |
162 extern gimple_seq remap_gimple_seq (gimple_seq, copy_body_data *); | 185 extern gimple_seq remap_gimple_seq (gimple_seq, copy_body_data *); |
163 extern tree remap_decl (tree decl, copy_body_data *id); | 186 extern tree remap_decl (tree decl, copy_body_data *id); |
164 extern tree remap_type (tree type, copy_body_data *id); | 187 extern tree remap_type (tree type, copy_body_data *id); |
165 extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq); | 188 extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq); |