neon-vcond-gt.c: Scan for vbsl or vbit or vbif.
[gcc.git] / gcc / gimple-ssa.h
1 /* Header file for routines that straddle the border between GIMPLE and
2 SSA in gimple.
3 Copyright (C) 2009-2013 Free Software Foundation, Inc.
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 3, 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 COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 #ifndef GCC_GIMPLE_SSA_H
22 #define GCC_GIMPLE_SSA_H
23
24 #include "tree-ssa-operands.h"
25
26 /* This structure is used to map a gimple statement to a label,
27 or list of labels to represent transaction restart. */
28
29 struct GTY(()) tm_restart_node {
30 gimple stmt;
31 tree label_or_list;
32 };
33
34 /* Gimple dataflow datastructure. All publicly available fields shall have
35 gimple_ accessor defined, all publicly modifiable fields should have
36 gimple_set accessor. */
37 struct GTY(()) gimple_df {
38 /* A vector of all the noreturn calls passed to modify_stmt.
39 cleanup_control_flow uses it to detect cases where a mid-block
40 indirect call has been turned into a noreturn call. When this
41 happens, all the instructions after the call are no longer
42 reachable and must be deleted as dead. */
43 vec<gimple, va_gc> *modified_noreturn_calls;
44
45 /* Array of all SSA_NAMEs used in the function. */
46 vec<tree, va_gc> *ssa_names;
47
48 /* Artificial variable used for the virtual operand FUD chain. */
49 tree vop;
50
51 /* The PTA solution for the ESCAPED artificial variable. */
52 struct pt_solution escaped;
53
54 /* A map of decls to artificial ssa-names that point to the partition
55 of the decl. */
56 struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
57
58 /* Free list of SSA_NAMEs. */
59 vec<tree, va_gc> *free_ssanames;
60
61 /* Hashtable holding definition for symbol. If this field is not NULL, it
62 means that the first reference to this variable in the function is a
63 USE or a VUSE. In those cases, the SSA renamer creates an SSA name
64 for this variable with an empty defining statement. */
65 htab_t GTY((param_is (union tree_node))) default_defs;
66
67 /* True if there are any symbols that need to be renamed. */
68 unsigned int ssa_renaming_needed : 1;
69
70 /* True if all virtual operands need to be renamed. */
71 unsigned int rename_vops : 1;
72
73 /* True if the code is in ssa form. */
74 unsigned int in_ssa_p : 1;
75
76 /* True if IPA points-to information was computed for this function. */
77 unsigned int ipa_pta : 1;
78
79 struct ssa_operands ssa_operands;
80
81 /* Map gimple stmt to tree label (or list of labels) for transaction
82 restart and abort. */
83 htab_t GTY ((param_is (struct tm_restart_node))) tm_restart;
84 };
85
86
87 /* Return true when gimple SSA form was built.
88 gimple_in_ssa_p is queried by gimplifier in various early stages before SSA
89 infrastructure is initialized. Check for presence of the datastructures
90 at first place. */
91 static inline bool
92 gimple_in_ssa_p (const struct function *fun)
93 {
94 return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
95 }
96
97 /* Artificial variable used for the virtual operand FUD chain. */
98 static inline tree
99 gimple_vop (const struct function *fun)
100 {
101 gcc_checking_assert (fun && fun->gimple_df);
102 return fun->gimple_df->vop;
103 }
104
105 /* Return the set of VUSE operand for statement G. */
106
107 static inline use_operand_p
108 gimple_vuse_op (const_gimple g)
109 {
110 struct use_optype_d *ops;
111 if (!gimple_has_mem_ops (g))
112 return NULL_USE_OPERAND_P;
113 ops = g->gsops.opbase.use_ops;
114 if (ops
115 && USE_OP_PTR (ops)->use == &g->gsmembase.vuse)
116 return USE_OP_PTR (ops);
117 return NULL_USE_OPERAND_P;
118 }
119
120 /* Return the set of VDEF operand for statement G. */
121
122 static inline def_operand_p
123 gimple_vdef_op (gimple g)
124 {
125 if (!gimple_has_mem_ops (g))
126 return NULL_DEF_OPERAND_P;
127 if (g->gsmembase.vdef)
128 return &g->gsmembase.vdef;
129 return NULL_DEF_OPERAND_P;
130 }
131
132 /* Mark statement S as modified, and update it. */
133
134 static inline void
135 update_stmt (gimple s)
136 {
137 if (gimple_has_ops (s))
138 {
139 gimple_set_modified (s, true);
140 update_stmt_operands (s);
141 }
142 }
143
144 /* Update statement S if it has been optimized. */
145
146 static inline void
147 update_stmt_if_modified (gimple s)
148 {
149 if (gimple_modified_p (s))
150 update_stmt_operands (s);
151 }
152
153
154 #endif /* GCC_GIMPLE_SSA_H */