annotate gcc/tree-ssanames.c @ 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
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Generic routines for manipulating SSA_NAME expressions
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2003-2020 Free Software Foundation, Inc.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
3
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
5
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 any later version.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
10
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GNU General Public License for more details.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
15
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #include "config.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #include "system.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #include "coretypes.h"
111
kono
parents: 67
diff changeset
23 #include "backend.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #include "tree.h"
111
kono
parents: 67
diff changeset
25 #include "gimple.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 #include "tree-pass.h"
111
kono
parents: 67
diff changeset
27 #include "ssa.h"
kono
parents: 67
diff changeset
28 #include "gimple-iterator.h"
kono
parents: 67
diff changeset
29 #include "stor-layout.h"
kono
parents: 67
diff changeset
30 #include "tree-into-ssa.h"
kono
parents: 67
diff changeset
31 #include "tree-ssa.h"
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
32 #include "cfgloop.h"
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
33 #include "tree-scalar-evolution.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 /* Rewriting a function into SSA form can create a huge number of SSA_NAMEs,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 many of which may be thrown away shortly after their creation if jumps
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
37 were threaded through PHI nodes.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 While our garbage collection mechanisms will handle this situation, it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 is extremely wasteful to create nodes and throw them away, especially
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 when the nodes can be reused.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 For PR 8361, we can significantly reduce the number of nodes allocated
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 and thus the total amount of memory allocated by managing SSA_NAMEs a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 little. This additionally helps reduce the amount of work done by the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 garbage collector. Similar results have been seen on a wider variety
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 of tests (such as the compiler itself).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 Right now we maintain our free list on a per-function basis. It may
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 or may not make sense to maintain the free list for the duration of
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
51 a compilation unit.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 External code should rely solely upon HIGHEST_SSA_VERSION and the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 externally defined functions. External code should not know about
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 the details of the free list management.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 External code should also not assume the version number on nodes is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 monotonically increasing. We reuse the version number when we
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 reuse an SSA_NAME expression. This helps keep arrays and bitmaps
111
kono
parents: 67
diff changeset
60 more compact. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 /* Version numbers with special meanings. We start allocating new version
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 numbers after the special ones. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 #define UNUSED_NAME_VERSION 0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 unsigned int ssa_name_nodes_reused;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 unsigned int ssa_name_nodes_created;
111
kono
parents: 67
diff changeset
69
kono
parents: 67
diff changeset
70 #define FREE_SSANAMES(fun) (fun)->gimple_df->free_ssanames
kono
parents: 67
diff changeset
71 #define FREE_SSANAMES_QUEUE(fun) (fun)->gimple_df->free_ssanames_queue
kono
parents: 67
diff changeset
72
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 /* Initialize management of SSA_NAMEs to default SIZE. If SIZE is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 zero use default. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 init_ssanames (struct function *fn, int size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 if (size < 50)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 size = 50;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82
111
kono
parents: 67
diff changeset
83 vec_alloc (SSANAMES (fn), size);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 /* Version 0 is special, so reserve the first slot in the table. Though
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 currently unused, we may use version 0 in alias analysis as part of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 the heuristics used to group aliases when the alias sets are too
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 large.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
111
kono
parents: 67
diff changeset
90 We use vec::quick_push here because we know that SSA_NAMES has at
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 least 50 elements reserved in it. */
111
kono
parents: 67
diff changeset
92 SSANAMES (fn)->quick_push (NULL_TREE);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 FREE_SSANAMES (fn) = NULL;
111
kono
parents: 67
diff changeset
94 FREE_SSANAMES_QUEUE (fn) = NULL;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
95
111
kono
parents: 67
diff changeset
96 fn->gimple_df->ssa_renaming_needed = 0;
kono
parents: 67
diff changeset
97 fn->gimple_df->rename_vops = 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 /* Finalize management of SSA_NAMEs. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 void
111
kono
parents: 67
diff changeset
103 fini_ssanames (struct function *fn)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 {
111
kono
parents: 67
diff changeset
105 vec_free (SSANAMES (fn));
kono
parents: 67
diff changeset
106 vec_free (FREE_SSANAMES (fn));
kono
parents: 67
diff changeset
107 vec_free (FREE_SSANAMES_QUEUE (fn));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 /* Dump some simple statistics regarding the re-use of SSA_NAME nodes. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 ssanames_print_statistics (void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
115 fprintf (stderr, "%-32s" PRsa (11) "\n", "SSA_NAME nodes allocated:",
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
116 SIZE_AMOUNT (ssa_name_nodes_created));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
117 fprintf (stderr, "%-32s" PRsa (11) "\n", "SSA_NAME nodes reused:",
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
118 SIZE_AMOUNT (ssa_name_nodes_reused));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 }
111
kono
parents: 67
diff changeset
120
kono
parents: 67
diff changeset
121 /* Verify the state of the SSA_NAME lists.
kono
parents: 67
diff changeset
122
kono
parents: 67
diff changeset
123 There must be no duplicates on the free list.
kono
parents: 67
diff changeset
124 Every name on the free list must be marked as on the free list.
kono
parents: 67
diff changeset
125 Any name on the free list must not appear in the IL.
kono
parents: 67
diff changeset
126 No names can be leaked. */
kono
parents: 67
diff changeset
127
kono
parents: 67
diff changeset
128 DEBUG_FUNCTION void
kono
parents: 67
diff changeset
129 verify_ssaname_freelists (struct function *fun)
kono
parents: 67
diff changeset
130 {
kono
parents: 67
diff changeset
131 if (!gimple_in_ssa_p (fun))
kono
parents: 67
diff changeset
132 return;
kono
parents: 67
diff changeset
133
kono
parents: 67
diff changeset
134 auto_bitmap names_in_il;
kono
parents: 67
diff changeset
135
kono
parents: 67
diff changeset
136 /* Walk the entire IL noting every SSA_NAME we see. */
kono
parents: 67
diff changeset
137 basic_block bb;
kono
parents: 67
diff changeset
138 FOR_EACH_BB_FN (bb, fun)
kono
parents: 67
diff changeset
139 {
kono
parents: 67
diff changeset
140 tree t;
kono
parents: 67
diff changeset
141 /* First note the result and arguments of PHI nodes. */
kono
parents: 67
diff changeset
142 for (gphi_iterator gsi = gsi_start_phis (bb);
kono
parents: 67
diff changeset
143 !gsi_end_p (gsi);
kono
parents: 67
diff changeset
144 gsi_next (&gsi))
kono
parents: 67
diff changeset
145 {
kono
parents: 67
diff changeset
146 gphi *phi = gsi.phi ();
kono
parents: 67
diff changeset
147 t = gimple_phi_result (phi);
kono
parents: 67
diff changeset
148 bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t));
kono
parents: 67
diff changeset
149
kono
parents: 67
diff changeset
150 for (unsigned int i = 0; i < gimple_phi_num_args (phi); i++)
kono
parents: 67
diff changeset
151 {
kono
parents: 67
diff changeset
152 t = gimple_phi_arg_def (phi, i);
kono
parents: 67
diff changeset
153 if (TREE_CODE (t) == SSA_NAME)
kono
parents: 67
diff changeset
154 bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t));
kono
parents: 67
diff changeset
155 }
kono
parents: 67
diff changeset
156 }
kono
parents: 67
diff changeset
157
kono
parents: 67
diff changeset
158 /* Then note the operands of each statement. */
kono
parents: 67
diff changeset
159 for (gimple_stmt_iterator gsi = gsi_start_bb (bb);
kono
parents: 67
diff changeset
160 !gsi_end_p (gsi);
kono
parents: 67
diff changeset
161 gsi_next (&gsi))
kono
parents: 67
diff changeset
162 {
kono
parents: 67
diff changeset
163 ssa_op_iter iter;
kono
parents: 67
diff changeset
164 gimple *stmt = gsi_stmt (gsi);
kono
parents: 67
diff changeset
165 FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, SSA_OP_ALL_OPERANDS)
kono
parents: 67
diff changeset
166 bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t));
kono
parents: 67
diff changeset
167 }
kono
parents: 67
diff changeset
168 }
kono
parents: 67
diff changeset
169
kono
parents: 67
diff changeset
170 /* Now walk the free list noting what we find there and verifying
kono
parents: 67
diff changeset
171 there are no duplicates. */
kono
parents: 67
diff changeset
172 auto_bitmap names_in_freelists;
kono
parents: 67
diff changeset
173 if (FREE_SSANAMES (fun))
kono
parents: 67
diff changeset
174 {
kono
parents: 67
diff changeset
175 for (unsigned int i = 0; i < FREE_SSANAMES (fun)->length (); i++)
kono
parents: 67
diff changeset
176 {
kono
parents: 67
diff changeset
177 tree t = (*FREE_SSANAMES (fun))[i];
kono
parents: 67
diff changeset
178
kono
parents: 67
diff changeset
179 /* Verify that the name is marked as being in the free list. */
kono
parents: 67
diff changeset
180 gcc_assert (SSA_NAME_IN_FREE_LIST (t));
kono
parents: 67
diff changeset
181
kono
parents: 67
diff changeset
182 /* Verify the name has not already appeared in the free list and
kono
parents: 67
diff changeset
183 note it in the list of names found in the free list. */
kono
parents: 67
diff changeset
184 gcc_assert (!bitmap_bit_p (names_in_freelists, SSA_NAME_VERSION (t)));
kono
parents: 67
diff changeset
185 bitmap_set_bit (names_in_freelists, SSA_NAME_VERSION (t));
kono
parents: 67
diff changeset
186 }
kono
parents: 67
diff changeset
187 }
kono
parents: 67
diff changeset
188
kono
parents: 67
diff changeset
189 /* Similarly for the names in the pending free list. */
kono
parents: 67
diff changeset
190 if (FREE_SSANAMES_QUEUE (fun))
kono
parents: 67
diff changeset
191 {
kono
parents: 67
diff changeset
192 for (unsigned int i = 0; i < FREE_SSANAMES_QUEUE (fun)->length (); i++)
kono
parents: 67
diff changeset
193 {
kono
parents: 67
diff changeset
194 tree t = (*FREE_SSANAMES_QUEUE (fun))[i];
kono
parents: 67
diff changeset
195
kono
parents: 67
diff changeset
196 /* Verify that the name is marked as being in the free list. */
kono
parents: 67
diff changeset
197 gcc_assert (SSA_NAME_IN_FREE_LIST (t));
kono
parents: 67
diff changeset
198
kono
parents: 67
diff changeset
199 /* Verify the name has not already appeared in the free list and
kono
parents: 67
diff changeset
200 note it in the list of names found in the free list. */
kono
parents: 67
diff changeset
201 gcc_assert (!bitmap_bit_p (names_in_freelists, SSA_NAME_VERSION (t)));
kono
parents: 67
diff changeset
202 bitmap_set_bit (names_in_freelists, SSA_NAME_VERSION (t));
kono
parents: 67
diff changeset
203 }
kono
parents: 67
diff changeset
204 }
kono
parents: 67
diff changeset
205
kono
parents: 67
diff changeset
206 /* If any name appears in both the IL and the freelists, then
kono
parents: 67
diff changeset
207 something horrible has happened. */
kono
parents: 67
diff changeset
208 bool intersect_p = bitmap_intersect_p (names_in_il, names_in_freelists);
kono
parents: 67
diff changeset
209 gcc_assert (!intersect_p);
kono
parents: 67
diff changeset
210
kono
parents: 67
diff changeset
211 /* Names can be queued up for release if there is an ssa update
kono
parents: 67
diff changeset
212 pending. Pretend we saw them in the IL. */
kono
parents: 67
diff changeset
213 if (names_to_release)
kono
parents: 67
diff changeset
214 bitmap_ior_into (names_in_il, names_to_release);
kono
parents: 67
diff changeset
215
kono
parents: 67
diff changeset
216 /* Function splitting can "lose" SSA_NAMEs in an effort to ensure that
kono
parents: 67
diff changeset
217 debug/non-debug compilations have the same SSA_NAMEs. So for each
kono
parents: 67
diff changeset
218 lost SSA_NAME, see if it's likely one from that wart. These will always
kono
parents: 67
diff changeset
219 be marked as default definitions. So we loosely assume that anything
kono
parents: 67
diff changeset
220 marked as a default definition isn't leaked by pretending they are
kono
parents: 67
diff changeset
221 in the IL. */
kono
parents: 67
diff changeset
222 for (unsigned int i = UNUSED_NAME_VERSION + 1; i < num_ssa_names; i++)
kono
parents: 67
diff changeset
223 if (ssa_name (i) && SSA_NAME_IS_DEFAULT_DEF (ssa_name (i)))
kono
parents: 67
diff changeset
224 bitmap_set_bit (names_in_il, i);
kono
parents: 67
diff changeset
225
kono
parents: 67
diff changeset
226 unsigned int i;
kono
parents: 67
diff changeset
227 bitmap_iterator bi;
kono
parents: 67
diff changeset
228 auto_bitmap all_names;
kono
parents: 67
diff changeset
229 bitmap_set_range (all_names, UNUSED_NAME_VERSION + 1, num_ssa_names - 1);
kono
parents: 67
diff changeset
230 bitmap_ior_into (names_in_il, names_in_freelists);
kono
parents: 67
diff changeset
231
kono
parents: 67
diff changeset
232 /* Any name not mentioned in the IL and not in the feelists
kono
parents: 67
diff changeset
233 has been leaked. */
kono
parents: 67
diff changeset
234 EXECUTE_IF_AND_COMPL_IN_BITMAP(all_names, names_in_il,
kono
parents: 67
diff changeset
235 UNUSED_NAME_VERSION + 1, i, bi)
kono
parents: 67
diff changeset
236 gcc_assert (!ssa_name (i));
kono
parents: 67
diff changeset
237 }
kono
parents: 67
diff changeset
238
kono
parents: 67
diff changeset
239 /* Move all SSA_NAMEs from FREE_SSA_NAMES_QUEUE to FREE_SSA_NAMES.
kono
parents: 67
diff changeset
240
kono
parents: 67
diff changeset
241 We do not, but should have a mode to verify the state of the SSA_NAMEs
kono
parents: 67
diff changeset
242 lists. In particular at this point every name must be in the IL,
kono
parents: 67
diff changeset
243 on the free list or in the queue. Anything else is an error. */
kono
parents: 67
diff changeset
244
kono
parents: 67
diff changeset
245 void
kono
parents: 67
diff changeset
246 flush_ssaname_freelist (void)
kono
parents: 67
diff changeset
247 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
248 /* If there were any SSA names released reset the SCEV cache. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
249 if (! vec_safe_is_empty (FREE_SSANAMES_QUEUE (cfun)))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
250 scev_reset_htab ();
111
kono
parents: 67
diff changeset
251 vec_safe_splice (FREE_SSANAMES (cfun), FREE_SSANAMES_QUEUE (cfun));
kono
parents: 67
diff changeset
252 vec_safe_truncate (FREE_SSANAMES_QUEUE (cfun), 0);
kono
parents: 67
diff changeset
253 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
255 /* Initialize SSA_NAME_IMM_USE_NODE of a SSA NAME. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
256
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
257 void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
258 init_ssa_name_imm_use (tree name)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
259 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
260 use_operand_p imm;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
261 imm = &(SSA_NAME_IMM_USE_NODE (name));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 imm->use = NULL;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
263 imm->prev = imm;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 imm->next = imm;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 imm->loc.ssa_name = name;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
267
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 /* Return an SSA_NAME node for variable VAR defined in statement STMT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 in function FN. STMT may be an empty statement for artificial
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 references (e.g., default definitions created when a variable is
111
kono
parents: 67
diff changeset
271 used without a preceding definition). If VERISON is not zero then
kono
parents: 67
diff changeset
272 allocate the SSA name with that version. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 tree
111
kono
parents: 67
diff changeset
275 make_ssa_name_fn (struct function *fn, tree var, gimple *stmt,
kono
parents: 67
diff changeset
276 unsigned int version)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 tree t;
111
kono
parents: 67
diff changeset
279 gcc_assert (VAR_P (var)
kono
parents: 67
diff changeset
280 || TREE_CODE (var) == PARM_DECL
kono
parents: 67
diff changeset
281 || TREE_CODE (var) == RESULT_DECL
kono
parents: 67
diff changeset
282 || (TYPE_P (var) && is_gimple_reg_type (var)));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283
111
kono
parents: 67
diff changeset
284 /* Get the specified SSA name version. */
kono
parents: 67
diff changeset
285 if (version != 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 {
111
kono
parents: 67
diff changeset
287 t = make_node (SSA_NAME);
kono
parents: 67
diff changeset
288 SSA_NAME_VERSION (t) = version;
kono
parents: 67
diff changeset
289 if (version >= SSANAMES (fn)->length ())
kono
parents: 67
diff changeset
290 vec_safe_grow_cleared (SSANAMES (fn), version + 1);
kono
parents: 67
diff changeset
291 gcc_assert ((*SSANAMES (fn))[version] == NULL);
kono
parents: 67
diff changeset
292 (*SSANAMES (fn))[version] = t;
kono
parents: 67
diff changeset
293 ssa_name_nodes_created++;
kono
parents: 67
diff changeset
294 }
kono
parents: 67
diff changeset
295 /* If our free list has an element, then use it. */
kono
parents: 67
diff changeset
296 else if (!vec_safe_is_empty (FREE_SSANAMES (fn)))
kono
parents: 67
diff changeset
297 {
kono
parents: 67
diff changeset
298 t = FREE_SSANAMES (fn)->pop ();
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 ssa_name_nodes_reused++;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 /* The node was cleared out when we put it on the free list, so
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 there is no need to do so again here. */
111
kono
parents: 67
diff changeset
303 gcc_assert ((*SSANAMES (fn))[SSA_NAME_VERSION (t)] == NULL);
kono
parents: 67
diff changeset
304 (*SSANAMES (fn))[SSA_NAME_VERSION (t)] = t;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 t = make_node (SSA_NAME);
111
kono
parents: 67
diff changeset
309 SSA_NAME_VERSION (t) = SSANAMES (fn)->length ();
kono
parents: 67
diff changeset
310 vec_safe_push (SSANAMES (fn), t);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 ssa_name_nodes_created++;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313
111
kono
parents: 67
diff changeset
314 if (TYPE_P (var))
kono
parents: 67
diff changeset
315 {
kono
parents: 67
diff changeset
316 TREE_TYPE (t) = TYPE_MAIN_VARIANT (var);
kono
parents: 67
diff changeset
317 SET_SSA_NAME_VAR_OR_IDENTIFIER (t, NULL_TREE);
kono
parents: 67
diff changeset
318 }
kono
parents: 67
diff changeset
319 else
kono
parents: 67
diff changeset
320 {
kono
parents: 67
diff changeset
321 TREE_TYPE (t) = TREE_TYPE (var);
kono
parents: 67
diff changeset
322 SET_SSA_NAME_VAR_OR_IDENTIFIER (t, var);
kono
parents: 67
diff changeset
323 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 SSA_NAME_DEF_STMT (t) = stmt;
111
kono
parents: 67
diff changeset
325 if (POINTER_TYPE_P (TREE_TYPE (t)))
kono
parents: 67
diff changeset
326 SSA_NAME_PTR_INFO (t) = NULL;
kono
parents: 67
diff changeset
327 else
kono
parents: 67
diff changeset
328 SSA_NAME_RANGE_INFO (t) = NULL;
kono
parents: 67
diff changeset
329
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 SSA_NAME_IN_FREE_LIST (t) = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 SSA_NAME_IS_DEFAULT_DEF (t) = 0;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
332 init_ssa_name_imm_use (t);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 return t;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336
111
kono
parents: 67
diff changeset
337 /* Helper function for set_range_info.
kono
parents: 67
diff changeset
338
kono
parents: 67
diff changeset
339 Store range information RANGE_TYPE, MIN, and MAX to tree ssa_name
kono
parents: 67
diff changeset
340 NAME. */
kono
parents: 67
diff changeset
341
kono
parents: 67
diff changeset
342 void
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
343 set_range_info_raw (tree name, enum value_range_kind range_type,
111
kono
parents: 67
diff changeset
344 const wide_int_ref &min, const wide_int_ref &max)
kono
parents: 67
diff changeset
345 {
kono
parents: 67
diff changeset
346 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
347 gcc_assert (range_type == VR_RANGE || range_type == VR_ANTI_RANGE);
kono
parents: 67
diff changeset
348 range_info_def *ri = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
349 unsigned int precision = TYPE_PRECISION (TREE_TYPE (name));
kono
parents: 67
diff changeset
350
kono
parents: 67
diff changeset
351 /* Allocate if not available. */
kono
parents: 67
diff changeset
352 if (ri == NULL)
kono
parents: 67
diff changeset
353 {
kono
parents: 67
diff changeset
354 size_t size = (sizeof (range_info_def)
kono
parents: 67
diff changeset
355 + trailing_wide_ints <3>::extra_size (precision));
kono
parents: 67
diff changeset
356 ri = static_cast<range_info_def *> (ggc_internal_alloc (size));
kono
parents: 67
diff changeset
357 ri->ints.set_precision (precision);
kono
parents: 67
diff changeset
358 SSA_NAME_RANGE_INFO (name) = ri;
kono
parents: 67
diff changeset
359 ri->set_nonzero_bits (wi::shwi (-1, precision));
kono
parents: 67
diff changeset
360 }
kono
parents: 67
diff changeset
361
kono
parents: 67
diff changeset
362 /* Record the range type. */
kono
parents: 67
diff changeset
363 if (SSA_NAME_RANGE_TYPE (name) != range_type)
kono
parents: 67
diff changeset
364 SSA_NAME_ANTI_RANGE_P (name) = (range_type == VR_ANTI_RANGE);
kono
parents: 67
diff changeset
365
kono
parents: 67
diff changeset
366 /* Set the values. */
kono
parents: 67
diff changeset
367 ri->set_min (min);
kono
parents: 67
diff changeset
368 ri->set_max (max);
kono
parents: 67
diff changeset
369
kono
parents: 67
diff changeset
370 /* If it is a range, try to improve nonzero_bits from the min/max. */
kono
parents: 67
diff changeset
371 if (range_type == VR_RANGE)
kono
parents: 67
diff changeset
372 {
kono
parents: 67
diff changeset
373 wide_int xorv = ri->get_min () ^ ri->get_max ();
kono
parents: 67
diff changeset
374 if (xorv != 0)
kono
parents: 67
diff changeset
375 xorv = wi::mask (precision - wi::clz (xorv), false, precision);
kono
parents: 67
diff changeset
376 ri->set_nonzero_bits (ri->get_nonzero_bits () & (ri->get_min () | xorv));
kono
parents: 67
diff changeset
377 }
kono
parents: 67
diff changeset
378 }
kono
parents: 67
diff changeset
379
kono
parents: 67
diff changeset
380 /* Store range information RANGE_TYPE, MIN, and MAX to tree ssa_name
kono
parents: 67
diff changeset
381 NAME while making sure we don't store useless range info. */
kono
parents: 67
diff changeset
382
kono
parents: 67
diff changeset
383 void
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
384 set_range_info (tree name, enum value_range_kind range_type,
111
kono
parents: 67
diff changeset
385 const wide_int_ref &min, const wide_int_ref &max)
kono
parents: 67
diff changeset
386 {
kono
parents: 67
diff changeset
387 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
388
kono
parents: 67
diff changeset
389 /* A range of the entire domain is really no range at all. */
kono
parents: 67
diff changeset
390 tree type = TREE_TYPE (name);
kono
parents: 67
diff changeset
391 if (min == wi::min_value (TYPE_PRECISION (type), TYPE_SIGN (type))
kono
parents: 67
diff changeset
392 && max == wi::max_value (TYPE_PRECISION (type), TYPE_SIGN (type)))
kono
parents: 67
diff changeset
393 {
kono
parents: 67
diff changeset
394 range_info_def *ri = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
395 if (ri == NULL)
kono
parents: 67
diff changeset
396 return;
kono
parents: 67
diff changeset
397 if (ri->get_nonzero_bits () == -1)
kono
parents: 67
diff changeset
398 {
kono
parents: 67
diff changeset
399 ggc_free (ri);
kono
parents: 67
diff changeset
400 SSA_NAME_RANGE_INFO (name) = NULL;
kono
parents: 67
diff changeset
401 return;
kono
parents: 67
diff changeset
402 }
kono
parents: 67
diff changeset
403 }
kono
parents: 67
diff changeset
404
kono
parents: 67
diff changeset
405 set_range_info_raw (name, range_type, min, max);
kono
parents: 67
diff changeset
406 }
kono
parents: 67
diff changeset
407
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
408 /* Store range information for NAME from a value_range. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
409
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
410 void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
411 set_range_info (tree name, const value_range &vr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
412 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
413 wide_int min = wi::to_wide (vr.min ());
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
414 wide_int max = wi::to_wide (vr.max ());
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
415 set_range_info (name, vr.kind (), min, max);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
416 }
111
kono
parents: 67
diff changeset
417
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
418 /* Gets range information MIN, MAX and returns enum value_range_kind
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
419 corresponding to tree ssa_name NAME. enum value_range_kind returned
111
kono
parents: 67
diff changeset
420 is used to determine if MIN and MAX are valid values. */
kono
parents: 67
diff changeset
421
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
422 enum value_range_kind
111
kono
parents: 67
diff changeset
423 get_range_info (const_tree name, wide_int *min, wide_int *max)
kono
parents: 67
diff changeset
424 {
kono
parents: 67
diff changeset
425 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
426 gcc_assert (min && max);
kono
parents: 67
diff changeset
427 range_info_def *ri = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
428
kono
parents: 67
diff changeset
429 /* Return VR_VARYING for SSA_NAMEs with NULL RANGE_INFO or SSA_NAMEs
kono
parents: 67
diff changeset
430 with integral types width > 2 * HOST_BITS_PER_WIDE_INT precision. */
kono
parents: 67
diff changeset
431 if (!ri || (GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (TREE_TYPE (name)))
kono
parents: 67
diff changeset
432 > 2 * HOST_BITS_PER_WIDE_INT))
kono
parents: 67
diff changeset
433 return VR_VARYING;
kono
parents: 67
diff changeset
434
kono
parents: 67
diff changeset
435 *min = ri->get_min ();
kono
parents: 67
diff changeset
436 *max = ri->get_max ();
kono
parents: 67
diff changeset
437 return SSA_NAME_RANGE_TYPE (name);
kono
parents: 67
diff changeset
438 }
kono
parents: 67
diff changeset
439
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
440 /* Gets range information corresponding to ssa_name NAME and stores it
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
441 in a value_range VR. Returns the value_range_kind. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
442
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
443 enum value_range_kind
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
444 get_range_info (const_tree name, value_range &vr)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
445 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
446 tree min, max;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
447 wide_int wmin, wmax;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
448 enum value_range_kind kind = get_range_info (name, &wmin, &wmax);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
449
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
450 if (kind == VR_VARYING)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
451 vr.set_varying (TREE_TYPE (name));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
452 else if (kind == VR_UNDEFINED)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
453 vr.set_undefined ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
454 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
455 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
456 min = wide_int_to_tree (TREE_TYPE (name), wmin);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
457 max = wide_int_to_tree (TREE_TYPE (name), wmax);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
458 vr.set (min, max, kind);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
459 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
460 return kind;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
461 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
462
111
kono
parents: 67
diff changeset
463 /* Set nonnull attribute to pointer NAME. */
kono
parents: 67
diff changeset
464
kono
parents: 67
diff changeset
465 void
kono
parents: 67
diff changeset
466 set_ptr_nonnull (tree name)
kono
parents: 67
diff changeset
467 {
kono
parents: 67
diff changeset
468 gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
469 struct ptr_info_def *pi = get_ptr_info (name);
kono
parents: 67
diff changeset
470 pi->pt.null = 0;
kono
parents: 67
diff changeset
471 }
kono
parents: 67
diff changeset
472
kono
parents: 67
diff changeset
473 /* Return nonnull attribute of pointer NAME. */
kono
parents: 67
diff changeset
474 bool
kono
parents: 67
diff changeset
475 get_ptr_nonnull (const_tree name)
kono
parents: 67
diff changeset
476 {
kono
parents: 67
diff changeset
477 gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
478 struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
kono
parents: 67
diff changeset
479 if (pi == NULL)
kono
parents: 67
diff changeset
480 return false;
kono
parents: 67
diff changeset
481 /* TODO Now pt->null is conservatively set to true in PTA
kono
parents: 67
diff changeset
482 analysis. vrp is the only pass (including ipa-vrp)
kono
parents: 67
diff changeset
483 that clears pt.null via set_ptr_nonull when it knows
kono
parents: 67
diff changeset
484 for sure. PTA will preserves the pt.null value set by VRP.
kono
parents: 67
diff changeset
485
kono
parents: 67
diff changeset
486 When PTA analysis is improved, pt.anything, pt.nonlocal
kono
parents: 67
diff changeset
487 and pt.escaped may also has to be considered before
kono
parents: 67
diff changeset
488 deciding that pointer cannot point to NULL. */
kono
parents: 67
diff changeset
489 return !pi->pt.null;
kono
parents: 67
diff changeset
490 }
kono
parents: 67
diff changeset
491
kono
parents: 67
diff changeset
492 /* Change non-zero bits bitmask of NAME. */
kono
parents: 67
diff changeset
493
kono
parents: 67
diff changeset
494 void
kono
parents: 67
diff changeset
495 set_nonzero_bits (tree name, const wide_int_ref &mask)
kono
parents: 67
diff changeset
496 {
kono
parents: 67
diff changeset
497 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
498 if (SSA_NAME_RANGE_INFO (name) == NULL)
kono
parents: 67
diff changeset
499 {
kono
parents: 67
diff changeset
500 if (mask == -1)
kono
parents: 67
diff changeset
501 return;
kono
parents: 67
diff changeset
502 set_range_info_raw (name, VR_RANGE,
kono
parents: 67
diff changeset
503 wi::to_wide (TYPE_MIN_VALUE (TREE_TYPE (name))),
kono
parents: 67
diff changeset
504 wi::to_wide (TYPE_MAX_VALUE (TREE_TYPE (name))));
kono
parents: 67
diff changeset
505 }
kono
parents: 67
diff changeset
506 range_info_def *ri = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
507 ri->set_nonzero_bits (mask);
kono
parents: 67
diff changeset
508 }
kono
parents: 67
diff changeset
509
kono
parents: 67
diff changeset
510 /* Return a widest_int with potentially non-zero bits in SSA_NAME
kono
parents: 67
diff changeset
511 NAME, the constant for INTEGER_CST, or -1 if unknown. */
kono
parents: 67
diff changeset
512
kono
parents: 67
diff changeset
513 wide_int
kono
parents: 67
diff changeset
514 get_nonzero_bits (const_tree name)
kono
parents: 67
diff changeset
515 {
kono
parents: 67
diff changeset
516 if (TREE_CODE (name) == INTEGER_CST)
kono
parents: 67
diff changeset
517 return wi::to_wide (name);
kono
parents: 67
diff changeset
518
kono
parents: 67
diff changeset
519 /* Use element_precision instead of TYPE_PRECISION so complex and
kono
parents: 67
diff changeset
520 vector types get a non-zero precision. */
kono
parents: 67
diff changeset
521 unsigned int precision = element_precision (TREE_TYPE (name));
kono
parents: 67
diff changeset
522 if (POINTER_TYPE_P (TREE_TYPE (name)))
kono
parents: 67
diff changeset
523 {
kono
parents: 67
diff changeset
524 struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
kono
parents: 67
diff changeset
525 if (pi && pi->align)
kono
parents: 67
diff changeset
526 return wi::shwi (-(HOST_WIDE_INT) pi->align
kono
parents: 67
diff changeset
527 | (HOST_WIDE_INT) pi->misalign, precision);
kono
parents: 67
diff changeset
528 return wi::shwi (-1, precision);
kono
parents: 67
diff changeset
529 }
kono
parents: 67
diff changeset
530
kono
parents: 67
diff changeset
531 range_info_def *ri = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
532 if (!ri)
kono
parents: 67
diff changeset
533 return wi::shwi (-1, precision);
kono
parents: 67
diff changeset
534
kono
parents: 67
diff changeset
535 return ri->get_nonzero_bits ();
kono
parents: 67
diff changeset
536 }
kono
parents: 67
diff changeset
537
kono
parents: 67
diff changeset
538 /* Return TRUE is OP, an SSA_NAME has a range of values [0..1], false
kono
parents: 67
diff changeset
539 otherwise.
kono
parents: 67
diff changeset
540
kono
parents: 67
diff changeset
541 This can be because it is a boolean type, any unsigned integral
kono
parents: 67
diff changeset
542 type with a single bit of precision, or has known range of [0..1]
kono
parents: 67
diff changeset
543 via VRP analysis. */
kono
parents: 67
diff changeset
544
kono
parents: 67
diff changeset
545 bool
kono
parents: 67
diff changeset
546 ssa_name_has_boolean_range (tree op)
kono
parents: 67
diff changeset
547 {
kono
parents: 67
diff changeset
548 gcc_assert (TREE_CODE (op) == SSA_NAME);
kono
parents: 67
diff changeset
549
kono
parents: 67
diff changeset
550 /* Boolean types always have a range [0..1]. */
kono
parents: 67
diff changeset
551 if (TREE_CODE (TREE_TYPE (op)) == BOOLEAN_TYPE)
kono
parents: 67
diff changeset
552 return true;
kono
parents: 67
diff changeset
553
kono
parents: 67
diff changeset
554 /* An integral type with a single bit of precision. */
kono
parents: 67
diff changeset
555 if (INTEGRAL_TYPE_P (TREE_TYPE (op))
kono
parents: 67
diff changeset
556 && TYPE_UNSIGNED (TREE_TYPE (op))
kono
parents: 67
diff changeset
557 && TYPE_PRECISION (TREE_TYPE (op)) == 1)
kono
parents: 67
diff changeset
558 return true;
kono
parents: 67
diff changeset
559
kono
parents: 67
diff changeset
560 /* An integral type with more precision, but the object
kono
parents: 67
diff changeset
561 only takes on values [0..1] as determined by VRP
kono
parents: 67
diff changeset
562 analysis. */
kono
parents: 67
diff changeset
563 if (INTEGRAL_TYPE_P (TREE_TYPE (op))
kono
parents: 67
diff changeset
564 && (TYPE_PRECISION (TREE_TYPE (op)) > 1)
kono
parents: 67
diff changeset
565 && wi::eq_p (get_nonzero_bits (op), 1))
kono
parents: 67
diff changeset
566 return true;
kono
parents: 67
diff changeset
567
kono
parents: 67
diff changeset
568 return false;
kono
parents: 67
diff changeset
569 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 /* We no longer need the SSA_NAME expression VAR, release it so that
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
572 it may be reused.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 Note it is assumed that no calls to make_ssa_name will be made
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 until all uses of the ssa name are released and that the only
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 use of the SSA_NAME expression is to check its SSA_NAME_VAR. All
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577 other fields must be assumed clobbered. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 void
111
kono
parents: 67
diff changeset
580 release_ssa_name_fn (struct function *fn, tree var)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 if (!var)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583 return;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 /* Never release the default definition for a symbol. It's a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
586 special SSA name that should always exist once it's created. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 if (SSA_NAME_IS_DEFAULT_DEF (var))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 return;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
590 /* If VAR has been registered for SSA updating, don't remove it.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 After update_ssa has run, the name will be released. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
592 if (name_registered_for_update_p (var))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
593 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
594 release_ssa_name_after_update_ssa (var);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 return;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
596 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
597
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
598 /* release_ssa_name can be called multiple times on a single SSA_NAME.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 However, it should only end up on our free list one time. We
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 keep a status bit in the SSA_NAME node itself to indicate it has
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
601 been put on the free list.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
603 Note that once on the freelist you cannot reference the SSA_NAME's
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 defining statement. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 if (! SSA_NAME_IN_FREE_LIST (var))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607 int saved_ssa_name_version = SSA_NAME_VERSION (var);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 use_operand_p imm = &(SSA_NAME_IMM_USE_NODE (var));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
610 if (MAY_HAVE_DEBUG_BIND_STMTS)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
611 insert_debug_temp_for_var_def (NULL, var);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
612
111
kono
parents: 67
diff changeset
613 if (flag_checking)
kono
parents: 67
diff changeset
614 verify_imm_links (stderr, var);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 while (imm->next != imm)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
616 delink_imm_use (imm->next);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617
111
kono
parents: 67
diff changeset
618 (*SSANAMES (fn))[SSA_NAME_VERSION (var)] = NULL_TREE;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
619 memset (var, 0, tree_size (var));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
620
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
621 imm->prev = imm;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 imm->next = imm;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
623 imm->loc.ssa_name = var;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 /* First put back the right tree node so that the tree checking
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 macros do not complain. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
627 TREE_SET_CODE (var, SSA_NAME);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
628
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 /* Restore the version number. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 SSA_NAME_VERSION (var) = saved_ssa_name_version;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
631
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632 /* Note this SSA_NAME is now in the first list. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 SSA_NAME_IN_FREE_LIST (var) = 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
635 /* Put in a non-NULL TREE_TYPE so dumping code will not ICE
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
636 if it happens to come along a released SSA name and tries
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
637 to inspect its type. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
638 TREE_TYPE (var) = error_mark_node;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
639
111
kono
parents: 67
diff changeset
640 /* And finally queue it so that it will be put on the free list. */
kono
parents: 67
diff changeset
641 vec_safe_push (FREE_SSANAMES_QUEUE (fn), var);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644
111
kono
parents: 67
diff changeset
645 /* If the alignment of the pointer described by PI is known, return true and
kono
parents: 67
diff changeset
646 store the alignment and the deviation from it into *ALIGNP and *MISALIGNP
kono
parents: 67
diff changeset
647 respectively. Otherwise return false. */
kono
parents: 67
diff changeset
648
kono
parents: 67
diff changeset
649 bool
kono
parents: 67
diff changeset
650 get_ptr_info_alignment (struct ptr_info_def *pi, unsigned int *alignp,
kono
parents: 67
diff changeset
651 unsigned int *misalignp)
kono
parents: 67
diff changeset
652 {
kono
parents: 67
diff changeset
653 if (pi->align)
kono
parents: 67
diff changeset
654 {
kono
parents: 67
diff changeset
655 *alignp = pi->align;
kono
parents: 67
diff changeset
656 *misalignp = pi->misalign;
kono
parents: 67
diff changeset
657 return true;
kono
parents: 67
diff changeset
658 }
kono
parents: 67
diff changeset
659 else
kono
parents: 67
diff changeset
660 return false;
kono
parents: 67
diff changeset
661 }
kono
parents: 67
diff changeset
662
kono
parents: 67
diff changeset
663 /* State that the pointer described by PI has unknown alignment. */
kono
parents: 67
diff changeset
664
kono
parents: 67
diff changeset
665 void
kono
parents: 67
diff changeset
666 mark_ptr_info_alignment_unknown (struct ptr_info_def *pi)
kono
parents: 67
diff changeset
667 {
kono
parents: 67
diff changeset
668 pi->align = 0;
kono
parents: 67
diff changeset
669 pi->misalign = 0;
kono
parents: 67
diff changeset
670 }
kono
parents: 67
diff changeset
671
kono
parents: 67
diff changeset
672 /* Store the power-of-two byte alignment and the deviation from that
kono
parents: 67
diff changeset
673 alignment of pointer described by PI to ALIOGN and MISALIGN
kono
parents: 67
diff changeset
674 respectively. */
kono
parents: 67
diff changeset
675
kono
parents: 67
diff changeset
676 void
kono
parents: 67
diff changeset
677 set_ptr_info_alignment (struct ptr_info_def *pi, unsigned int align,
kono
parents: 67
diff changeset
678 unsigned int misalign)
kono
parents: 67
diff changeset
679 {
kono
parents: 67
diff changeset
680 gcc_checking_assert (align != 0);
kono
parents: 67
diff changeset
681 gcc_assert ((align & (align - 1)) == 0);
kono
parents: 67
diff changeset
682 gcc_assert ((misalign & ~(align - 1)) == 0);
kono
parents: 67
diff changeset
683
kono
parents: 67
diff changeset
684 pi->align = align;
kono
parents: 67
diff changeset
685 pi->misalign = misalign;
kono
parents: 67
diff changeset
686 }
kono
parents: 67
diff changeset
687
kono
parents: 67
diff changeset
688 /* If pointer described by PI has known alignment, increase its known
kono
parents: 67
diff changeset
689 misalignment by INCREMENT modulo its current alignment. */
kono
parents: 67
diff changeset
690
kono
parents: 67
diff changeset
691 void
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
692 adjust_ptr_info_misalignment (struct ptr_info_def *pi, poly_uint64 increment)
111
kono
parents: 67
diff changeset
693 {
kono
parents: 67
diff changeset
694 if (pi->align != 0)
kono
parents: 67
diff changeset
695 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
696 increment += pi->misalign;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
697 if (!known_misalignment (increment, pi->align, &pi->misalign))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
698 {
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
699 pi->align = known_alignment (increment);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
700 pi->misalign = 0;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
701 }
111
kono
parents: 67
diff changeset
702 }
kono
parents: 67
diff changeset
703 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
705 /* Return the alias information associated with pointer T. It creates a
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
706 new instance if none existed. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
707
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
708 struct ptr_info_def *
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
709 get_ptr_info (tree t)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
711 struct ptr_info_def *pi;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
712
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
713 gcc_assert (POINTER_TYPE_P (TREE_TYPE (t)));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
714
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
715 pi = SSA_NAME_PTR_INFO (t);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
716 if (pi == NULL)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
717 {
111
kono
parents: 67
diff changeset
718 pi = ggc_cleared_alloc<ptr_info_def> ();
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
719 pt_solution_reset (&pi->pt);
111
kono
parents: 67
diff changeset
720 mark_ptr_info_alignment_unknown (pi);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
721 SSA_NAME_PTR_INFO (t) = pi;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
722 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
723
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
724 return pi;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
726
111
kono
parents: 67
diff changeset
727
kono
parents: 67
diff changeset
728 /* Creates a new SSA name using the template NAME tobe defined by
kono
parents: 67
diff changeset
729 statement STMT in function FN. */
kono
parents: 67
diff changeset
730
kono
parents: 67
diff changeset
731 tree
kono
parents: 67
diff changeset
732 copy_ssa_name_fn (struct function *fn, tree name, gimple *stmt)
kono
parents: 67
diff changeset
733 {
kono
parents: 67
diff changeset
734 tree new_name;
kono
parents: 67
diff changeset
735
kono
parents: 67
diff changeset
736 if (SSA_NAME_VAR (name))
kono
parents: 67
diff changeset
737 new_name = make_ssa_name_fn (fn, SSA_NAME_VAR (name), stmt);
kono
parents: 67
diff changeset
738 else
kono
parents: 67
diff changeset
739 {
kono
parents: 67
diff changeset
740 new_name = make_ssa_name_fn (fn, TREE_TYPE (name), stmt);
kono
parents: 67
diff changeset
741 SET_SSA_NAME_VAR_OR_IDENTIFIER (new_name, SSA_NAME_IDENTIFIER (name));
kono
parents: 67
diff changeset
742 }
kono
parents: 67
diff changeset
743
kono
parents: 67
diff changeset
744 return new_name;
kono
parents: 67
diff changeset
745 }
kono
parents: 67
diff changeset
746
kono
parents: 67
diff changeset
747
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
748 /* Creates a duplicate of the ptr_info_def at PTR_INFO for use by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
749 the SSA name NAME. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
750
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
751 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
752 duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
753 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
754 struct ptr_info_def *new_ptr_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
755
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
756 gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
757 gcc_assert (!SSA_NAME_PTR_INFO (name));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
758
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 if (!ptr_info)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
760 return;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
761
111
kono
parents: 67
diff changeset
762 new_ptr_info = ggc_alloc<ptr_info_def> ();
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
763 *new_ptr_info = *ptr_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
764
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
765 SSA_NAME_PTR_INFO (name) = new_ptr_info;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
766 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
767
111
kono
parents: 67
diff changeset
768 /* Creates a duplicate of the range_info_def at RANGE_INFO of type
kono
parents: 67
diff changeset
769 RANGE_TYPE for use by the SSA name NAME. */
kono
parents: 67
diff changeset
770 void
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
771 duplicate_ssa_name_range_info (tree name, enum value_range_kind range_type,
111
kono
parents: 67
diff changeset
772 struct range_info_def *range_info)
kono
parents: 67
diff changeset
773 {
kono
parents: 67
diff changeset
774 struct range_info_def *new_range_info;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
775
111
kono
parents: 67
diff changeset
776 gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
kono
parents: 67
diff changeset
777 gcc_assert (!SSA_NAME_RANGE_INFO (name));
kono
parents: 67
diff changeset
778
kono
parents: 67
diff changeset
779 if (!range_info)
kono
parents: 67
diff changeset
780 return;
kono
parents: 67
diff changeset
781
kono
parents: 67
diff changeset
782 unsigned int precision = TYPE_PRECISION (TREE_TYPE (name));
kono
parents: 67
diff changeset
783 size_t size = (sizeof (range_info_def)
kono
parents: 67
diff changeset
784 + trailing_wide_ints <3>::extra_size (precision));
kono
parents: 67
diff changeset
785 new_range_info = static_cast<range_info_def *> (ggc_internal_alloc (size));
kono
parents: 67
diff changeset
786 memcpy (new_range_info, range_info, size);
kono
parents: 67
diff changeset
787
kono
parents: 67
diff changeset
788 gcc_assert (range_type == VR_RANGE || range_type == VR_ANTI_RANGE);
kono
parents: 67
diff changeset
789 SSA_NAME_ANTI_RANGE_P (name) = (range_type == VR_ANTI_RANGE);
kono
parents: 67
diff changeset
790 SSA_NAME_RANGE_INFO (name) = new_range_info;
kono
parents: 67
diff changeset
791 }
kono
parents: 67
diff changeset
792
kono
parents: 67
diff changeset
793
kono
parents: 67
diff changeset
794
kono
parents: 67
diff changeset
795 /* Creates a duplicate of a ssa name NAME tobe defined by statement STMT
kono
parents: 67
diff changeset
796 in function FN. */
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
797
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
798 tree
111
kono
parents: 67
diff changeset
799 duplicate_ssa_name_fn (struct function *fn, tree name, gimple *stmt)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
800 {
111
kono
parents: 67
diff changeset
801 tree new_name = copy_ssa_name_fn (fn, name, stmt);
kono
parents: 67
diff changeset
802 if (POINTER_TYPE_P (TREE_TYPE (name)))
kono
parents: 67
diff changeset
803 {
kono
parents: 67
diff changeset
804 struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
805
111
kono
parents: 67
diff changeset
806 if (old_ptr_info)
kono
parents: 67
diff changeset
807 duplicate_ssa_name_ptr_info (new_name, old_ptr_info);
kono
parents: 67
diff changeset
808 }
kono
parents: 67
diff changeset
809 else
kono
parents: 67
diff changeset
810 {
kono
parents: 67
diff changeset
811 struct range_info_def *old_range_info = SSA_NAME_RANGE_INFO (name);
kono
parents: 67
diff changeset
812
kono
parents: 67
diff changeset
813 if (old_range_info)
kono
parents: 67
diff changeset
814 duplicate_ssa_name_range_info (new_name, SSA_NAME_RANGE_TYPE (name),
kono
parents: 67
diff changeset
815 old_range_info);
kono
parents: 67
diff changeset
816 }
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
817
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
818 return new_name;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
819 }
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
820
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
821
111
kono
parents: 67
diff changeset
822 /* Reset all flow sensitive data on NAME such as range-info, nonzero
kono
parents: 67
diff changeset
823 bits and alignment. */
kono
parents: 67
diff changeset
824
kono
parents: 67
diff changeset
825 void
kono
parents: 67
diff changeset
826 reset_flow_sensitive_info (tree name)
kono
parents: 67
diff changeset
827 {
kono
parents: 67
diff changeset
828 if (POINTER_TYPE_P (TREE_TYPE (name)))
kono
parents: 67
diff changeset
829 {
kono
parents: 67
diff changeset
830 /* points-to info is not flow-sensitive. */
kono
parents: 67
diff changeset
831 if (SSA_NAME_PTR_INFO (name))
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
832 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
833 /* [E]VRP can derive context sensitive alignment info and
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
834 non-nullness properties. We must reset both. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
835 mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
836 SSA_NAME_PTR_INFO (name)->pt.null = 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
837 }
111
kono
parents: 67
diff changeset
838 }
kono
parents: 67
diff changeset
839 else
kono
parents: 67
diff changeset
840 SSA_NAME_RANGE_INFO (name) = NULL;
kono
parents: 67
diff changeset
841 }
kono
parents: 67
diff changeset
842
kono
parents: 67
diff changeset
843 /* Clear all flow sensitive data from all statements and PHI definitions
kono
parents: 67
diff changeset
844 in BB. */
kono
parents: 67
diff changeset
845
kono
parents: 67
diff changeset
846 void
kono
parents: 67
diff changeset
847 reset_flow_sensitive_info_in_bb (basic_block bb)
kono
parents: 67
diff changeset
848 {
kono
parents: 67
diff changeset
849 for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
kono
parents: 67
diff changeset
850 gsi_next (&gsi))
kono
parents: 67
diff changeset
851 {
kono
parents: 67
diff changeset
852 gimple *stmt = gsi_stmt (gsi);
kono
parents: 67
diff changeset
853 ssa_op_iter i;
kono
parents: 67
diff changeset
854 tree op;
kono
parents: 67
diff changeset
855 FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_DEF)
kono
parents: 67
diff changeset
856 reset_flow_sensitive_info (op);
kono
parents: 67
diff changeset
857 }
kono
parents: 67
diff changeset
858
kono
parents: 67
diff changeset
859 for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
kono
parents: 67
diff changeset
860 gsi_next (&gsi))
kono
parents: 67
diff changeset
861 {
kono
parents: 67
diff changeset
862 tree phi_def = gimple_phi_result (gsi.phi ());
kono
parents: 67
diff changeset
863 reset_flow_sensitive_info (phi_def);
kono
parents: 67
diff changeset
864 }
kono
parents: 67
diff changeset
865 }
kono
parents: 67
diff changeset
866
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
867 /* Release all the SSA_NAMEs created by STMT. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
868
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
869 void
111
kono
parents: 67
diff changeset
870 release_defs (gimple *stmt)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
871 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
872 tree def;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
873 ssa_op_iter iter;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
874
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
875 FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
876 if (TREE_CODE (def) == SSA_NAME)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
877 release_ssa_name (def);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
878 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
879
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
880
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
881 /* Replace the symbol associated with SSA_NAME with SYM. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
882
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
883 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
884 replace_ssa_name_symbol (tree ssa_name, tree sym)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
885 {
111
kono
parents: 67
diff changeset
886 SET_SSA_NAME_VAR_OR_IDENTIFIER (ssa_name, sym);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
887 TREE_TYPE (ssa_name) = TREE_TYPE (sym);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
888 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
889
111
kono
parents: 67
diff changeset
890 /* Release the vector of free SSA_NAMEs and compact the vector of SSA_NAMEs
kono
parents: 67
diff changeset
891 that are live. */
kono
parents: 67
diff changeset
892
kono
parents: 67
diff changeset
893 static void
kono
parents: 67
diff changeset
894 release_free_names_and_compact_live_names (function *fun)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
895 {
111
kono
parents: 67
diff changeset
896 unsigned i, j;
kono
parents: 67
diff changeset
897 int n = vec_safe_length (FREE_SSANAMES (fun));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
898
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
899 /* Now release the freelist. */
111
kono
parents: 67
diff changeset
900 vec_free (FREE_SSANAMES (fun));
kono
parents: 67
diff changeset
901
kono
parents: 67
diff changeset
902 /* And compact the SSA number space. We make sure to not change the
kono
parents: 67
diff changeset
903 relative order of SSA versions. */
kono
parents: 67
diff changeset
904 for (i = 1, j = 1; i < fun->gimple_df->ssa_names->length (); ++i)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
905 {
111
kono
parents: 67
diff changeset
906 tree name = ssa_name (i);
kono
parents: 67
diff changeset
907 if (name)
kono
parents: 67
diff changeset
908 {
kono
parents: 67
diff changeset
909 if (i != j)
kono
parents: 67
diff changeset
910 {
kono
parents: 67
diff changeset
911 SSA_NAME_VERSION (name) = j;
kono
parents: 67
diff changeset
912 (*fun->gimple_df->ssa_names)[j] = name;
kono
parents: 67
diff changeset
913 }
kono
parents: 67
diff changeset
914 j++;
kono
parents: 67
diff changeset
915 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
916 }
111
kono
parents: 67
diff changeset
917 fun->gimple_df->ssa_names->truncate (j);
kono
parents: 67
diff changeset
918
kono
parents: 67
diff changeset
919 statistics_counter_event (fun, "SSA names released", n);
kono
parents: 67
diff changeset
920 statistics_counter_event (fun, "SSA name holes removed", i - j);
kono
parents: 67
diff changeset
921 if (dump_file)
kono
parents: 67
diff changeset
922 fprintf (dump_file, "Released %i names, %.2f%%, removed %i holes\n",
kono
parents: 67
diff changeset
923 n, n * 100.0 / num_ssa_names, i - j);
kono
parents: 67
diff changeset
924 }
kono
parents: 67
diff changeset
925
kono
parents: 67
diff changeset
926 /* Return SSA names that are unused to GGC memory and compact the SSA
kono
parents: 67
diff changeset
927 version namespace. This is used to keep footprint of compiler during
kono
parents: 67
diff changeset
928 interprocedural optimization. */
kono
parents: 67
diff changeset
929
kono
parents: 67
diff changeset
930 namespace {
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
931
111
kono
parents: 67
diff changeset
932 const pass_data pass_data_release_ssa_names =
kono
parents: 67
diff changeset
933 {
kono
parents: 67
diff changeset
934 GIMPLE_PASS, /* type */
kono
parents: 67
diff changeset
935 "release_ssa", /* name */
kono
parents: 67
diff changeset
936 OPTGROUP_NONE, /* optinfo_flags */
kono
parents: 67
diff changeset
937 TV_TREE_SSA_OTHER, /* tv_id */
kono
parents: 67
diff changeset
938 PROP_ssa, /* properties_required */
kono
parents: 67
diff changeset
939 0, /* properties_provided */
kono
parents: 67
diff changeset
940 0, /* properties_destroyed */
kono
parents: 67
diff changeset
941 TODO_remove_unused_locals, /* todo_flags_start */
kono
parents: 67
diff changeset
942 0, /* todo_flags_finish */
kono
parents: 67
diff changeset
943 };
kono
parents: 67
diff changeset
944
kono
parents: 67
diff changeset
945 class pass_release_ssa_names : public gimple_opt_pass
kono
parents: 67
diff changeset
946 {
kono
parents: 67
diff changeset
947 public:
kono
parents: 67
diff changeset
948 pass_release_ssa_names (gcc::context *ctxt)
kono
parents: 67
diff changeset
949 : gimple_opt_pass (pass_data_release_ssa_names, ctxt)
kono
parents: 67
diff changeset
950 {}
kono
parents: 67
diff changeset
951
kono
parents: 67
diff changeset
952 /* opt_pass methods: */
kono
parents: 67
diff changeset
953 virtual unsigned int execute (function *);
kono
parents: 67
diff changeset
954
kono
parents: 67
diff changeset
955 }; // class pass_release_ssa_names
kono
parents: 67
diff changeset
956
kono
parents: 67
diff changeset
957 unsigned int
kono
parents: 67
diff changeset
958 pass_release_ssa_names::execute (function *fun)
kono
parents: 67
diff changeset
959 {
kono
parents: 67
diff changeset
960 release_free_names_and_compact_live_names (fun);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
961 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
962 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
963
111
kono
parents: 67
diff changeset
964 } // anon namespace
kono
parents: 67
diff changeset
965
kono
parents: 67
diff changeset
966 gimple_opt_pass *
kono
parents: 67
diff changeset
967 make_pass_release_ssa_names (gcc::context *ctxt)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
968 {
111
kono
parents: 67
diff changeset
969 return new pass_release_ssa_names (ctxt);
kono
parents: 67
diff changeset
970 }