comparison gcc/tree-pass.h @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
15:561a7518be6b 16:04ced10e8804
1 /* Definitions for describing one tree-ssa optimization pass. 1 /* Definitions for describing one tree-ssa optimization pass.
2 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 2 Copyright (C) 2004-2017 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 Contributed by Richard Henderson <rth@redhat.com> 3 Contributed by Richard Henderson <rth@redhat.com>
5 4
6 This file is part of GCC. 5 This file is part of GCC.
7 6
8 GCC is free software; you can redistribute it and/or modify 7 GCC is free software; you can redistribute it and/or modify
22 21
23 #ifndef GCC_TREE_PASS_H 22 #ifndef GCC_TREE_PASS_H
24 #define GCC_TREE_PASS_H 1 23 #define GCC_TREE_PASS_H 1
25 24
26 #include "timevar.h" 25 #include "timevar.h"
27 26 #include "dumpfile.h"
28 /* Different tree dump places. When you add new tree dump places, 27
29 extend the DUMP_FILES array in tree-dump.c. */ 28 struct function;
30 enum tree_dump_index
31 {
32 TDI_none, /* No dump */
33 TDI_cgraph, /* dump function call graph. */
34 TDI_tu, /* dump the whole translation unit. */
35 TDI_class, /* dump class hierarchy. */
36 TDI_original, /* dump each function before optimizing it */
37 TDI_generic, /* dump each function after genericizing it */
38 TDI_nested, /* dump each function after unnesting it */
39 TDI_vcg, /* create a VCG graph file for each
40 function's flowgraph. */
41 TDI_ada, /* dump declarations in Ada syntax. */
42 TDI_tree_all, /* enable all the GENERIC/GIMPLE dumps. */
43 TDI_rtl_all, /* enable all the RTL dumps. */
44 TDI_ipa_all, /* enable all the IPA dumps. */
45
46 TDI_end
47 };
48
49 /* Bit masks to control dumping. Not all values are applicable to
50 all dumps. Add new ones at the end. When you define new
51 values, extend the DUMP_OPTIONS array in tree-dump.c */
52 #define TDF_ADDRESS (1 << 0) /* dump node addresses */
53 #define TDF_SLIM (1 << 1) /* don't go wild following links */
54 #define TDF_RAW (1 << 2) /* don't unparse the function */
55 #define TDF_DETAILS (1 << 3) /* show more detailed info about
56 each pass */
57 #define TDF_STATS (1 << 4) /* dump various statistics about
58 each pass */
59 #define TDF_BLOCKS (1 << 5) /* display basic block boundaries */
60 #define TDF_VOPS (1 << 6) /* display virtual operands */
61 #define TDF_LINENO (1 << 7) /* display statement line numbers */
62 #define TDF_UID (1 << 8) /* display decl UIDs */
63
64 #define TDF_TREE (1 << 9) /* is a tree dump */
65 #define TDF_RTL (1 << 10) /* is a RTL dump */
66 #define TDF_IPA (1 << 11) /* is an IPA dump */
67 #define TDF_STMTADDR (1 << 12) /* Address of stmt. */
68
69 #define TDF_GRAPH (1 << 13) /* a graph dump is being emitted */
70 #define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr.
71 Implies TDF_VOPS. */
72
73 #define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
74 message. */
75 #define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
76 dumper to print stmts. */
77 #define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
78 a gimple stmt. */
79 #define TDF_ASMNAME (1 << 18) /* display asm names of decls */
80 #define TDF_EH (1 << 19) /* display EH region number
81 holding this gimple statement. */
82 #define TDF_NOUID (1 << 20) /* omit UIDs from dumps. */
83 #define TDF_ALIAS (1 << 21) /* display alias information */
84 #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
85 #define TDF_CSELIB (1 << 23) /* Dump cselib details. */
86
87
88 /* In tree-dump.c */
89
90 extern char *get_dump_file_name (int);
91 extern int dump_enabled_p (int);
92 extern int dump_initialized_p (int);
93 extern FILE *dump_begin (int, int *);
94 extern void dump_end (int, FILE *);
95 extern void dump_node (const_tree, int, FILE *);
96 extern int dump_switch_p (const char *);
97 extern const char *dump_flag_name (int);
98
99 /* Global variables used to communicate with passes. */
100 extern FILE *dump_file;
101 extern int dump_flags;
102 extern const char *dump_file_name;
103
104 /* Return the dump_file_info for the given phase. */
105 extern struct dump_file_info *get_dump_file_info (int);
106 29
107 /* Optimization pass type. */ 30 /* Optimization pass type. */
108 enum opt_pass_type 31 enum opt_pass_type
109 { 32 {
110 GIMPLE_PASS, 33 GIMPLE_PASS,
111 RTL_PASS, 34 RTL_PASS,
112 SIMPLE_IPA_PASS, 35 SIMPLE_IPA_PASS,
113 IPA_PASS 36 IPA_PASS
114 }; 37 };
115 38
116 /* Describe one pass; this is the common part shared across different pass 39 /* Metadata for a pass, non-varying across all instances of a pass. */
117 types. */ 40 struct pass_data
118 struct opt_pass
119 { 41 {
120 /* Optimization pass type. */ 42 /* Optimization pass type. */
121 enum opt_pass_type type; 43 enum opt_pass_type type;
122 44
123 /* Terse name of the pass used as a fragment of the dump file 45 /* Terse name of the pass used as a fragment of the dump file
124 name. If the name starts with a star, no dump happens. */ 46 name. If the name starts with a star, no dump happens. */
125 const char *name; 47 const char *name;
126 48
127 /* If non-null, this pass and all sub-passes are executed only if 49 /* The -fopt-info optimization group flags as defined in dumpfile.h. */
128 the function returns true. */ 50 unsigned int optinfo_flags;
129 bool (*gate) (void);
130
131 /* This is the code to run. If null, then there should be sub-passes
132 otherwise this pass does nothing. The return value contains
133 TODOs to execute in addition to those in TODO_flags_finish. */
134 unsigned int (*execute) (void);
135
136 /* A list of sub-passes to run, dependent on gate predicate. */
137 struct opt_pass *sub;
138
139 /* Next in the list of passes to run, independent of gate predicate. */
140 struct opt_pass *next;
141
142 /* Static pass number, used as a fragment of the dump file name. */
143 int static_pass_number;
144 51
145 /* The timevar id associated with this pass. */ 52 /* The timevar id associated with this pass. */
146 /* ??? Ideally would be dynamically assigned. */ 53 /* ??? Ideally would be dynamically assigned. */
147 timevar_id_t tv_id; 54 timevar_id_t tv_id;
148 55
154 /* Flags indicating common sets things to do before and after. */ 61 /* Flags indicating common sets things to do before and after. */
155 unsigned int todo_flags_start; 62 unsigned int todo_flags_start;
156 unsigned int todo_flags_finish; 63 unsigned int todo_flags_finish;
157 }; 64 };
158 65
66 namespace gcc
67 {
68 class context;
69 } // namespace gcc
70
71 /* An instance of a pass. This is also "pass_data" to minimize the
72 changes in existing code. */
73 class opt_pass : public pass_data
74 {
75 public:
76 virtual ~opt_pass () { }
77
78 /* Create a copy of this pass.
79
80 Passes that can have multiple instances must provide their own
81 implementation of this, to ensure that any sharing of state between
82 this instance and the copy is "wired up" correctly.
83
84 The default implementation prints an error message and aborts. */
85 virtual opt_pass *clone ();
86 virtual void set_pass_param (unsigned int, bool);
87
88 /* This pass and all sub-passes are executed only if the function returns
89 true. The default implementation returns true. */
90 virtual bool gate (function *fun);
91
92 /* This is the code to run. If this is not overridden, then there should
93 be sub-passes otherwise this pass does nothing.
94 The return value contains TODOs to execute in addition to those in
95 TODO_flags_finish. */
96 virtual unsigned int execute (function *fun);
97
98 protected:
99 opt_pass (const pass_data&, gcc::context *);
100
101 public:
102 /* A list of sub-passes to run, dependent on gate predicate. */
103 opt_pass *sub;
104
105 /* Next in the list of passes to run, independent of gate predicate. */
106 opt_pass *next;
107
108 /* Static pass number, used as a fragment of the dump file name. */
109 int static_pass_number;
110
111 protected:
112 gcc::context *m_ctxt;
113 };
114
159 /* Description of GIMPLE pass. */ 115 /* Description of GIMPLE pass. */
160 struct gimple_opt_pass 116 class gimple_opt_pass : public opt_pass
161 { 117 {
162 struct opt_pass pass; 118 protected:
119 gimple_opt_pass (const pass_data& data, gcc::context *ctxt)
120 : opt_pass (data, ctxt)
121 {
122 }
163 }; 123 };
164 124
165 /* Description of RTL pass. */ 125 /* Description of RTL pass. */
166 struct rtl_opt_pass 126 class rtl_opt_pass : public opt_pass
167 { 127 {
168 struct opt_pass pass; 128 protected:
169 }; 129 rtl_opt_pass (const pass_data& data, gcc::context *ctxt)
170 130 : opt_pass (data, ctxt)
171 struct varpool_node; 131 {
132 }
133 };
134
135 class varpool_node;
172 struct cgraph_node; 136 struct cgraph_node;
173 struct cgraph_node_set_def; 137 struct lto_symtab_encoder_d;
174 struct varpool_node_set_def;
175 138
176 /* Description of IPA pass with generate summary, write, execute, read and 139 /* Description of IPA pass with generate summary, write, execute, read and
177 transform stages. */ 140 transform stages. */
178 struct ipa_opt_pass_d 141 class ipa_opt_pass_d : public opt_pass
179 { 142 {
180 struct opt_pass pass; 143 public:
181
182 /* IPA passes can analyze function body and variable initializers 144 /* IPA passes can analyze function body and variable initializers
183 using this hook and produce summary. */ 145 using this hook and produce summary. */
184 void (*generate_summary) (void); 146 void (*generate_summary) (void);
185 147
186 /* This hook is used to serialize IPA summaries on disk. */ 148 /* This hook is used to serialize IPA summaries on disk. */
187 void (*write_summary) (struct cgraph_node_set_def *, 149 void (*write_summary) (void);
188 struct varpool_node_set_def *);
189 150
190 /* This hook is used to deserialize IPA summaries from disk. */ 151 /* This hook is used to deserialize IPA summaries from disk. */
191 void (*read_summary) (void); 152 void (*read_summary) (void);
192 153
193 /* This hook is used to serialize IPA optimization summaries on disk. */ 154 /* This hook is used to serialize IPA optimization summaries on disk. */
194 void (*write_optimization_summary) (struct cgraph_node_set_def *, 155 void (*write_optimization_summary) (void);
195 struct varpool_node_set_def *);
196 156
197 /* This hook is used to deserialize IPA summaries from disk. */ 157 /* This hook is used to deserialize IPA summaries from disk. */
198 void (*read_optimization_summary) (void); 158 void (*read_optimization_summary) (void);
199 159
200 /* Hook to convert gimple stmt uids into true gimple statements. The second 160 /* Hook to convert gimple stmt uids into true gimple statements. The second
201 parameter is an array of statements indexed by their uid. */ 161 parameter is an array of statements indexed by their uid. */
202 void (*stmt_fixup) (struct cgraph_node *, gimple *); 162 void (*stmt_fixup) (struct cgraph_node *, gimple **);
203 163
204 /* Results of interprocedural propagation of an IPA pass is applied to 164 /* Results of interprocedural propagation of an IPA pass is applied to
205 function body via this hook. */ 165 function body via this hook. */
206 unsigned int function_transform_todo_flags_start; 166 unsigned int function_transform_todo_flags_start;
207 unsigned int (*function_transform) (struct cgraph_node *); 167 unsigned int (*function_transform) (struct cgraph_node *);
208 void (*variable_transform) (struct varpool_node *); 168 void (*variable_transform) (varpool_node *);
169
170 protected:
171 ipa_opt_pass_d (const pass_data& data, gcc::context *ctxt,
172 void (*generate_summary) (void),
173 void (*write_summary) (void),
174 void (*read_summary) (void),
175 void (*write_optimization_summary) (void),
176 void (*read_optimization_summary) (void),
177 void (*stmt_fixup) (struct cgraph_node *, gimple **),
178 unsigned int function_transform_todo_flags_start,
179 unsigned int (*function_transform) (struct cgraph_node *),
180 void (*variable_transform) (varpool_node *))
181 : opt_pass (data, ctxt),
182 generate_summary (generate_summary),
183 write_summary (write_summary),
184 read_summary (read_summary),
185 write_optimization_summary (write_optimization_summary),
186 read_optimization_summary (read_optimization_summary),
187 stmt_fixup (stmt_fixup),
188 function_transform_todo_flags_start (function_transform_todo_flags_start),
189 function_transform (function_transform),
190 variable_transform (variable_transform)
191 {
192 }
209 }; 193 };
210 194
211 /* Description of simple IPA pass. Simple IPA passes have just one execute 195 /* Description of simple IPA pass. Simple IPA passes have just one execute
212 hook. */ 196 hook. */
213 struct simple_ipa_opt_pass 197 class simple_ipa_opt_pass : public opt_pass
214 { 198 {
215 struct opt_pass pass; 199 protected:
216 }; 200 simple_ipa_opt_pass (const pass_data& data, gcc::context *ctxt)
217 201 : opt_pass (data, ctxt)
218 /* Define a tree dump switch. */ 202 {
219 struct dump_file_info 203 }
220 {
221 const char *suffix; /* suffix to give output file. */
222 const char *swtch; /* command line switch */
223 const char *glob; /* command line glob */
224 int flags; /* user flags */
225 int state; /* state of play */
226 int num; /* dump file number */
227 }; 204 };
228 205
229 /* Pass properties. */ 206 /* Pass properties. */
230 #define PROP_gimple_any (1 << 0) /* entire gimple grammar */ 207 #define PROP_gimple_any (1 << 0) /* entire gimple grammar */
231 #define PROP_gimple_lcf (1 << 1) /* lowered control flow */ 208 #define PROP_gimple_lcf (1 << 1) /* lowered control flow */
232 #define PROP_gimple_leh (1 << 2) /* lowered eh */ 209 #define PROP_gimple_leh (1 << 2) /* lowered eh */
233 #define PROP_cfg (1 << 3) 210 #define PROP_cfg (1 << 3)
234 #define PROP_referenced_vars (1 << 4)
235 #define PROP_ssa (1 << 5) 211 #define PROP_ssa (1 << 5)
236 #define PROP_no_crit_edges (1 << 6) 212 #define PROP_no_crit_edges (1 << 6)
237 #define PROP_rtl (1 << 7) 213 #define PROP_rtl (1 << 7)
238 #define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */ 214 #define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */
239 #define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */ 215 #define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */
240 #define PROP_gimple_lcx (1 << 10) /* lowered complex */ 216 #define PROP_gimple_lcx (1 << 10) /* lowered complex */
217 #define PROP_loops (1 << 11) /* preserve loop structures */
218 #define PROP_gimple_lvec (1 << 12) /* lowered vector */
219 #define PROP_gimple_eomp (1 << 13) /* no OpenMP directives */
220 #define PROP_gimple_lva (1 << 14) /* No va_arg internal function. */
221 #define PROP_gimple_opt_math (1 << 15) /* Disable canonicalization
222 of math functions; the
223 current choices have
224 been optimized. */
225 #define PROP_gimple_lomp_dev (1 << 16) /* done omp_device_lower */
226 #define PROP_rtl_split_insns (1 << 17) /* RTL has insns split. */
241 227
242 #define PROP_trees \ 228 #define PROP_trees \
243 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp) 229 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
244 230
245 /* To-do flags. */ 231 /* To-do flags. */
246 #define TODO_dump_func (1 << 0) 232 #define TODO_do_not_ggc_collect (1 << 1)
247 #define TODO_ggc_collect (1 << 1)
248 #define TODO_verify_ssa (1 << 2)
249 #define TODO_verify_flow (1 << 3)
250 #define TODO_verify_stmts (1 << 4)
251 #define TODO_cleanup_cfg (1 << 5) 233 #define TODO_cleanup_cfg (1 << 5)
252 #define TODO_dump_cgraph (1 << 7) 234 #define TODO_verify_il (1 << 6)
235 #define TODO_dump_symtab (1 << 7)
253 #define TODO_remove_functions (1 << 8) 236 #define TODO_remove_functions (1 << 8)
254 #define TODO_rebuild_frequencies (1 << 9) 237 #define TODO_rebuild_frequencies (1 << 9)
255 #define TODO_verify_rtl_sharing (1 << 10)
256 238
257 /* To-do flags for calls to update_ssa. */ 239 /* To-do flags for calls to update_ssa. */
258 240
259 /* Update the SSA form inserting PHI nodes for newly exposed symbols 241 /* Update the SSA form inserting PHI nodes for newly exposed symbols
260 and virtual names marked for updating. When updating real names, 242 and virtual names marked for updating. When updating real names,
314 #define TODO_update_address_taken (1 << 21) 296 #define TODO_update_address_taken (1 << 21)
315 297
316 /* Rebuild the callgraph edges. */ 298 /* Rebuild the callgraph edges. */
317 #define TODO_rebuild_cgraph_edges (1 << 22) 299 #define TODO_rebuild_cgraph_edges (1 << 22)
318 300
301 /* Release function body and stop pass manager. */
302 #define TODO_discard_function (1 << 23)
303
319 /* Internally used in execute_function_todo(). */ 304 /* Internally used in execute_function_todo(). */
320 #define TODO_update_ssa_any \ 305 #define TODO_update_ssa_any \
321 (TODO_update_ssa \ 306 (TODO_update_ssa \
322 | TODO_update_ssa_no_phi \ 307 | TODO_update_ssa_no_phi \
323 | TODO_update_ssa_full_phi \ 308 | TODO_update_ssa_full_phi \
324 | TODO_update_ssa_only_virtuals) 309 | TODO_update_ssa_only_virtuals)
325 310
326 #define TODO_verify_all \ 311 #define TODO_verify_all TODO_verify_il
327 (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
328 312
329 313
330 /* Register pass info. */ 314 /* Register pass info. */
331 315
332 enum pass_positioning_ops 316 enum pass_positioning_ops
336 PASS_POS_REPLACE /* Replace the reference pass. */ 320 PASS_POS_REPLACE /* Replace the reference pass. */
337 }; 321 };
338 322
339 struct register_pass_info 323 struct register_pass_info
340 { 324 {
341 struct opt_pass *pass; /* New pass to register. */ 325 opt_pass *pass; /* New pass to register. */
342 const char *reference_pass_name; /* Name of the reference pass for hooking 326 const char *reference_pass_name; /* Name of the reference pass for hooking
343 up the new pass. */ 327 up the new pass. */
344 int ref_pass_instance_number; /* Insert the pass at the specified 328 int ref_pass_instance_number; /* Insert the pass at the specified
345 instance number of the reference pass. 329 instance number of the reference pass.
346 Do it for every instance if it is 0. */ 330 Do it for every instance if it is 0. */
347 enum pass_positioning_ops pos_op; /* how to insert the new pass. */ 331 enum pass_positioning_ops pos_op; /* how to insert the new pass. */
348 }; 332 };
349 333
350 extern void tree_lowering_passes (tree decl); 334 /* Registers a new pass. Either fill out the register_pass_info or specify
351 335 the individual parameters. The pass object is expected to have been
352 extern struct gimple_opt_pass pass_mudflap_1; 336 allocated using operator new and the pass manager takes the ownership of
353 extern struct gimple_opt_pass pass_mudflap_2; 337 the pass object. */
354 extern struct gimple_opt_pass pass_lower_cf; 338 extern void register_pass (register_pass_info *);
355 extern struct gimple_opt_pass pass_refactor_eh; 339 extern void register_pass (opt_pass* pass, pass_positioning_ops pos,
356 extern struct gimple_opt_pass pass_lower_eh; 340 const char* ref_pass_name, int ref_pass_inst_number);
357 extern struct gimple_opt_pass pass_lower_eh_dispatch; 341
358 extern struct gimple_opt_pass pass_lower_resx; 342 extern simple_ipa_opt_pass *make_pass_ipa_chkp_versioning (gcc::context *ctxt);
359 extern struct gimple_opt_pass pass_build_cfg; 343 extern simple_ipa_opt_pass *make_pass_ipa_chkp_early_produce_thunks (gcc::context *ctxt);
360 extern struct gimple_opt_pass pass_early_tree_profile; 344 extern simple_ipa_opt_pass *make_pass_ipa_chkp_produce_thunks (gcc::context *ctxt);
361 extern struct gimple_opt_pass pass_referenced_vars; 345 extern gimple_opt_pass *make_pass_chkp (gcc::context *ctxt);
362 extern struct gimple_opt_pass pass_cleanup_eh; 346 extern gimple_opt_pass *make_pass_chkp_opt (gcc::context *ctxt);
363 extern struct gimple_opt_pass pass_sra; 347 extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt);
364 extern struct gimple_opt_pass pass_sra_early; 348 extern gimple_opt_pass *make_pass_asan_O0 (gcc::context *ctxt);
365 extern struct gimple_opt_pass pass_early_ipa_sra; 349 extern gimple_opt_pass *make_pass_tsan (gcc::context *ctxt);
366 extern struct gimple_opt_pass pass_tail_recursion; 350 extern gimple_opt_pass *make_pass_tsan_O0 (gcc::context *ctxt);
367 extern struct gimple_opt_pass pass_tail_calls; 351 extern gimple_opt_pass *make_pass_sancov (gcc::context *ctxt);
368 extern struct gimple_opt_pass pass_tree_loop; 352 extern gimple_opt_pass *make_pass_sancov_O0 (gcc::context *ctxt);
369 extern struct gimple_opt_pass pass_tree_loop_init; 353 extern gimple_opt_pass *make_pass_lower_cf (gcc::context *ctxt);
370 extern struct gimple_opt_pass pass_lim; 354 extern gimple_opt_pass *make_pass_refactor_eh (gcc::context *ctxt);
371 extern struct gimple_opt_pass pass_tree_unswitch; 355 extern gimple_opt_pass *make_pass_lower_eh (gcc::context *ctxt);
372 extern struct gimple_opt_pass pass_predcom; 356 extern gimple_opt_pass *make_pass_lower_eh_dispatch (gcc::context *ctxt);
373 extern struct gimple_opt_pass pass_iv_canon; 357 extern gimple_opt_pass *make_pass_lower_resx (gcc::context *ctxt);
374 extern struct gimple_opt_pass pass_scev_cprop; 358 extern gimple_opt_pass *make_pass_build_cfg (gcc::context *ctxt);
375 extern struct gimple_opt_pass pass_empty_loop; 359 extern gimple_opt_pass *make_pass_early_tree_profile (gcc::context *ctxt);
376 extern struct gimple_opt_pass pass_record_bounds; 360 extern gimple_opt_pass *make_pass_cleanup_eh (gcc::context *ctxt);
377 extern struct gimple_opt_pass pass_graphite; 361 extern gimple_opt_pass *make_pass_sra (gcc::context *ctxt);
378 extern struct gimple_opt_pass pass_graphite_transforms; 362 extern gimple_opt_pass *make_pass_sra_early (gcc::context *ctxt);
379 extern struct gimple_opt_pass pass_if_conversion; 363 extern gimple_opt_pass *make_pass_early_ipa_sra (gcc::context *ctxt);
380 extern struct gimple_opt_pass pass_loop_distribution; 364 extern gimple_opt_pass *make_pass_tail_recursion (gcc::context *ctxt);
381 extern struct gimple_opt_pass pass_vectorize; 365 extern gimple_opt_pass *make_pass_tail_calls (gcc::context *ctxt);
382 extern struct gimple_opt_pass pass_slp_vectorize; 366 extern gimple_opt_pass *make_pass_fix_loops (gcc::context *ctxt);
383 extern struct gimple_opt_pass pass_complete_unroll; 367 extern gimple_opt_pass *make_pass_tree_loop (gcc::context *ctxt);
384 extern struct gimple_opt_pass pass_complete_unrolli; 368 extern gimple_opt_pass *make_pass_tree_no_loop (gcc::context *ctxt);
385 extern struct gimple_opt_pass pass_parallelize_loops; 369 extern gimple_opt_pass *make_pass_tree_loop_init (gcc::context *ctxt);
386 extern struct gimple_opt_pass pass_loop_prefetch; 370 extern gimple_opt_pass *make_pass_lim (gcc::context *ctxt);
387 extern struct gimple_opt_pass pass_iv_optimize; 371 extern gimple_opt_pass *make_pass_tree_unswitch (gcc::context *ctxt);
388 extern struct gimple_opt_pass pass_tree_loop_done; 372 extern gimple_opt_pass *make_pass_loop_split (gcc::context *ctxt);
389 extern struct gimple_opt_pass pass_ch; 373 extern gimple_opt_pass *make_pass_predcom (gcc::context *ctxt);
390 extern struct gimple_opt_pass pass_ccp; 374 extern gimple_opt_pass *make_pass_iv_canon (gcc::context *ctxt);
391 extern struct gimple_opt_pass pass_phi_only_cprop; 375 extern gimple_opt_pass *make_pass_scev_cprop (gcc::context *ctxt);
392 extern struct gimple_opt_pass pass_build_ssa; 376 extern gimple_opt_pass *make_pass_empty_loop (gcc::context *ctxt);
393 extern struct gimple_opt_pass pass_build_alias; 377 extern gimple_opt_pass *make_pass_graphite (gcc::context *ctxt);
394 extern struct gimple_opt_pass pass_build_ealias; 378 extern gimple_opt_pass *make_pass_graphite_transforms (gcc::context *ctxt);
395 extern struct gimple_opt_pass pass_dominator; 379 extern gimple_opt_pass *make_pass_if_conversion (gcc::context *ctxt);
396 extern struct gimple_opt_pass pass_dce; 380 extern gimple_opt_pass *make_pass_loop_distribution (gcc::context *ctxt);
397 extern struct gimple_opt_pass pass_dce_loop; 381 extern gimple_opt_pass *make_pass_vectorize (gcc::context *ctxt);
398 extern struct gimple_opt_pass pass_cd_dce; 382 extern gimple_opt_pass *make_pass_simduid_cleanup (gcc::context *ctxt);
399 extern struct gimple_opt_pass pass_call_cdce; 383 extern gimple_opt_pass *make_pass_slp_vectorize (gcc::context *ctxt);
400 extern struct gimple_opt_pass pass_merge_phi; 384 extern gimple_opt_pass *make_pass_complete_unroll (gcc::context *ctxt);
401 extern struct gimple_opt_pass pass_split_crit_edges; 385 extern gimple_opt_pass *make_pass_complete_unrolli (gcc::context *ctxt);
402 extern struct gimple_opt_pass pass_pre; 386 extern gimple_opt_pass *make_pass_parallelize_loops (gcc::context *ctxt);
403 extern struct gimple_opt_pass pass_profile; 387 extern gimple_opt_pass *make_pass_loop_prefetch (gcc::context *ctxt);
404 extern struct gimple_opt_pass pass_strip_predict_hints; 388 extern gimple_opt_pass *make_pass_iv_optimize (gcc::context *ctxt);
405 extern struct gimple_opt_pass pass_lower_complex_O0; 389 extern gimple_opt_pass *make_pass_tree_loop_done (gcc::context *ctxt);
406 extern struct gimple_opt_pass pass_lower_complex; 390 extern gimple_opt_pass *make_pass_ch (gcc::context *ctxt);
407 extern struct gimple_opt_pass pass_lower_vector; 391 extern gimple_opt_pass *make_pass_ch_vect (gcc::context *ctxt);
408 extern struct gimple_opt_pass pass_lower_vector_ssa; 392 extern gimple_opt_pass *make_pass_ccp (gcc::context *ctxt);
409 extern struct gimple_opt_pass pass_lower_omp; 393 extern gimple_opt_pass *make_pass_split_paths (gcc::context *ctxt);
410 extern struct gimple_opt_pass pass_diagnose_omp_blocks; 394 extern gimple_opt_pass *make_pass_phi_only_cprop (gcc::context *ctxt);
411 extern struct gimple_opt_pass pass_expand_omp; 395 extern gimple_opt_pass *make_pass_build_ssa (gcc::context *ctxt);
412 extern struct gimple_opt_pass pass_expand_omp_ssa; 396 extern gimple_opt_pass *make_pass_build_alias (gcc::context *ctxt);
413 extern struct gimple_opt_pass pass_object_sizes; 397 extern gimple_opt_pass *make_pass_build_ealias (gcc::context *ctxt);
414 extern struct gimple_opt_pass pass_fold_builtins; 398 extern gimple_opt_pass *make_pass_dominator (gcc::context *ctxt);
415 extern struct gimple_opt_pass pass_stdarg; 399 extern gimple_opt_pass *make_pass_dce (gcc::context *ctxt);
416 extern struct gimple_opt_pass pass_early_warn_uninitialized; 400 extern gimple_opt_pass *make_pass_cd_dce (gcc::context *ctxt);
417 extern struct gimple_opt_pass pass_late_warn_uninitialized; 401 extern gimple_opt_pass *make_pass_call_cdce (gcc::context *ctxt);
418 extern struct gimple_opt_pass pass_cse_reciprocals; 402 extern gimple_opt_pass *make_pass_merge_phi (gcc::context *ctxt);
419 extern struct gimple_opt_pass pass_cse_sincos; 403 extern gimple_opt_pass *make_pass_thread_jumps (gcc::context *ctxt);
420 extern struct gimple_opt_pass pass_optimize_bswap; 404 extern gimple_opt_pass *make_pass_early_thread_jumps (gcc::context *ctxt);
421 extern struct gimple_opt_pass pass_optimize_widening_mul; 405 extern gimple_opt_pass *make_pass_split_crit_edges (gcc::context *ctxt);
422 extern struct gimple_opt_pass pass_warn_function_return; 406 extern gimple_opt_pass *make_pass_laddress (gcc::context *ctxt);
423 extern struct gimple_opt_pass pass_warn_function_noreturn; 407 extern gimple_opt_pass *make_pass_pre (gcc::context *ctxt);
424 extern struct gimple_opt_pass pass_cselim; 408 extern unsigned int tail_merge_optimize (unsigned int);
425 extern struct gimple_opt_pass pass_phiopt; 409 extern gimple_opt_pass *make_pass_profile (gcc::context *ctxt);
426 extern struct gimple_opt_pass pass_forwprop; 410 extern gimple_opt_pass *make_pass_strip_predict_hints (gcc::context *ctxt);
427 extern struct gimple_opt_pass pass_phiprop; 411 extern gimple_opt_pass *make_pass_lower_complex_O0 (gcc::context *ctxt);
428 extern struct gimple_opt_pass pass_tree_ifcombine; 412 extern gimple_opt_pass *make_pass_lower_complex (gcc::context *ctxt);
429 extern struct gimple_opt_pass pass_dse; 413 extern gimple_opt_pass *make_pass_lower_switch (gcc::context *ctxt);
430 extern struct gimple_opt_pass pass_nrv; 414 extern gimple_opt_pass *make_pass_lower_vector (gcc::context *ctxt);
431 extern struct gimple_opt_pass pass_rename_ssa_copies; 415 extern gimple_opt_pass *make_pass_lower_vector_ssa (gcc::context *ctxt);
432 extern struct gimple_opt_pass pass_rest_of_compilation; 416 extern gimple_opt_pass *make_pass_lower_omp (gcc::context *ctxt);
433 extern struct gimple_opt_pass pass_sink_code; 417 extern gimple_opt_pass *make_pass_diagnose_omp_blocks (gcc::context *ctxt);
434 extern struct gimple_opt_pass pass_fre; 418 extern gimple_opt_pass *make_pass_expand_omp (gcc::context *ctxt);
435 extern struct gimple_opt_pass pass_check_data_deps; 419 extern gimple_opt_pass *make_pass_expand_omp_ssa (gcc::context *ctxt);
436 extern struct gimple_opt_pass pass_copy_prop; 420 extern gimple_opt_pass *make_pass_omp_target_link (gcc::context *ctxt);
437 extern struct gimple_opt_pass pass_vrp; 421 extern gimple_opt_pass *make_pass_oacc_device_lower (gcc::context *ctxt);
438 extern struct gimple_opt_pass pass_uncprop; 422 extern gimple_opt_pass *make_pass_omp_device_lower (gcc::context *ctxt);
439 extern struct gimple_opt_pass pass_return_slot; 423 extern gimple_opt_pass *make_pass_object_sizes (gcc::context *ctxt);
440 extern struct gimple_opt_pass pass_reassoc; 424 extern gimple_opt_pass *make_pass_strlen (gcc::context *ctxt);
441 extern struct gimple_opt_pass pass_rebuild_cgraph_edges; 425 extern gimple_opt_pass *make_pass_fold_builtins (gcc::context *ctxt);
442 extern struct gimple_opt_pass pass_remove_cgraph_callee_edges; 426 extern gimple_opt_pass *make_pass_post_ipa_warn (gcc::context *ctxt);
443 extern struct gimple_opt_pass pass_build_cgraph_edges; 427 extern gimple_opt_pass *make_pass_stdarg (gcc::context *ctxt);
444 extern struct gimple_opt_pass pass_local_pure_const; 428 extern gimple_opt_pass *make_pass_early_warn_uninitialized (gcc::context *ctxt);
445 extern struct gimple_opt_pass pass_tracer; 429 extern gimple_opt_pass *make_pass_late_warn_uninitialized (gcc::context *ctxt);
446 extern struct gimple_opt_pass pass_warn_unused_result; 430 extern gimple_opt_pass *make_pass_cse_reciprocals (gcc::context *ctxt);
447 extern struct gimple_opt_pass pass_split_functions; 431 extern gimple_opt_pass *make_pass_cse_sincos (gcc::context *ctxt);
448 extern struct gimple_opt_pass pass_feedback_split_functions; 432 extern gimple_opt_pass *make_pass_optimize_bswap (gcc::context *ctxt);
433 extern gimple_opt_pass *make_pass_store_merging (gcc::context *ctxt);
434 extern gimple_opt_pass *make_pass_optimize_widening_mul (gcc::context *ctxt);
435 extern gimple_opt_pass *make_pass_warn_function_return (gcc::context *ctxt);
436 extern gimple_opt_pass *make_pass_warn_function_noreturn (gcc::context *ctxt);
437 extern gimple_opt_pass *make_pass_cselim (gcc::context *ctxt);
438 extern gimple_opt_pass *make_pass_phiopt (gcc::context *ctxt);
439 extern gimple_opt_pass *make_pass_forwprop (gcc::context *ctxt);
440 extern gimple_opt_pass *make_pass_phiprop (gcc::context *ctxt);
441 extern gimple_opt_pass *make_pass_tree_ifcombine (gcc::context *ctxt);
442 extern gimple_opt_pass *make_pass_dse (gcc::context *ctxt);
443 extern gimple_opt_pass *make_pass_nrv (gcc::context *ctxt);
444 extern gimple_opt_pass *make_pass_rename_ssa_copies (gcc::context *ctxt);
445 extern gimple_opt_pass *make_pass_sink_code (gcc::context *ctxt);
446 extern gimple_opt_pass *make_pass_fre (gcc::context *ctxt);
447 extern gimple_opt_pass *make_pass_check_data_deps (gcc::context *ctxt);
448 extern gimple_opt_pass *make_pass_copy_prop (gcc::context *ctxt);
449 extern gimple_opt_pass *make_pass_isolate_erroneous_paths (gcc::context *ctxt);
450 extern gimple_opt_pass *make_pass_early_vrp (gcc::context *ctxt);
451 extern gimple_opt_pass *make_pass_vrp (gcc::context *ctxt);
452 extern gimple_opt_pass *make_pass_uncprop (gcc::context *ctxt);
453 extern gimple_opt_pass *make_pass_return_slot (gcc::context *ctxt);
454 extern gimple_opt_pass *make_pass_reassoc (gcc::context *ctxt);
455 extern gimple_opt_pass *make_pass_rebuild_cgraph_edges (gcc::context *ctxt);
456 extern gimple_opt_pass *make_pass_remove_cgraph_callee_edges (gcc::context
457 *ctxt);
458 extern gimple_opt_pass *make_pass_build_cgraph_edges (gcc::context *ctxt);
459 extern gimple_opt_pass *make_pass_local_pure_const (gcc::context *ctxt);
460 extern gimple_opt_pass *make_pass_nothrow (gcc::context *ctxt);
461 extern gimple_opt_pass *make_pass_tracer (gcc::context *ctxt);
462 extern gimple_opt_pass *make_pass_warn_unused_result (gcc::context *ctxt);
463 extern gimple_opt_pass *make_pass_diagnose_tm_blocks (gcc::context *ctxt);
464 extern gimple_opt_pass *make_pass_lower_tm (gcc::context *ctxt);
465 extern gimple_opt_pass *make_pass_tm_init (gcc::context *ctxt);
466 extern gimple_opt_pass *make_pass_tm_mark (gcc::context *ctxt);
467 extern gimple_opt_pass *make_pass_tm_memopt (gcc::context *ctxt);
468 extern gimple_opt_pass *make_pass_tm_edges (gcc::context *ctxt);
469 extern gimple_opt_pass *make_pass_split_functions (gcc::context *ctxt);
470 extern gimple_opt_pass *make_pass_feedback_split_functions (gcc::context *ctxt);
471 extern gimple_opt_pass *make_pass_strength_reduction (gcc::context *ctxt);
472 extern gimple_opt_pass *make_pass_vtable_verify (gcc::context *ctxt);
473 extern gimple_opt_pass *make_pass_ubsan (gcc::context *ctxt);
474 extern gimple_opt_pass *make_pass_sanopt (gcc::context *ctxt);
475 extern gimple_opt_pass *make_pass_oacc_kernels (gcc::context *ctxt);
476 extern simple_ipa_opt_pass *make_pass_ipa_oacc (gcc::context *ctxt);
477 extern simple_ipa_opt_pass *make_pass_ipa_oacc_kernels (gcc::context *ctxt);
478 extern gimple_opt_pass *make_pass_gen_hsail (gcc::context *ctxt);
479 extern gimple_opt_pass *make_pass_warn_nonnull_compare (gcc::context *ctxt);
480 extern gimple_opt_pass *make_pass_sprintf_length (gcc::context *ctxt);
481 extern gimple_opt_pass *make_pass_walloca (gcc::context *ctxt);
449 482
450 /* IPA Passes */ 483 /* IPA Passes */
451 extern struct simple_ipa_opt_pass pass_ipa_lower_emutls; 484 extern simple_ipa_opt_pass *make_pass_ipa_lower_emutls (gcc::context *ctxt);
452 extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility; 485 extern simple_ipa_opt_pass
453 extern struct simple_ipa_opt_pass pass_ipa_tree_profile; 486 *make_pass_ipa_function_and_variable_visibility (gcc::context *ctxt);
454 487 extern simple_ipa_opt_pass *make_pass_ipa_tree_profile (gcc::context *ctxt);
455 extern struct simple_ipa_opt_pass pass_early_local_passes; 488 extern simple_ipa_opt_pass *make_pass_ipa_auto_profile (gcc::context *ctxt);
456 489
457 extern struct ipa_opt_pass_d pass_ipa_whole_program_visibility; 490 extern simple_ipa_opt_pass *make_pass_build_ssa_passes (gcc::context *ctxt);
458 extern struct ipa_opt_pass_d pass_ipa_lto_gimple_out; 491 extern simple_ipa_opt_pass *make_pass_chkp_instrumentation_passes (gcc::context *ctxt);
459 extern struct simple_ipa_opt_pass pass_ipa_increase_alignment; 492 extern simple_ipa_opt_pass *make_pass_local_optimization_passes (gcc::context *ctxt);
460 extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg; 493
461 extern struct ipa_opt_pass_d pass_ipa_inline; 494 extern ipa_opt_pass_d *make_pass_ipa_whole_program_visibility (gcc::context
462 extern struct simple_ipa_opt_pass pass_ipa_free_lang_data; 495 *ctxt);
463 extern struct ipa_opt_pass_d pass_ipa_cp; 496 extern simple_ipa_opt_pass *make_pass_ipa_increase_alignment (gcc::context
464 extern struct ipa_opt_pass_d pass_ipa_reference; 497 *ctxt);
465 extern struct ipa_opt_pass_d pass_ipa_pure_const; 498 extern ipa_opt_pass_d *make_pass_ipa_fn_summary (gcc::context *ctxt);
466 extern struct simple_ipa_opt_pass pass_ipa_type_escape; 499 extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt);
467 extern struct simple_ipa_opt_pass pass_ipa_pta; 500 extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt);
468 extern struct simple_ipa_opt_pass pass_ipa_struct_reorg; 501 extern simple_ipa_opt_pass *make_pass_ipa_free_fn_summary (gcc::context *ctxt);
469 extern struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup; 502 extern ipa_opt_pass_d *make_pass_ipa_cp (gcc::context *ctxt);
470 extern struct ipa_opt_pass_d pass_ipa_lto_finish_out; 503 extern ipa_opt_pass_d *make_pass_ipa_icf (gcc::context *ctxt);
471 extern struct ipa_opt_pass_d pass_ipa_profile; 504 extern ipa_opt_pass_d *make_pass_ipa_devirt (gcc::context *ctxt);
472 extern struct ipa_opt_pass_d pass_ipa_cdtor_merge; 505 extern ipa_opt_pass_d *make_pass_ipa_reference (gcc::context *ctxt);
473 506 extern ipa_opt_pass_d *make_pass_ipa_hsa (gcc::context *ctxt);
474 extern struct gimple_opt_pass pass_all_optimizations; 507 extern ipa_opt_pass_d *make_pass_ipa_pure_const (gcc::context *ctxt);
475 extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing; 508 extern simple_ipa_opt_pass *make_pass_ipa_pta (gcc::context *ctxt);
476 extern struct gimple_opt_pass pass_init_datastructures; 509 extern simple_ipa_opt_pass *make_pass_ipa_tm (gcc::context *ctxt);
477 extern struct gimple_opt_pass pass_fixup_cfg; 510 extern simple_ipa_opt_pass *make_pass_target_clone (gcc::context *ctxt);
478 511 extern simple_ipa_opt_pass *make_pass_dispatcher_calls (gcc::context *ctxt);
479 extern struct rtl_opt_pass pass_expand; 512 extern simple_ipa_opt_pass *make_pass_omp_simd_clone (gcc::context *ctxt);
480 extern struct rtl_opt_pass pass_init_function; 513 extern ipa_opt_pass_d *make_pass_ipa_profile (gcc::context *ctxt);
481 extern struct rtl_opt_pass pass_jump; 514 extern ipa_opt_pass_d *make_pass_ipa_cdtor_merge (gcc::context *ctxt);
482 extern struct rtl_opt_pass pass_rtl_eh; 515 extern ipa_opt_pass_d *make_pass_ipa_single_use (gcc::context *ctxt);
483 extern struct rtl_opt_pass pass_initial_value_sets; 516 extern ipa_opt_pass_d *make_pass_ipa_comdats (gcc::context *ctxt);
484 extern struct rtl_opt_pass pass_unshare_all_rtl; 517 extern simple_ipa_opt_pass *make_pass_materialize_all_clones (gcc::context *
485 extern struct rtl_opt_pass pass_instantiate_virtual_regs; 518 ctxt);
486 extern struct rtl_opt_pass pass_rtl_fwprop; 519
487 extern struct rtl_opt_pass pass_rtl_fwprop_addr; 520 extern gimple_opt_pass *make_pass_cleanup_cfg_post_optimizing (gcc::context
488 extern struct rtl_opt_pass pass_jump2; 521 *ctxt);
489 extern struct rtl_opt_pass pass_lower_subreg; 522 extern gimple_opt_pass *make_pass_fixup_cfg (gcc::context *ctxt);
490 extern struct rtl_opt_pass pass_cse; 523 extern gimple_opt_pass *make_pass_backprop (gcc::context *ctxt);
491 extern struct rtl_opt_pass pass_fast_rtl_dce; 524
492 extern struct rtl_opt_pass pass_ud_rtl_dce; 525 extern rtl_opt_pass *make_pass_expand (gcc::context *ctxt);
493 extern struct rtl_opt_pass pass_rtl_dce; 526 extern rtl_opt_pass *make_pass_instantiate_virtual_regs (gcc::context *ctxt);
494 extern struct rtl_opt_pass pass_rtl_dse1; 527 extern rtl_opt_pass *make_pass_rtl_fwprop (gcc::context *ctxt);
495 extern struct rtl_opt_pass pass_rtl_dse2; 528 extern rtl_opt_pass *make_pass_rtl_fwprop_addr (gcc::context *ctxt);
496 extern struct rtl_opt_pass pass_rtl_dse3; 529 extern rtl_opt_pass *make_pass_jump (gcc::context *ctxt);
497 extern struct rtl_opt_pass pass_rtl_cprop; 530 extern rtl_opt_pass *make_pass_jump2 (gcc::context *ctxt);
498 extern struct rtl_opt_pass pass_rtl_pre; 531 extern rtl_opt_pass *make_pass_lower_subreg (gcc::context *ctxt);
499 extern struct rtl_opt_pass pass_rtl_hoist; 532 extern rtl_opt_pass *make_pass_cse (gcc::context *ctxt);
500 extern struct rtl_opt_pass pass_rtl_store_motion; 533 extern rtl_opt_pass *make_pass_fast_rtl_dce (gcc::context *ctxt);
501 extern struct rtl_opt_pass pass_cse_after_global_opts; 534 extern rtl_opt_pass *make_pass_ud_rtl_dce (gcc::context *ctxt);
502 extern struct rtl_opt_pass pass_rtl_ifcvt; 535 extern rtl_opt_pass *make_pass_rtl_dce (gcc::context *ctxt);
503 536 extern rtl_opt_pass *make_pass_rtl_dse1 (gcc::context *ctxt);
504 extern struct rtl_opt_pass pass_into_cfg_layout_mode; 537 extern rtl_opt_pass *make_pass_rtl_dse2 (gcc::context *ctxt);
505 extern struct rtl_opt_pass pass_outof_cfg_layout_mode; 538 extern rtl_opt_pass *make_pass_rtl_dse3 (gcc::context *ctxt);
506 539 extern rtl_opt_pass *make_pass_rtl_cprop (gcc::context *ctxt);
507 extern struct rtl_opt_pass pass_loop2; 540 extern rtl_opt_pass *make_pass_rtl_pre (gcc::context *ctxt);
508 extern struct rtl_opt_pass pass_rtl_loop_init; 541 extern rtl_opt_pass *make_pass_rtl_hoist (gcc::context *ctxt);
509 extern struct rtl_opt_pass pass_rtl_move_loop_invariants; 542 extern rtl_opt_pass *make_pass_rtl_store_motion (gcc::context *ctxt);
510 extern struct rtl_opt_pass pass_rtl_unswitch; 543 extern rtl_opt_pass *make_pass_cse_after_global_opts (gcc::context *ctxt);
511 extern struct rtl_opt_pass pass_rtl_unroll_and_peel_loops; 544 extern rtl_opt_pass *make_pass_rtl_ifcvt (gcc::context *ctxt);
512 extern struct rtl_opt_pass pass_rtl_doloop; 545
513 extern struct rtl_opt_pass pass_rtl_loop_done; 546 extern rtl_opt_pass *make_pass_into_cfg_layout_mode (gcc::context *ctxt);
514 547 extern rtl_opt_pass *make_pass_outof_cfg_layout_mode (gcc::context *ctxt);
515 extern struct rtl_opt_pass pass_web; 548
516 extern struct rtl_opt_pass pass_cse2; 549 extern rtl_opt_pass *make_pass_loop2 (gcc::context *ctxt);
517 extern struct rtl_opt_pass pass_df_initialize_opt; 550 extern rtl_opt_pass *make_pass_rtl_loop_init (gcc::context *ctxt);
518 extern struct rtl_opt_pass pass_df_initialize_no_opt; 551 extern rtl_opt_pass *make_pass_rtl_move_loop_invariants (gcc::context *ctxt);
519 extern struct rtl_opt_pass pass_reginfo_init; 552 extern rtl_opt_pass *make_pass_rtl_unroll_loops (gcc::context *ctxt);
520 extern struct rtl_opt_pass pass_inc_dec; 553 extern rtl_opt_pass *make_pass_rtl_doloop (gcc::context *ctxt);
521 extern struct rtl_opt_pass pass_stack_ptr_mod; 554 extern rtl_opt_pass *make_pass_rtl_loop_done (gcc::context *ctxt);
522 extern struct rtl_opt_pass pass_initialize_regs; 555
523 extern struct rtl_opt_pass pass_combine; 556 extern rtl_opt_pass *make_pass_web (gcc::context *ctxt);
524 extern struct rtl_opt_pass pass_if_after_combine; 557 extern rtl_opt_pass *make_pass_cse2 (gcc::context *ctxt);
525 extern struct rtl_opt_pass pass_implicit_zee; 558 extern rtl_opt_pass *make_pass_df_initialize_opt (gcc::context *ctxt);
526 extern struct rtl_opt_pass pass_partition_blocks; 559 extern rtl_opt_pass *make_pass_df_initialize_no_opt (gcc::context *ctxt);
527 extern struct rtl_opt_pass pass_match_asm_constraints; 560 extern rtl_opt_pass *make_pass_reginfo_init (gcc::context *ctxt);
528 extern struct rtl_opt_pass pass_regmove; 561 extern rtl_opt_pass *make_pass_inc_dec (gcc::context *ctxt);
529 extern struct rtl_opt_pass pass_split_all_insns; 562 extern rtl_opt_pass *make_pass_stack_ptr_mod (gcc::context *ctxt);
530 extern struct rtl_opt_pass pass_fast_rtl_byte_dce; 563 extern rtl_opt_pass *make_pass_initialize_regs (gcc::context *ctxt);
531 extern struct rtl_opt_pass pass_lower_subreg2; 564 extern rtl_opt_pass *make_pass_combine (gcc::context *ctxt);
532 extern struct rtl_opt_pass pass_mode_switching; 565 extern rtl_opt_pass *make_pass_if_after_combine (gcc::context *ctxt);
533 extern struct rtl_opt_pass pass_sms; 566 extern rtl_opt_pass *make_pass_ree (gcc::context *ctxt);
534 extern struct rtl_opt_pass pass_sched; 567 extern rtl_opt_pass *make_pass_partition_blocks (gcc::context *ctxt);
535 extern struct rtl_opt_pass pass_ira; 568 extern rtl_opt_pass *make_pass_match_asm_constraints (gcc::context *ctxt);
536 extern struct rtl_opt_pass pass_postreload; 569 extern rtl_opt_pass *make_pass_split_all_insns (gcc::context *ctxt);
537 extern struct rtl_opt_pass pass_clean_state; 570 extern rtl_opt_pass *make_pass_fast_rtl_byte_dce (gcc::context *ctxt);
538 extern struct rtl_opt_pass pass_branch_prob; 571 extern rtl_opt_pass *make_pass_lower_subreg2 (gcc::context *ctxt);
539 extern struct rtl_opt_pass pass_value_profile_transformations; 572 extern rtl_opt_pass *make_pass_mode_switching (gcc::context *ctxt);
540 extern struct rtl_opt_pass pass_postreload_cse; 573 extern rtl_opt_pass *make_pass_sms (gcc::context *ctxt);
541 extern struct rtl_opt_pass pass_gcse2; 574 extern rtl_opt_pass *make_pass_sched (gcc::context *ctxt);
542 extern struct rtl_opt_pass pass_split_after_reload; 575 extern rtl_opt_pass *make_pass_live_range_shrinkage (gcc::context *ctxt);
543 extern struct rtl_opt_pass pass_branch_target_load_optimize1; 576 extern rtl_opt_pass *make_pass_ira (gcc::context *ctxt);
544 extern struct rtl_opt_pass pass_thread_prologue_and_epilogue; 577 extern rtl_opt_pass *make_pass_reload (gcc::context *ctxt);
545 extern struct rtl_opt_pass pass_stack_adjustments; 578 extern rtl_opt_pass *make_pass_clean_state (gcc::context *ctxt);
546 extern struct rtl_opt_pass pass_peephole2; 579 extern rtl_opt_pass *make_pass_branch_prob (gcc::context *ctxt);
547 extern struct rtl_opt_pass pass_if_after_reload; 580 extern rtl_opt_pass *make_pass_value_profile_transformations (gcc::context
548 extern struct rtl_opt_pass pass_regrename; 581 *ctxt);
549 extern struct rtl_opt_pass pass_cprop_hardreg; 582 extern rtl_opt_pass *make_pass_postreload_cse (gcc::context *ctxt);
550 extern struct rtl_opt_pass pass_reorder_blocks; 583 extern rtl_opt_pass *make_pass_gcse2 (gcc::context *ctxt);
551 extern struct rtl_opt_pass pass_branch_target_load_optimize2; 584 extern rtl_opt_pass *make_pass_split_after_reload (gcc::context *ctxt);
552 extern struct rtl_opt_pass pass_leaf_regs; 585 extern rtl_opt_pass *make_pass_branch_target_load_optimize1 (gcc::context
553 extern struct rtl_opt_pass pass_split_before_sched2; 586 *ctxt);
554 extern struct rtl_opt_pass pass_compare_elim_after_reload; 587 extern rtl_opt_pass *make_pass_thread_prologue_and_epilogue (gcc::context
555 extern struct rtl_opt_pass pass_sched2; 588 *ctxt);
556 extern struct rtl_opt_pass pass_stack_regs; 589 extern rtl_opt_pass *make_pass_stack_adjustments (gcc::context *ctxt);
557 extern struct rtl_opt_pass pass_stack_regs_run; 590 extern rtl_opt_pass *make_pass_sched_fusion (gcc::context *ctxt);
558 extern struct rtl_opt_pass pass_df_finish; 591 extern rtl_opt_pass *make_pass_peephole2 (gcc::context *ctxt);
559 extern struct rtl_opt_pass pass_compute_alignments; 592 extern rtl_opt_pass *make_pass_if_after_reload (gcc::context *ctxt);
560 extern struct rtl_opt_pass pass_duplicate_computed_gotos; 593 extern rtl_opt_pass *make_pass_regrename (gcc::context *ctxt);
561 extern struct rtl_opt_pass pass_variable_tracking; 594 extern rtl_opt_pass *make_pass_cprop_hardreg (gcc::context *ctxt);
562 extern struct rtl_opt_pass pass_free_cfg; 595 extern rtl_opt_pass *make_pass_reorder_blocks (gcc::context *ctxt);
563 extern struct rtl_opt_pass pass_machine_reorg; 596 extern rtl_opt_pass *make_pass_branch_target_load_optimize2 (gcc::context
564 extern struct rtl_opt_pass pass_cleanup_barriers; 597 *ctxt);
565 extern struct rtl_opt_pass pass_delay_slots; 598 extern rtl_opt_pass *make_pass_leaf_regs (gcc::context *ctxt);
566 extern struct rtl_opt_pass pass_split_for_shorten_branches; 599 extern rtl_opt_pass *make_pass_split_before_sched2 (gcc::context *ctxt);
567 extern struct rtl_opt_pass pass_split_before_regstack; 600 extern rtl_opt_pass *make_pass_compare_elim_after_reload (gcc::context *ctxt);
568 extern struct rtl_opt_pass pass_convert_to_eh_region_ranges; 601 extern rtl_opt_pass *make_pass_sched2 (gcc::context *ctxt);
569 extern struct rtl_opt_pass pass_shorten_branches; 602 extern rtl_opt_pass *make_pass_stack_regs (gcc::context *ctxt);
570 extern struct rtl_opt_pass pass_set_nothrow_function_flags; 603 extern rtl_opt_pass *make_pass_stack_regs_run (gcc::context *ctxt);
571 extern struct rtl_opt_pass pass_final; 604 extern rtl_opt_pass *make_pass_df_finish (gcc::context *ctxt);
572 extern struct rtl_opt_pass pass_rtl_seqabstr; 605 extern rtl_opt_pass *make_pass_compute_alignments (gcc::context *ctxt);
573 extern struct gimple_opt_pass pass_release_ssa_names; 606 extern rtl_opt_pass *make_pass_duplicate_computed_gotos (gcc::context *ctxt);
574 extern struct gimple_opt_pass pass_early_inline; 607 extern rtl_opt_pass *make_pass_variable_tracking (gcc::context *ctxt);
575 extern struct gimple_opt_pass pass_inline_parameters; 608 extern rtl_opt_pass *make_pass_free_cfg (gcc::context *ctxt);
576 extern struct gimple_opt_pass pass_all_early_optimizations; 609 extern rtl_opt_pass *make_pass_machine_reorg (gcc::context *ctxt);
577 extern struct gimple_opt_pass pass_update_address_taken; 610 extern rtl_opt_pass *make_pass_cleanup_barriers (gcc::context *ctxt);
578 extern struct gimple_opt_pass pass_convert_switch; 611 extern rtl_opt_pass *make_pass_delay_slots (gcc::context *ctxt);
579 612 extern rtl_opt_pass *make_pass_split_for_shorten_branches (gcc::context *ctxt);
580 /* The root of the compilation pass tree, once constructed. */ 613 extern rtl_opt_pass *make_pass_split_before_regstack (gcc::context *ctxt);
581 extern struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes, 614 extern rtl_opt_pass *make_pass_convert_to_eh_region_ranges (gcc::context *ctxt);
582 *all_regular_ipa_passes, *all_lto_gen_passes; 615 extern rtl_opt_pass *make_pass_shorten_branches (gcc::context *ctxt);
583 616 extern rtl_opt_pass *make_pass_set_nothrow_function_flags (gcc::context *ctxt);
584 /* Define a list of pass lists so that both passes.c and plugins can easily 617 extern rtl_opt_pass *make_pass_dwarf2_frame (gcc::context *ctxt);
585 find all the pass lists. */ 618 extern rtl_opt_pass *make_pass_final (gcc::context *ctxt);
586 #define GCC_PASS_LISTS \ 619 extern rtl_opt_pass *make_pass_rtl_seqabstr (gcc::context *ctxt);
587 DEF_PASS_LIST (all_lowering_passes) \ 620 extern gimple_opt_pass *make_pass_release_ssa_names (gcc::context *ctxt);
588 DEF_PASS_LIST (all_small_ipa_passes) \ 621 extern gimple_opt_pass *make_pass_early_inline (gcc::context *ctxt);
589 DEF_PASS_LIST (all_regular_ipa_passes) \ 622 extern gimple_opt_pass *make_pass_local_fn_summary (gcc::context *ctxt);
590 DEF_PASS_LIST (all_lto_gen_passes) \ 623 extern gimple_opt_pass *make_pass_update_address_taken (gcc::context *ctxt);
591 DEF_PASS_LIST (all_passes) 624 extern gimple_opt_pass *make_pass_convert_switch (gcc::context *ctxt);
592 625 extern gimple_opt_pass *make_pass_lower_vaarg (gcc::context *ctxt);
593 #define DEF_PASS_LIST(LIST) PASS_LIST_NO_##LIST,
594 enum
595 {
596 GCC_PASS_LISTS
597 PASS_LIST_NUM
598 };
599 #undef DEF_PASS_LIST
600
601 /* This is used by plugins, and should also be used in
602 passes.c:register_pass. */
603 extern struct opt_pass **gcc_pass_lists[];
604 626
605 /* Current optimization pass. */ 627 /* Current optimization pass. */
606 extern struct opt_pass *current_pass; 628 extern opt_pass *current_pass;
607 629
608 extern struct opt_pass * get_pass_for_id (int); 630 extern bool execute_one_pass (opt_pass *);
609 extern bool execute_one_pass (struct opt_pass *); 631 extern void execute_pass_list (function *, opt_pass *);
610 extern void execute_pass_list (struct opt_pass *); 632 extern void execute_ipa_pass_list (opt_pass *);
611 extern void execute_ipa_pass_list (struct opt_pass *); 633 extern void execute_ipa_summary_passes (ipa_opt_pass_d *);
612 extern void execute_ipa_summary_passes (struct ipa_opt_pass_d *);
613 extern void execute_all_ipa_transforms (void); 634 extern void execute_all_ipa_transforms (void);
614 extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple *); 635 extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple **);
615 extern bool pass_init_dump_file (struct opt_pass *); 636 extern bool pass_init_dump_file (opt_pass *);
616 extern void pass_fini_dump_file (struct opt_pass *); 637 extern void pass_fini_dump_file (opt_pass *);
617 638 extern void emergency_dump_function (void);
618 extern const char *get_current_pass_name (void); 639
619 extern void print_current_pass (FILE *); 640 extern void print_current_pass (FILE *);
620 extern void debug_pass (void); 641 extern void debug_pass (void);
621 extern void ipa_write_summaries (void); 642 extern void ipa_write_summaries (void);
622 extern void ipa_write_optimization_summaries (struct cgraph_node_set_def *, 643 extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *);
623 struct varpool_node_set_def *);
624 extern void ipa_read_summaries (void); 644 extern void ipa_read_summaries (void);
625 extern void ipa_read_optimization_summaries (void); 645 extern void ipa_read_optimization_summaries (void);
626 extern void register_one_dump_file (struct opt_pass *); 646 extern void register_one_dump_file (opt_pass *);
627 extern bool function_called_by_processed_nodes_p (void); 647 extern bool function_called_by_processed_nodes_p (void);
628 extern void register_pass (struct register_pass_info *);
629
630 /* Set to true if the pass is called the first time during compilation of the
631 current function. Note that using this information in the optimization
632 passes is considered not to be clean, and it should be avoided if possible.
633 This flag is currently used to prevent loops from being peeled repeatedly
634 in jump threading; it will be removed once we preserve loop structures
635 throughout the compilation -- we will be able to mark the affected loops
636 directly in jump threading, and avoid peeling them next time. */
637 extern bool first_pass_instance;
638 648
639 /* Declare for plugins. */ 649 /* Declare for plugins. */
640 extern void do_per_function_toporder (void (*) (void *), void *); 650 extern void do_per_function_toporder (void (*) (function *, void *), void *);
651
652 extern void disable_pass (const char *);
653 extern void enable_pass (const char *);
654 extern void dump_passes (void);
641 655
642 #endif /* GCC_TREE_PASS_H */ 656 #endif /* GCC_TREE_PASS_H */