Merged with mainline at revision 126347.
[official-gcc.git] / gcc / tree-ssa-sccvn.h
blob9e8c317992a51c2aea97b85caee567a1e4d9006d
1 /* Tree SCC value numbering
2 Copyright (C) 2007 Free Software Foundation, Inc.
3 Contributed by Daniel Berlin <dberlin@dberlin.org>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) 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; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef TREE_SSA_SCCVN_H
23 #define TREE_SSA_SCCVN_H
25 /* TOP of the VN lattice. */
26 extern tree VN_TOP;
28 typedef struct vn_ssa_aux
30 /* SCC information. */
31 unsigned int dfsnum;
32 bool visited;
33 unsigned int low;
34 bool on_sccstack;
36 /* Value number. This may be an SSA name or a constant. */
37 tree valnum;
38 /* Representative expression, if not a direct constant. */
39 tree expr;
40 /* Whether the representative expression contains constants. */
41 bool has_constants;
42 /* Whether the SSA_NAME has been value numbered already. This is
43 only saying whether visit_use has been called on it at least
44 once. It cannot be used to avoid visitation for SSA_NAME's
45 involved in non-singleton SCC's. */
46 bool use_processed;
47 } *vn_ssa_aux_t;
49 /* Return the value numbering info for an SSA_NAME. */
50 extern vn_ssa_aux_t VN_INFO (tree);
51 extern vn_ssa_aux_t VN_INFO_GET (tree);
52 void run_scc_vn (void);
53 void free_scc_vn (void);
54 void switch_to_PRE_table (void);
55 tree vn_binary_op_lookup (tree);
56 void vn_binary_op_insert (tree, tree);
57 tree vn_unary_op_lookup (tree);
58 void vn_unary_op_insert (tree, tree);
59 tree vn_reference_lookup (tree, VEC (tree, gc) *);
60 void vn_reference_insert (tree, tree, VEC (tree, gc) *);
61 VEC (tree, gc) *shared_vuses_from_stmt (tree);
62 VEC (tree, gc) *copy_vuses_from_stmt (tree);
65 #endif /* TREE_SSA_SCCVN_H */