]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/tree-pass.h
Update Copyright years for files modified in 2011 and/or 2012.
[thirdparty/gcc.git] / gcc / tree-pass.h
CommitLineData
4ee9c684 1/* Definitions for describing one tree-ssa optimization pass.
71e45bc2 2 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
cfaf579d 3 Free Software Foundation, Inc.
4ee9c684 4 Contributed by Richard Henderson <rth@redhat.com>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
8c4c00c1 10the Free Software Foundation; either version 3, or (at your option)
4ee9c684 11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
8c4c00c1 19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
4ee9c684 21
22
23#ifndef GCC_TREE_PASS_H
24#define GCC_TREE_PASS_H 1
25
0b1615c1 26#include "timevar.h"
b9ed1410 27#include "dumpfile.h"
0f9005dd 28
0b09525f 29/* Optimization pass type. */
30enum opt_pass_type
31{
32 GIMPLE_PASS,
33 RTL_PASS,
34 SIMPLE_IPA_PASS,
35 IPA_PASS
36};
37
20099e35 38/* Describe one pass; this is the common part shared across different pass
39 types. */
40struct opt_pass
4ee9c684 41{
20099e35 42 /* Optimization pass type. */
0b09525f 43 enum opt_pass_type type;
44
9478582c 45 /* Terse name of the pass used as a fragment of the dump file
46 name. If the name starts with a star, no dump happens. */
4ee9c684 47 const char *name;
48
c7875731 49 /* The -fopt-info optimization group flags as defined in dumpfile.h. */
50 unsigned int optinfo_flags;
51
4ee9c684 52 /* If non-null, this pass and all sub-passes are executed only if
53 the function returns true. */
54 bool (*gate) (void);
55
56 /* This is the code to run. If null, then there should be sub-passes
2a1990e9 57 otherwise this pass does nothing. The return value contains
58 TODOs to execute in addition to those in TODO_flags_finish. */
59 unsigned int (*execute) (void);
4ee9c684 60
61 /* A list of sub-passes to run, dependent on gate predicate. */
20099e35 62 struct opt_pass *sub;
4ee9c684 63
64 /* Next in the list of passes to run, independent of gate predicate. */
20099e35 65 struct opt_pass *next;
4ee9c684 66
67 /* Static pass number, used as a fragment of the dump file name. */
865a4105 68 int static_pass_number;
4ee9c684 69
70 /* The timevar id associated with this pass. */
71 /* ??? Ideally would be dynamically assigned. */
0b1615c1 72 timevar_id_t tv_id;
4ee9c684 73
74 /* Sets of properties input and output from this pass. */
75 unsigned int properties_required;
76 unsigned int properties_provided;
77 unsigned int properties_destroyed;
78
79 /* Flags indicating common sets things to do before and after. */
80 unsigned int todo_flags_start;
81 unsigned int todo_flags_finish;
20099e35 82};
83
68e3904e 84/* Description of GIMPLE pass. */
20099e35 85struct gimple_opt_pass
86{
87 struct opt_pass pass;
88};
0f9005dd 89
f0b5f617 90/* Description of RTL pass. */
20099e35 91struct rtl_opt_pass
92{
93 struct opt_pass pass;
94};
95
68e3904e 96struct varpool_node;
97struct cgraph_node;
5cf7e051 98struct lto_symtab_encoder_d;
68e3904e 99
100/* Description of IPA pass with generate summary, write, execute, read and
101 transform stages. */
26dbec0a 102struct ipa_opt_pass_d
68e3904e 103{
104 struct opt_pass pass;
105
9c1bff7a 106 /* IPA passes can analyze function body and variable initializers
107 using this hook and produce summary. */
108 void (*generate_summary) (void);
109
110 /* This hook is used to serialize IPA summaries on disk. */
eab36a5a 111 void (*write_summary) (void);
68e3904e 112
ddc90d88 113 /* This hook is used to deserialize IPA summaries from disk. */
9c1bff7a 114 void (*read_summary) (void);
ddc90d88 115
116 /* This hook is used to serialize IPA optimization summaries on disk. */
eab36a5a 117 void (*write_optimization_summary) (void);
ddc90d88 118
119 /* This hook is used to deserialize IPA summaries from disk. */
120 void (*read_optimization_summary) (void);
121
90464c8b 122 /* Hook to convert gimple stmt uids into true gimple statements. The second
123 parameter is an array of statements indexed by their uid. */
124 void (*stmt_fixup) (struct cgraph_node *, gimple *);
125
68e3904e 126 /* Results of interprocedural propagation of an IPA pass is applied to
127 function body via this hook. */
128 unsigned int function_transform_todo_flags_start;
129 unsigned int (*function_transform) (struct cgraph_node *);
130 void (*variable_transform) (struct varpool_node *);
68e3904e 131};
132
133/* Description of simple IPA pass. Simple IPA passes have just one execute
20099e35 134 hook. */
135struct simple_ipa_opt_pass
136{
137 struct opt_pass pass;
0f9005dd 138};
139
4ee9c684 140/* Pass properties. */
141#define PROP_gimple_any (1 << 0) /* entire gimple grammar */
142#define PROP_gimple_lcf (1 << 1) /* lowered control flow */
143#define PROP_gimple_leh (1 << 2) /* lowered eh */
144#define PROP_cfg (1 << 3)
b1b7c0c4 145#define PROP_ssa (1 << 5)
146#define PROP_no_crit_edges (1 << 6)
147#define PROP_rtl (1 << 7)
2f8eb909 148#define PROP_gimple_lomp (1 << 8) /* lowered OpenMP directives */
149#define PROP_cfglayout (1 << 9) /* cfglayout mode on RTL */
7b76dcb9 150#define PROP_gimple_lcx (1 << 10) /* lowered complex */
79f958cb 151#define PROP_loops (1 << 11) /* preserve loop structures */
5290ebdb 152
153#define PROP_trees \
6354626c 154 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
4ee9c684 155
156/* To-do flags. */
88dbf20f 157#define TODO_ggc_collect (1 << 1)
48e1416a 158#define TODO_verify_ssa (1 << 2)
88dbf20f 159#define TODO_verify_flow (1 << 3)
160#define TODO_verify_stmts (1 << 4)
161#define TODO_cleanup_cfg (1 << 5)
18841b0c 162#define TODO_dump_symtab (1 << 7)
f37a5008 163#define TODO_remove_functions (1 << 8)
4ae20857 164#define TODO_rebuild_frequencies (1 << 9)
0806b508 165#define TODO_verify_rtl_sharing (1 << 10)
88dbf20f 166
167/* To-do flags for calls to update_ssa. */
168
169/* Update the SSA form inserting PHI nodes for newly exposed symbols
170 and virtual names marked for updating. When updating real names,
171 only insert PHI nodes for a real name O_j in blocks reached by all
172 the new and old definitions for O_j. If the iterated dominance
173 frontier for O_j is not pruned, we may end up inserting PHI nodes
174 in blocks that have one or more edges with no incoming definition
175 for O_j. This would lead to uninitialized warnings for O_j's
176 symbol. */
0806b508 177#define TODO_update_ssa (1 << 11)
88dbf20f 178
179/* Update the SSA form without inserting any new PHI nodes at all.
180 This is used by passes that have either inserted all the PHI nodes
181 themselves or passes that need only to patch use-def and def-def
182 chains for virtuals (e.g., DCE). */
0806b508 183#define TODO_update_ssa_no_phi (1 << 12)
88dbf20f 184
442e3cb9 185/* Insert PHI nodes everywhere they are needed. No pruning of the
88dbf20f 186 IDF is done. This is used by passes that need the PHI nodes for
187 O_j even if it means that some arguments will come from the default
e01f9f1f 188 definition of O_j's symbol.
48e1416a 189
88dbf20f 190 WARNING: If you need to use this flag, chances are that your pass
191 may be doing something wrong. Inserting PHI nodes for an old name
192 where not all edges carry a new replacement may lead to silent
193 codegen errors or spurious uninitialized warnings. */
0806b508 194#define TODO_update_ssa_full_phi (1 << 13)
88dbf20f 195
196/* Passes that update the SSA form on their own may want to delegate
197 the updating of virtual names to the generic updater. Since FUD
198 chains are easier to maintain, this simplifies the work they need
199 to do. NOTE: If this flag is used, any OLD->NEW mappings for real
200 names are explicitly destroyed and only the symbols marked for
201 renaming are processed. */
0806b508 202#define TODO_update_ssa_only_virtuals (1 << 14)
88dbf20f 203
db22d3cc 204/* Some passes leave unused local variables that can be removed from
edb7afe8 205 cfun->local_decls. This reduces the size of dump files
206 and the memory footprint for VAR_DECLs. */
0806b508 207#define TODO_remove_unused_locals (1 << 15)
db22d3cc 208
3072d30e 209/* Call df_finish at the end of the pass. This is done after all of
210 the dumpers have been allowed to run so that they have access to
211 the instance before it is destroyed. */
0806b508 212#define TODO_df_finish (1 << 17)
3072d30e 213
314966f4 214/* Call df_verify at the end of the pass if checking is enabled. */
0806b508 215#define TODO_df_verify (1 << 18)
314966f4 216
7e0311ae 217/* Internally used for the first instance of a pass. */
0806b508 218#define TODO_mark_first_instance (1 << 19)
7e0311ae 219
b1b7c0c4 220/* Rebuild aliasing info. */
dd277d48 221#define TODO_rebuild_alias (1 << 20)
222
223/* Rebuild the addressable-vars bitmap and do register promotion. */
224#define TODO_update_address_taken (1 << 21)
b1b7c0c4 225
a15d5ede 226/* Rebuild the callgraph edges. */
227#define TODO_rebuild_cgraph_edges (1 << 22)
228
315a45ed 229/* Internally used in execute_function_todo(). */
88dbf20f 230#define TODO_update_ssa_any \
231 (TODO_update_ssa \
232 | TODO_update_ssa_no_phi \
233 | TODO_update_ssa_full_phi \
234 | TODO_update_ssa_only_virtuals)
4ee9c684 235
236#define TODO_verify_all \
237 (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
238
3efe62a1 239
240/* Register pass info. */
241
242enum pass_positioning_ops
243{
244 PASS_POS_INSERT_AFTER, /* Insert after the reference pass. */
245 PASS_POS_INSERT_BEFORE, /* Insert before the reference pass. */
246 PASS_POS_REPLACE /* Replace the reference pass. */
247};
248
249struct register_pass_info
250{
251 struct opt_pass *pass; /* New pass to register. */
252 const char *reference_pass_name; /* Name of the reference pass for hooking
253 up the new pass. */
254 int ref_pass_instance_number; /* Insert the pass at the specified
255 instance number of the reference pass.
256 Do it for every instance if it is 0. */
257 enum pass_positioning_ops pos_op; /* how to insert the new pass. */
258};
259
20099e35 260extern struct gimple_opt_pass pass_mudflap_1;
261extern struct gimple_opt_pass pass_mudflap_2;
b92cccf4 262extern struct gimple_opt_pass pass_asan;
8293ee35 263extern struct gimple_opt_pass pass_asan_O0;
b077695d 264extern struct gimple_opt_pass pass_tsan;
265extern struct gimple_opt_pass pass_tsan_O0;
20099e35 266extern struct gimple_opt_pass pass_lower_cf;
267extern struct gimple_opt_pass pass_refactor_eh;
268extern struct gimple_opt_pass pass_lower_eh;
e38def9c 269extern struct gimple_opt_pass pass_lower_eh_dispatch;
270extern struct gimple_opt_pass pass_lower_resx;
20099e35 271extern struct gimple_opt_pass pass_build_cfg;
20099e35 272extern struct gimple_opt_pass pass_early_tree_profile;
4c5fcca6 273extern struct gimple_opt_pass pass_cleanup_eh;
20099e35 274extern struct gimple_opt_pass pass_sra;
275extern struct gimple_opt_pass pass_sra_early;
2f29eac3 276extern struct gimple_opt_pass pass_early_ipa_sra;
20099e35 277extern struct gimple_opt_pass pass_tail_recursion;
278extern struct gimple_opt_pass pass_tail_calls;
279extern struct gimple_opt_pass pass_tree_loop;
280extern struct gimple_opt_pass pass_tree_loop_init;
281extern struct gimple_opt_pass pass_lim;
282extern struct gimple_opt_pass pass_tree_unswitch;
283extern struct gimple_opt_pass pass_predcom;
284extern struct gimple_opt_pass pass_iv_canon;
285extern struct gimple_opt_pass pass_scev_cprop;
286extern struct gimple_opt_pass pass_empty_loop;
287extern struct gimple_opt_pass pass_record_bounds;
b90bb125 288extern struct gimple_opt_pass pass_graphite;
255b6be7 289extern struct gimple_opt_pass pass_graphite_transforms;
20099e35 290extern struct gimple_opt_pass pass_if_conversion;
291extern struct gimple_opt_pass pass_loop_distribution;
292extern struct gimple_opt_pass pass_vectorize;
37545e54 293extern struct gimple_opt_pass pass_slp_vectorize;
20099e35 294extern struct gimple_opt_pass pass_complete_unroll;
d88fd237 295extern struct gimple_opt_pass pass_complete_unrolli;
20099e35 296extern struct gimple_opt_pass pass_parallelize_loops;
297extern struct gimple_opt_pass pass_loop_prefetch;
298extern struct gimple_opt_pass pass_iv_optimize;
299extern struct gimple_opt_pass pass_tree_loop_done;
300extern struct gimple_opt_pass pass_ch;
301extern struct gimple_opt_pass pass_ccp;
302extern struct gimple_opt_pass pass_phi_only_cprop;
303extern struct gimple_opt_pass pass_build_ssa;
20099e35 304extern struct gimple_opt_pass pass_build_alias;
7f81b5ee 305extern struct gimple_opt_pass pass_build_ealias;
20099e35 306extern struct gimple_opt_pass pass_dominator;
307extern struct gimple_opt_pass pass_dce;
308extern struct gimple_opt_pass pass_dce_loop;
309extern struct gimple_opt_pass pass_cd_dce;
e6a23add 310extern struct gimple_opt_pass pass_call_cdce;
20099e35 311extern struct gimple_opt_pass pass_merge_phi;
312extern struct gimple_opt_pass pass_split_crit_edges;
313extern struct gimple_opt_pass pass_pre;
51385f30 314extern unsigned int tail_merge_optimize (unsigned int);
20099e35 315extern struct gimple_opt_pass pass_profile;
1add270f 316extern struct gimple_opt_pass pass_strip_predict_hints;
20099e35 317extern struct gimple_opt_pass pass_lower_complex_O0;
318extern struct gimple_opt_pass pass_lower_complex;
319extern struct gimple_opt_pass pass_lower_vector;
320extern struct gimple_opt_pass pass_lower_vector_ssa;
321extern struct gimple_opt_pass pass_lower_omp;
bfec3452 322extern struct gimple_opt_pass pass_diagnose_omp_blocks;
20099e35 323extern struct gimple_opt_pass pass_expand_omp;
324extern struct gimple_opt_pass pass_expand_omp_ssa;
325extern struct gimple_opt_pass pass_object_sizes;
9efe50a4 326extern struct gimple_opt_pass pass_strlen;
20099e35 327extern struct gimple_opt_pass pass_fold_builtins;
328extern struct gimple_opt_pass pass_stdarg;
329extern struct gimple_opt_pass pass_early_warn_uninitialized;
330extern struct gimple_opt_pass pass_late_warn_uninitialized;
331extern struct gimple_opt_pass pass_cse_reciprocals;
332extern struct gimple_opt_pass pass_cse_sincos;
84cc784c 333extern struct gimple_opt_pass pass_optimize_bswap;
62be004c 334extern struct gimple_opt_pass pass_optimize_widening_mul;
20099e35 335extern struct gimple_opt_pass pass_warn_function_return;
336extern struct gimple_opt_pass pass_warn_function_noreturn;
337extern struct gimple_opt_pass pass_cselim;
338extern struct gimple_opt_pass pass_phiopt;
339extern struct gimple_opt_pass pass_forwprop;
340extern struct gimple_opt_pass pass_phiprop;
341extern struct gimple_opt_pass pass_tree_ifcombine;
342extern struct gimple_opt_pass pass_dse;
20099e35 343extern struct gimple_opt_pass pass_nrv;
20099e35 344extern struct gimple_opt_pass pass_rename_ssa_copies;
20099e35 345extern struct gimple_opt_pass pass_sink_code;
346extern struct gimple_opt_pass pass_fre;
20099e35 347extern struct gimple_opt_pass pass_check_data_deps;
348extern struct gimple_opt_pass pass_copy_prop;
20099e35 349extern struct gimple_opt_pass pass_vrp;
20099e35 350extern struct gimple_opt_pass pass_uncprop;
351extern struct gimple_opt_pass pass_return_slot;
352extern struct gimple_opt_pass pass_reassoc;
353extern struct gimple_opt_pass pass_rebuild_cgraph_edges;
ba3a7ba0 354extern struct gimple_opt_pass pass_remove_cgraph_callee_edges;
20099e35 355extern struct gimple_opt_pass pass_build_cgraph_edges;
b5cebd44 356extern struct gimple_opt_pass pass_local_pure_const;
d743aba2 357extern struct gimple_opt_pass pass_tracer;
bfec3452 358extern struct gimple_opt_pass pass_warn_unused_result;
4c0315d0 359extern struct gimple_opt_pass pass_diagnose_tm_blocks;
360extern struct gimple_opt_pass pass_lower_tm;
361extern struct gimple_opt_pass pass_tm_init;
362extern struct gimple_opt_pass pass_tm_mark;
363extern struct gimple_opt_pass pass_tm_memopt;
364extern struct gimple_opt_pass pass_tm_edges;
2862cf88 365extern struct gimple_opt_pass pass_split_functions;
a15d5ede 366extern struct gimple_opt_pass pass_feedback_split_functions;
4502f5d0 367extern struct gimple_opt_pass pass_strength_reduction;
4ee9c684 368
3dec5460 369/* IPA Passes */
cffbbb9d 370extern struct simple_ipa_opt_pass pass_ipa_lower_emutls;
7bfefa9d 371extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility;
85344eeb 372extern struct simple_ipa_opt_pass pass_ipa_tree_profile;
7bfefa9d 373
374extern struct simple_ipa_opt_pass pass_early_local_passes;
375
59dd4830 376extern struct ipa_opt_pass_d pass_ipa_whole_program_visibility;
7bfefa9d 377extern struct ipa_opt_pass_d pass_ipa_lto_gimple_out;
378extern struct simple_ipa_opt_pass pass_ipa_increase_alignment;
26dbec0a 379extern struct ipa_opt_pass_d pass_ipa_inline;
34e5cced 380extern struct simple_ipa_opt_pass pass_ipa_free_lang_data;
f8bfd7f7 381extern struct simple_ipa_opt_pass pass_ipa_free_inline_summary;
26dbec0a 382extern struct ipa_opt_pass_d pass_ipa_cp;
383extern struct ipa_opt_pass_d pass_ipa_reference;
384extern struct ipa_opt_pass_d pass_ipa_pure_const;
20099e35 385extern struct simple_ipa_opt_pass pass_ipa_pta;
7bfefa9d 386extern struct ipa_opt_pass_d pass_ipa_lto_wpa_fixup;
387extern struct ipa_opt_pass_d pass_ipa_lto_finish_out;
4c0315d0 388extern struct simple_ipa_opt_pass pass_ipa_tm;
4e2db0ad 389extern struct ipa_opt_pass_d pass_ipa_profile;
a53e7471 390extern struct ipa_opt_pass_d pass_ipa_cdtor_merge;
20099e35 391
20099e35 392extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing;
20099e35 393extern struct gimple_opt_pass pass_init_datastructures;
394extern struct gimple_opt_pass pass_fixup_cfg;
395
18d50ae6 396extern struct rtl_opt_pass pass_expand;
20099e35 397extern struct rtl_opt_pass pass_instantiate_virtual_regs;
398extern struct rtl_opt_pass pass_rtl_fwprop;
399extern struct rtl_opt_pass pass_rtl_fwprop_addr;
76cdbc6d 400extern struct rtl_opt_pass pass_jump;
20099e35 401extern struct rtl_opt_pass pass_jump2;
402extern struct rtl_opt_pass pass_lower_subreg;
403extern struct rtl_opt_pass pass_cse;
404extern struct rtl_opt_pass pass_fast_rtl_dce;
405extern struct rtl_opt_pass pass_ud_rtl_dce;
406extern struct rtl_opt_pass pass_rtl_dce;
407extern struct rtl_opt_pass pass_rtl_dse1;
408extern struct rtl_opt_pass pass_rtl_dse2;
409extern struct rtl_opt_pass pass_rtl_dse3;
d743aba2 410extern struct rtl_opt_pass pass_rtl_cprop;
411extern struct rtl_opt_pass pass_rtl_pre;
412extern struct rtl_opt_pass pass_rtl_hoist;
413extern struct rtl_opt_pass pass_rtl_store_motion;
414extern struct rtl_opt_pass pass_cse_after_global_opts;
20099e35 415extern struct rtl_opt_pass pass_rtl_ifcvt;
20099e35 416
417extern struct rtl_opt_pass pass_into_cfg_layout_mode;
418extern struct rtl_opt_pass pass_outof_cfg_layout_mode;
419
420extern struct rtl_opt_pass pass_loop2;
421extern struct rtl_opt_pass pass_rtl_loop_init;
422extern struct rtl_opt_pass pass_rtl_move_loop_invariants;
423extern struct rtl_opt_pass pass_rtl_unswitch;
424extern struct rtl_opt_pass pass_rtl_unroll_and_peel_loops;
425extern struct rtl_opt_pass pass_rtl_doloop;
426extern struct rtl_opt_pass pass_rtl_loop_done;
427
428extern struct rtl_opt_pass pass_web;
429extern struct rtl_opt_pass pass_cse2;
430extern struct rtl_opt_pass pass_df_initialize_opt;
431extern struct rtl_opt_pass pass_df_initialize_no_opt;
cf709bf6 432extern struct rtl_opt_pass pass_reginfo_init;
20099e35 433extern struct rtl_opt_pass pass_inc_dec;
434extern struct rtl_opt_pass pass_stack_ptr_mod;
435extern struct rtl_opt_pass pass_initialize_regs;
436extern struct rtl_opt_pass pass_combine;
437extern struct rtl_opt_pass pass_if_after_combine;
1d4227c3 438extern struct rtl_opt_pass pass_ree;
20099e35 439extern struct rtl_opt_pass pass_partition_blocks;
440extern struct rtl_opt_pass pass_match_asm_constraints;
441extern struct rtl_opt_pass pass_regmove;
442extern struct rtl_opt_pass pass_split_all_insns;
bf1f8fbc 443extern struct rtl_opt_pass pass_fast_rtl_byte_dce;
20099e35 444extern struct rtl_opt_pass pass_lower_subreg2;
445extern struct rtl_opt_pass pass_mode_switching;
20099e35 446extern struct rtl_opt_pass pass_sms;
447extern struct rtl_opt_pass pass_sched;
47dd2e78 448extern struct rtl_opt_pass pass_ira;
abc905e8 449extern struct rtl_opt_pass pass_reload;
20099e35 450extern struct rtl_opt_pass pass_clean_state;
451extern struct rtl_opt_pass pass_branch_prob;
452extern struct rtl_opt_pass pass_value_profile_transformations;
453extern struct rtl_opt_pass pass_postreload_cse;
454extern struct rtl_opt_pass pass_gcse2;
455extern struct rtl_opt_pass pass_split_after_reload;
456extern struct rtl_opt_pass pass_branch_target_load_optimize1;
457extern struct rtl_opt_pass pass_thread_prologue_and_epilogue;
458extern struct rtl_opt_pass pass_stack_adjustments;
459extern struct rtl_opt_pass pass_peephole2;
460extern struct rtl_opt_pass pass_if_after_reload;
461extern struct rtl_opt_pass pass_regrename;
462extern struct rtl_opt_pass pass_cprop_hardreg;
463extern struct rtl_opt_pass pass_reorder_blocks;
464extern struct rtl_opt_pass pass_branch_target_load_optimize2;
465extern struct rtl_opt_pass pass_leaf_regs;
466extern struct rtl_opt_pass pass_split_before_sched2;
a50372fe 467extern struct rtl_opt_pass pass_compare_elim_after_reload;
20099e35 468extern struct rtl_opt_pass pass_sched2;
469extern struct rtl_opt_pass pass_stack_regs;
470extern struct rtl_opt_pass pass_stack_regs_run;
471extern struct rtl_opt_pass pass_df_finish;
472extern struct rtl_opt_pass pass_compute_alignments;
473extern struct rtl_opt_pass pass_duplicate_computed_gotos;
474extern struct rtl_opt_pass pass_variable_tracking;
475extern struct rtl_opt_pass pass_free_cfg;
476extern struct rtl_opt_pass pass_machine_reorg;
477extern struct rtl_opt_pass pass_cleanup_barriers;
478extern struct rtl_opt_pass pass_delay_slots;
479extern struct rtl_opt_pass pass_split_for_shorten_branches;
480extern struct rtl_opt_pass pass_split_before_regstack;
481extern struct rtl_opt_pass pass_convert_to_eh_region_ranges;
482extern struct rtl_opt_pass pass_shorten_branches;
483extern struct rtl_opt_pass pass_set_nothrow_function_flags;
fe2dc6d6 484extern struct rtl_opt_pass pass_dwarf2_frame;
20099e35 485extern struct rtl_opt_pass pass_final;
486extern struct rtl_opt_pass pass_rtl_seqabstr;
487extern struct gimple_opt_pass pass_release_ssa_names;
488extern struct gimple_opt_pass pass_early_inline;
489extern struct gimple_opt_pass pass_inline_parameters;
20099e35 490extern struct gimple_opt_pass pass_update_address_taken;
a347af29 491extern struct gimple_opt_pass pass_convert_switch;
77fce4cd 492
493/* The root of the compilation pass tree, once constructed. */
7bfefa9d 494extern struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes,
657e3a56 495 *all_regular_ipa_passes, *all_lto_gen_passes, *all_late_ipa_passes;
77fce4cd 496
c34d1545 497/* Define a list of pass lists so that both passes.c and plugins can easily
498 find all the pass lists. */
499#define GCC_PASS_LISTS \
500 DEF_PASS_LIST (all_lowering_passes) \
501 DEF_PASS_LIST (all_small_ipa_passes) \
502 DEF_PASS_LIST (all_regular_ipa_passes) \
503 DEF_PASS_LIST (all_lto_gen_passes) \
504 DEF_PASS_LIST (all_passes)
505
506#define DEF_PASS_LIST(LIST) PASS_LIST_NO_##LIST,
507enum
508{
509 GCC_PASS_LISTS
510 PASS_LIST_NUM
511};
512#undef DEF_PASS_LIST
513
514/* This is used by plugins, and should also be used in
515 passes.c:register_pass. */
516extern struct opt_pass **gcc_pass_lists[];
517
9659d177 518/* Current optimization pass. */
519extern struct opt_pass *current_pass;
520
521extern struct opt_pass * get_pass_for_id (int);
c9036234 522extern bool execute_one_pass (struct opt_pass *);
20099e35 523extern void execute_pass_list (struct opt_pass *);
524extern void execute_ipa_pass_list (struct opt_pass *);
7bfefa9d 525extern void execute_ipa_summary_passes (struct ipa_opt_pass_d *);
526extern void execute_all_ipa_transforms (void);
90464c8b 527extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple *);
c9036234 528extern bool pass_init_dump_file (struct opt_pass *);
529extern void pass_fini_dump_file (struct opt_pass *);
7bfefa9d 530
c9036234 531extern const char *get_current_pass_name (void);
3072d30e 532extern void print_current_pass (FILE *);
533extern void debug_pass (void);
7bfefa9d 534extern void ipa_write_summaries (void);
5cf7e051 535extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *);
7bfefa9d 536extern void ipa_read_summaries (void);
ddc90d88 537extern void ipa_read_optimization_summaries (void);
9227b6fc 538extern void register_one_dump_file (struct opt_pass *);
b5cebd44 539extern bool function_called_by_processed_nodes_p (void);
3efe62a1 540extern void register_pass (struct register_pass_info *);
f1e2a033 541
7e0311ae 542/* Set to true if the pass is called the first time during compilation of the
543 current function. Note that using this information in the optimization
544 passes is considered not to be clean, and it should be avoided if possible.
545 This flag is currently used to prevent loops from being peeled repeatedly
546 in jump threading; it will be removed once we preserve loop structures
547 throughout the compilation -- we will be able to mark the affected loops
548 directly in jump threading, and avoid peeling them next time. */
549extern bool first_pass_instance;
550
b9e2d290 551extern struct opt_pass **passes_by_id;
552extern int passes_by_id_size;
553
c9036234 554/* Declare for plugins. */
555extern void do_per_function_toporder (void (*) (void *), void *);
556
c3087ce0 557extern void disable_pass (const char *);
558extern void enable_pass (const char *);
ec4791a8 559extern void dump_passes (void);
c3087ce0 560
4ee9c684 561#endif /* GCC_TREE_PASS_H */