OSDN Git Service

2004-05-13 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.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
79 /* To-do flags.  */
80 #define TODO_dump_func          (1 << 0)        /* pass doesn't dump itself */
81 #define TODO_rename_vars        (1 << 1)        /* rewrite new vars to ssa */
82 #define TODO_ggc_collect        (1 << 2)        /* run the collector */
83 #define TODO_verify_ssa         (1 << 3)
84 #define TODO_verify_flow        (1 << 4)
85 #define TODO_verify_stmts       (1 << 5)
86
87 #define TODO_verify_all \
88   (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
89
90
91 extern struct tree_opt_pass pass_mudflap_1;
92 extern struct tree_opt_pass pass_mudflap_2;
93 extern struct tree_opt_pass pass_remove_useless_stmts;
94 extern struct tree_opt_pass pass_lower_cf;
95 extern struct tree_opt_pass pass_lower_eh;
96 extern struct tree_opt_pass pass_build_cfg;
97 extern struct tree_opt_pass pass_tree_profile;
98 extern struct tree_opt_pass pass_referenced_vars;
99 extern struct tree_opt_pass pass_build_pta;
100 extern struct tree_opt_pass pass_del_pta;
101 extern struct tree_opt_pass pass_sra;
102 extern struct tree_opt_pass pass_tail_recursion;
103 extern struct tree_opt_pass pass_tail_calls;
104 extern struct tree_opt_pass pass_loop;
105 extern struct tree_opt_pass pass_ch;
106 extern struct tree_opt_pass pass_ccp;
107 extern struct tree_opt_pass pass_build_ssa;
108 extern struct tree_opt_pass pass_del_ssa;
109 extern struct tree_opt_pass pass_dominator;
110 extern struct tree_opt_pass pass_dce;
111 extern struct tree_opt_pass pass_cd_dce;
112 extern struct tree_opt_pass pass_may_alias;
113 extern struct tree_opt_pass pass_split_crit_edges;
114 extern struct tree_opt_pass pass_pre;
115 extern struct tree_opt_pass pass_profile;
116 extern struct tree_opt_pass pass_lower_complex;
117 extern struct tree_opt_pass pass_fold_builtins;
118 extern struct tree_opt_pass pass_early_warn_uninitialized;
119 extern struct tree_opt_pass pass_late_warn_uninitialized;
120 extern struct tree_opt_pass pass_warn_function_return;
121 extern struct tree_opt_pass pass_phiopt;
122 extern struct tree_opt_pass pass_forwprop;
123 extern struct tree_opt_pass pass_redundant_phi;
124 extern struct tree_opt_pass pass_dse;
125 extern struct tree_opt_pass pass_nrv;
126 extern struct tree_opt_pass pass_remove_useless_vars;
127 extern struct tree_opt_pass pass_rename_ssa_copies;
128
129
130 #endif /* GCC_TREE_PASS_H */