]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/tree-pass.h
93129100cefa69f101cbfd68ba247f09ef7bb0dd
[thirdparty/gcc.git] / gcc / tree-pass.h
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>
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 2, 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 COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22
23 #ifndef GCC_TREE_PASS_H
24 #define GCC_TREE_PASS_H 1
25
26 /* Global variables used to communicate with passes. */
27 extern FILE *dump_file;
28 extern int dump_flags;
29
30 extern struct bitmap_head_def *vars_to_rename;
31
32 /* Describe one pass. */
33 struct tree_opt_pass
34 {
35 /* Terse name of the pass used as a fragment of the dump file name. */
36 const char *name;
37
38 /* If non-null, this pass and all sub-passes are executed only if
39 the function returns true. */
40 bool (*gate) (void);
41
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);
45
46 /* A list of sub-passes to run, dependent on gate predicate. */
47 struct tree_opt_pass *sub;
48
49 /* Next in the list of passes to run, independent of gate predicate. */
50 struct tree_opt_pass *next;
51
52 /* Static pass number, used as a fragment of the dump file name. */
53 unsigned int static_pass_number;
54
55 /* The timevar id associated with this pass. */
56 /* ??? Ideally would be dynamically assigned. */
57 unsigned int tv_id;
58
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;
63
64 /* Flags indicating common sets things to do before and after. */
65 unsigned int todo_flags_start;
66 unsigned int todo_flags_finish;
67 };
68
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)
79
80 #define PROP_trees \
81 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
82
83 /* To-do flags. */
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)
90
91 #define TODO_verify_all \
92 (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
93
94
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_lower_complex;
124 extern struct tree_opt_pass pass_fold_builtins;
125 extern struct tree_opt_pass pass_early_warn_uninitialized;
126 extern struct tree_opt_pass pass_late_warn_uninitialized;
127 extern struct tree_opt_pass pass_warn_function_return;
128 extern struct tree_opt_pass pass_phiopt;
129 extern struct tree_opt_pass pass_forwprop;
130 extern struct tree_opt_pass pass_redundant_phi;
131 extern struct tree_opt_pass pass_dse;
132 extern struct tree_opt_pass pass_nrv;
133 extern struct tree_opt_pass pass_remove_useless_vars;
134 extern struct tree_opt_pass pass_rename_ssa_copies;
135 extern struct tree_opt_pass pass_expand;
136 extern struct tree_opt_pass pass_rest_of_compilation;
137 extern struct tree_opt_pass pass_fre;
138
139
140 #endif /* GCC_TREE_PASS_H */