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
;
29 extern const char *dump_file_name
;
31 extern struct bitmap_head_def
*vars_to_rename
;
33 /* Return the dump_file_info for the given phase. */
34 extern struct dump_file_info
*get_dump_file_info (enum tree_dump_index
);
36 /* Describe one pass. */
39 /* Terse name of the pass used as a fragment of the dump file name. */
42 /* If non-null, this pass and all sub-passes are executed only if
43 the function returns true. */
46 /* This is the code to run. If null, then there should be sub-passes
47 otherwise this pass does nothing. */
48 void (*execute
) (void);
50 /* A list of sub-passes to run, dependent on gate predicate. */
51 struct tree_opt_pass
*sub
;
53 /* Next in the list of passes to run, independent of gate predicate. */
54 struct tree_opt_pass
*next
;
56 /* Static pass number, used as a fragment of the dump file name. */
57 int static_pass_number
;
59 /* The timevar id associated with this pass. */
60 /* ??? Ideally would be dynamically assigned. */
63 /* Sets of properties input and output from this pass. */
64 unsigned int properties_required
;
65 unsigned int properties_provided
;
66 unsigned int properties_destroyed
;
68 /* Flags indicating common sets things to do before and after. */
69 unsigned int todo_flags_start
;
70 unsigned int todo_flags_finish
;
72 /* Letter for RTL dumps. */
76 /* Define a tree dump switch. */
79 const char *suffix
; /* suffix to give output file. */
80 const char *swtch
; /* command line switch */
81 int flags
; /* user flags */
82 int state
; /* state of play */
83 int num
; /* dump file number */
84 int letter
; /* enabling letter for RTL dumps */
87 /* Pass properties. */
88 #define PROP_gimple_any (1 << 0) /* entire gimple grammar */
89 #define PROP_gimple_lcf (1 << 1) /* lowered control flow */
90 #define PROP_gimple_leh (1 << 2) /* lowered eh */
91 #define PROP_cfg (1 << 3)
92 #define PROP_referenced_vars (1 << 4)
93 #define PROP_pta (1 << 5)
94 #define PROP_ssa (1 << 6)
95 #define PROP_no_crit_edges (1 << 7)
96 #define PROP_rtl (1 << 8)
97 #define PROP_alias (1 << 9)
100 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
103 #define TODO_dump_func (1 << 0) /* pass doesn't dump itself */
104 #define TODO_rename_vars (1 << 1) /* rewrite new vars to ssa */
105 #define TODO_ggc_collect (1 << 2) /* run the collector */
106 #define TODO_verify_ssa (1 << 3)
107 #define TODO_verify_flow (1 << 4)
108 #define TODO_verify_stmts (1 << 5)
109 #define TODO_fix_def_def_chains (1 << 6) /* rewrite def-def chains */
110 #define TODO_cleanup_cfg (1 << 7) /* cleanup the cfg. */
112 #define TODO_verify_all \
113 (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
116 extern struct tree_opt_pass pass_mudflap_1
;
117 extern struct tree_opt_pass pass_mudflap_2
;
118 extern struct tree_opt_pass pass_remove_useless_stmts
;
119 extern struct tree_opt_pass pass_lower_cf
;
120 extern struct tree_opt_pass pass_lower_eh
;
121 extern struct tree_opt_pass pass_build_cfg
;
122 extern struct tree_opt_pass pass_tree_profile
;
123 extern struct tree_opt_pass pass_referenced_vars
;
124 extern struct tree_opt_pass pass_sra
;
125 extern struct tree_opt_pass pass_tail_recursion
;
126 extern struct tree_opt_pass pass_tail_calls
;
127 extern struct tree_opt_pass pass_loop
;
128 extern struct tree_opt_pass pass_loop_init
;
129 extern struct tree_opt_pass pass_lim
;
130 extern struct tree_opt_pass pass_unswitch
;
131 extern struct tree_opt_pass pass_iv_canon
;
132 extern struct tree_opt_pass pass_record_bounds
;
133 extern struct tree_opt_pass pass_if_conversion
;
134 extern struct tree_opt_pass pass_vectorize
;
135 extern struct tree_opt_pass pass_complete_unroll
;
136 extern struct tree_opt_pass pass_iv_optimize
;
137 extern struct tree_opt_pass pass_loop_done
;
138 extern struct tree_opt_pass pass_ch
;
139 extern struct tree_opt_pass pass_ccp
;
140 extern struct tree_opt_pass pass_build_ssa
;
141 extern struct tree_opt_pass pass_del_ssa
;
142 extern struct tree_opt_pass pass_dominator
;
143 extern struct tree_opt_pass pass_dce
;
144 extern struct tree_opt_pass pass_cd_dce
;
145 extern struct tree_opt_pass pass_may_alias
;
146 extern struct tree_opt_pass pass_split_crit_edges
;
147 extern struct tree_opt_pass pass_pre
;
148 extern struct tree_opt_pass pass_profile
;
149 extern struct tree_opt_pass pass_pre_expand
;
150 extern struct tree_opt_pass pass_lower_vector_ssa
;
151 extern struct tree_opt_pass pass_fold_builtins
;
152 extern struct tree_opt_pass pass_early_warn_uninitialized
;
153 extern struct tree_opt_pass pass_late_warn_uninitialized
;
154 extern struct tree_opt_pass pass_warn_function_return
;
155 extern struct tree_opt_pass pass_phiopt
;
156 extern struct tree_opt_pass pass_forwprop
;
157 extern struct tree_opt_pass pass_redundant_phi
;
158 extern struct tree_opt_pass pass_dse
;
159 extern struct tree_opt_pass pass_nrv
;
160 extern struct tree_opt_pass pass_remove_useless_vars
;
161 extern struct tree_opt_pass pass_rename_ssa_copies
;
162 extern struct tree_opt_pass pass_expand
;
163 extern struct tree_opt_pass pass_rest_of_compilation
;
164 extern struct tree_opt_pass pass_fre
;
165 extern struct tree_opt_pass pass_linear_transform
;
166 extern struct tree_opt_pass pass_maybe_create_global_var
;
168 #endif /* GCC_TREE_PASS_H */