1 /* Definitions for describing one tree-ssa optimization pass.
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Contributed by Richard Henderson <rth@redhat.com>
5 This file is part of GCC.
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 2, or (at your option)
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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
23 #ifndef GCC_TREE_PASS_H
24 #define GCC_TREE_PASS_H 1
26 /* Global variables used to communicate with passes. */
27 extern FILE *dump_file
;
28 extern int dump_flags
;
30 extern struct bitmap_head_def
*vars_to_rename
;
32 /* Describe one pass. */
35 /* Terse name of the pass used as a fragment of the dump file name. */
38 /* If non-null, this pass and all sub-passes are executed only if
39 the function returns true. */
42 /* This is the code to run. If null, then there should be sub-passes
43 otherwise this pass does nothing. */
44 void (*execute
) (void);
46 /* A list of sub-passes to run, dependent on gate predicate. */
47 struct tree_opt_pass
*sub
;
49 /* Next in the list of passes to run, independent of gate predicate. */
50 struct tree_opt_pass
*next
;
52 /* Static pass number, used as a fragment of the dump file name. */
53 unsigned int static_pass_number
;
55 /* The timevar id associated with this pass. */
56 /* ??? Ideally would be dynamically assigned. */
59 /* Sets of properties input and output from this pass. */
60 unsigned int properties_required
;
61 unsigned int properties_provided
;
62 unsigned int properties_destroyed
;
64 /* Flags indicating common sets things to do before and after. */
65 unsigned int todo_flags_start
;
66 unsigned int todo_flags_finish
;
69 /* Pass properties. */
70 #define PROP_gimple_any (1 << 0) /* entire gimple grammar */
71 #define PROP_gimple_lcf (1 << 1) /* lowered control flow */
72 #define PROP_gimple_leh (1 << 2) /* lowered eh */
73 #define PROP_cfg (1 << 3)
74 #define PROP_referenced_vars (1 << 4)
75 #define PROP_pta (1 << 5)
76 #define PROP_ssa (1 << 6)
77 #define PROP_no_crit_edges (1 << 7)
78 #define PROP_rtl (1 << 8)
81 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
84 #define TODO_dump_func (1 << 0) /* pass doesn't dump itself */
85 #define TODO_rename_vars (1 << 1) /* rewrite new vars to ssa */
86 #define TODO_ggc_collect (1 << 2) /* run the collector */
87 #define TODO_verify_ssa (1 << 3)
88 #define TODO_verify_flow (1 << 4)
89 #define TODO_verify_stmts (1 << 5)
91 #define TODO_verify_all \
92 (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
95 extern struct tree_opt_pass pass_mudflap_1
;
96 extern struct tree_opt_pass pass_mudflap_2
;
97 extern struct tree_opt_pass pass_remove_useless_stmts
;
98 extern struct tree_opt_pass pass_lower_cf
;
99 extern struct tree_opt_pass pass_lower_eh
;
100 extern struct tree_opt_pass pass_build_cfg
;
101 extern struct tree_opt_pass pass_tree_profile
;
102 extern struct tree_opt_pass pass_referenced_vars
;
103 extern struct tree_opt_pass pass_build_pta
;
104 extern struct tree_opt_pass pass_del_pta
;
105 extern struct tree_opt_pass pass_sra
;
106 extern struct tree_opt_pass pass_tail_recursion
;
107 extern struct tree_opt_pass pass_tail_calls
;
108 extern struct tree_opt_pass pass_loop
;
109 extern struct tree_opt_pass pass_loop_init
;
110 extern struct tree_opt_pass pass_lim
;
111 extern struct tree_opt_pass pass_loop_done
;
112 extern struct tree_opt_pass pass_ch
;
113 extern struct tree_opt_pass pass_ccp
;
114 extern struct tree_opt_pass pass_build_ssa
;
115 extern struct tree_opt_pass pass_del_ssa
;
116 extern struct tree_opt_pass pass_dominator
;
117 extern struct tree_opt_pass pass_dce
;
118 extern struct tree_opt_pass pass_cd_dce
;
119 extern struct tree_opt_pass pass_may_alias
;
120 extern struct tree_opt_pass pass_split_crit_edges
;
121 extern struct tree_opt_pass pass_pre
;
122 extern struct tree_opt_pass pass_profile
;
123 extern struct tree_opt_pass pass_pre_expand
;
124 extern struct tree_opt_pass pass_lower_vector_ssa
;
125 extern struct tree_opt_pass pass_fold_builtins
;
126 extern struct tree_opt_pass pass_early_warn_uninitialized
;
127 extern struct tree_opt_pass pass_late_warn_uninitialized
;
128 extern struct tree_opt_pass pass_warn_function_return
;
129 extern struct tree_opt_pass pass_phiopt
;
130 extern struct tree_opt_pass pass_forwprop
;
131 extern struct tree_opt_pass pass_redundant_phi
;
132 extern struct tree_opt_pass pass_dse
;
133 extern struct tree_opt_pass pass_nrv
;
134 extern struct tree_opt_pass pass_remove_useless_vars
;
135 extern struct tree_opt_pass pass_rename_ssa_copies
;
136 extern struct tree_opt_pass pass_expand
;
137 extern struct tree_opt_pass pass_rest_of_compilation
;
138 extern struct tree_opt_pass pass_fre
;
141 #endif /* GCC_TREE_PASS_H */