2005-01-20 Michael Koch <konqueror@gmx.de>
[official-gcc.git] / gcc / tree-pass.h
blob3a8c31ea7af9ce43d53a7e8241f809665e847d07
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)
10 any later version.
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. */
33 struct tree_opt_pass
35 /* Terse name of the pass used as a fragment of the dump file name. */
36 const char *name;
38 /* If non-null, this pass and all sub-passes are executed only if
39 the function returns true. */
40 bool (*gate) (void);
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. */
57 unsigned int tv_id;
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)
80 #define PROP_trees \
81 (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh)
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)
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_ch;
110 extern struct tree_opt_pass pass_ccp;
111 extern struct tree_opt_pass pass_build_ssa;
112 extern struct tree_opt_pass pass_del_ssa;
113 extern struct tree_opt_pass pass_dominator;
114 extern struct tree_opt_pass pass_dce;
115 extern struct tree_opt_pass pass_cd_dce;
116 extern struct tree_opt_pass pass_may_alias;
117 extern struct tree_opt_pass pass_split_crit_edges;
118 extern struct tree_opt_pass pass_pre;
119 extern struct tree_opt_pass pass_profile;
120 extern struct tree_opt_pass pass_lower_complex;
121 extern struct tree_opt_pass pass_fold_builtins;
122 extern struct tree_opt_pass pass_early_warn_uninitialized;
123 extern struct tree_opt_pass pass_late_warn_uninitialized;
124 extern struct tree_opt_pass pass_warn_function_return;
125 extern struct tree_opt_pass pass_phiopt;
126 extern struct tree_opt_pass pass_forwprop;
127 extern struct tree_opt_pass pass_redundant_phi;
128 extern struct tree_opt_pass pass_dse;
129 extern struct tree_opt_pass pass_nrv;
130 extern struct tree_opt_pass pass_remove_useless_vars;
131 extern struct tree_opt_pass pass_rename_ssa_copies;
132 extern struct tree_opt_pass pass_expand;
133 extern struct tree_opt_pass pass_rest_of_compilation;
136 #endif /* GCC_TREE_PASS_H */