annotate gcc/tree-ssanames.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* SSA name expresssons routines
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2013-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef GCC_TREE_SSANAMES_H
kono
parents:
diff changeset
21 #define GCC_TREE_SSANAMES_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Aliasing information for SSA_NAMEs representing pointer variables. */
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 struct GTY(()) ptr_info_def
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 /* The points-to solution. */
kono
parents:
diff changeset
28 struct pt_solution pt;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* Alignment and misalignment of the pointer in bytes. Together
kono
parents:
diff changeset
31 align and misalign specify low known bits of the pointer.
kono
parents:
diff changeset
32 ptr & (align - 1) == misalign. */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* When known, this is the power-of-two byte alignment of the object this
kono
parents:
diff changeset
35 pointer points into. This is usually DECL_ALIGN_UNIT for decls and
kono
parents:
diff changeset
36 MALLOC_ABI_ALIGNMENT for allocated storage. When the alignment is not
kono
parents:
diff changeset
37 known, it is zero. Do not access directly but use functions
kono
parents:
diff changeset
38 get_ptr_info_alignment, set_ptr_info_alignment,
kono
parents:
diff changeset
39 mark_ptr_info_alignment_unknown and similar. */
kono
parents:
diff changeset
40 unsigned int align;
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* When alignment is known, the byte offset this pointer differs from the
kono
parents:
diff changeset
43 above alignment. Access only through the same helper functions as align
kono
parents:
diff changeset
44 above. */
kono
parents:
diff changeset
45 unsigned int misalign;
kono
parents:
diff changeset
46 };
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* Value range information for SSA_NAMEs representing non-pointer variables. */
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 struct GTY ((variable_size)) range_info_def {
kono
parents:
diff changeset
51 /* Minimum, maximum and nonzero bits. */
kono
parents:
diff changeset
52 TRAILING_WIDE_INT_ACCESSOR (min, ints, 0)
kono
parents:
diff changeset
53 TRAILING_WIDE_INT_ACCESSOR (max, ints, 1)
kono
parents:
diff changeset
54 TRAILING_WIDE_INT_ACCESSOR (nonzero_bits, ints, 2)
kono
parents:
diff changeset
55 trailing_wide_ints <3> ints;
kono
parents:
diff changeset
56 };
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 #define SSANAMES(fun) (fun)->gimple_df->ssa_names
kono
parents:
diff changeset
60 #define DEFAULT_DEFS(fun) (fun)->gimple_df->default_defs
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 #define num_ssa_names (vec_safe_length (cfun->gimple_df->ssa_names))
kono
parents:
diff changeset
63 #define ssa_name(i) ((*cfun->gimple_df->ssa_names)[(i)])
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 #define FOR_EACH_SSA_NAME(I, VAR, FN) \
kono
parents:
diff changeset
66 for (I = 1; SSANAMES (FN)->iterate (I, &VAR); ++I) \
kono
parents:
diff changeset
67 if (VAR)
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 /* Sets the value range to SSA. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
70 extern void set_range_info (tree, enum value_range_kind, const wide_int_ref &,
111
kono
parents:
diff changeset
71 const wide_int_ref &);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
72 extern void set_range_info (tree, const value_range &);
111
kono
parents:
diff changeset
73 /* Gets the value range from SSA. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
74 extern enum value_range_kind get_range_info (const_tree, wide_int *,
111
kono
parents:
diff changeset
75 wide_int *);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 extern enum value_range_kind get_range_info (const_tree, value_range &);
111
kono
parents:
diff changeset
77 extern void set_nonzero_bits (tree, const wide_int_ref &);
kono
parents:
diff changeset
78 extern wide_int get_nonzero_bits (const_tree);
kono
parents:
diff changeset
79 extern bool ssa_name_has_boolean_range (tree);
kono
parents:
diff changeset
80 extern void init_ssanames (struct function *, int);
kono
parents:
diff changeset
81 extern void fini_ssanames (struct function *);
kono
parents:
diff changeset
82 extern void ssanames_print_statistics (void);
kono
parents:
diff changeset
83 extern tree make_ssa_name_fn (struct function *, tree, gimple *,
kono
parents:
diff changeset
84 unsigned int version = 0);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
85 extern void init_ssa_name_imm_use (tree);
111
kono
parents:
diff changeset
86 extern void release_ssa_name_fn (struct function *, tree);
kono
parents:
diff changeset
87 extern bool get_ptr_info_alignment (struct ptr_info_def *, unsigned int *,
kono
parents:
diff changeset
88 unsigned int *);
kono
parents:
diff changeset
89 extern void mark_ptr_info_alignment_unknown (struct ptr_info_def *);
kono
parents:
diff changeset
90 extern void set_ptr_info_alignment (struct ptr_info_def *, unsigned int,
kono
parents:
diff changeset
91 unsigned int);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
92 extern void adjust_ptr_info_misalignment (struct ptr_info_def *, poly_uint64);
111
kono
parents:
diff changeset
93 extern struct ptr_info_def *get_ptr_info (tree);
kono
parents:
diff changeset
94 extern void set_ptr_nonnull (tree);
kono
parents:
diff changeset
95 extern bool get_ptr_nonnull (const_tree);
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 extern tree copy_ssa_name_fn (struct function *, tree, gimple *);
kono
parents:
diff changeset
98 extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
kono
parents:
diff changeset
99 extern tree duplicate_ssa_name_fn (struct function *, tree, gimple *);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
100 extern void duplicate_ssa_name_range_info (tree, enum value_range_kind,
111
kono
parents:
diff changeset
101 struct range_info_def *);
kono
parents:
diff changeset
102 extern void reset_flow_sensitive_info (tree);
kono
parents:
diff changeset
103 extern void reset_flow_sensitive_info_in_bb (basic_block);
kono
parents:
diff changeset
104 extern void release_defs (gimple *);
kono
parents:
diff changeset
105 extern void replace_ssa_name_symbol (tree, tree);
kono
parents:
diff changeset
106 extern void flush_ssaname_freelist (void);
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 /* Return an SSA_NAME node for variable VAR defined in statement STMT
kono
parents:
diff changeset
110 in function cfun. */
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 static inline tree
kono
parents:
diff changeset
113 make_ssa_name (tree var, gimple *stmt = NULL)
kono
parents:
diff changeset
114 {
kono
parents:
diff changeset
115 return make_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
116 }
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 /* Return an SSA_NAME node using the template SSA name NAME defined in
kono
parents:
diff changeset
119 statement STMT in function cfun. */
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 static inline tree
kono
parents:
diff changeset
122 copy_ssa_name (tree var, gimple *stmt = NULL)
kono
parents:
diff changeset
123 {
kono
parents:
diff changeset
124 return copy_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
125 }
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 /* Creates a duplicate of a SSA name NAME tobe defined by statement STMT
kono
parents:
diff changeset
128 in function cfun. */
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 static inline tree
kono
parents:
diff changeset
131 duplicate_ssa_name (tree var, gimple *stmt)
kono
parents:
diff changeset
132 {
kono
parents:
diff changeset
133 return duplicate_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
134 }
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 /* Release the SSA name NAME used in function cfun. */
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 static inline void
kono
parents:
diff changeset
139 release_ssa_name (tree name)
kono
parents:
diff changeset
140 {
kono
parents:
diff changeset
141 release_ssa_name_fn (cfun, name);
kono
parents:
diff changeset
142 }
kono
parents:
diff changeset
143
kono
parents:
diff changeset
144 /* Return an anonymous SSA_NAME node for type TYPE defined in statement STMT
kono
parents:
diff changeset
145 in function cfun. Arrange so that it uses NAME in dumps. */
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 static inline tree
kono
parents:
diff changeset
148 make_temp_ssa_name (tree type, gimple *stmt, const char *name)
kono
parents:
diff changeset
149 {
kono
parents:
diff changeset
150 tree ssa_name;
kono
parents:
diff changeset
151 gcc_checking_assert (TYPE_P (type));
kono
parents:
diff changeset
152 ssa_name = make_ssa_name_fn (cfun, type, stmt);
kono
parents:
diff changeset
153 SET_SSA_NAME_VAR_OR_IDENTIFIER (ssa_name, get_identifier (name));
kono
parents:
diff changeset
154 return ssa_name;
kono
parents:
diff changeset
155 }
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 #endif /* GCC_TREE_SSANAMES_H */