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