annotate gcc/tree-outof-ssa.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 /* Routines for expanding from SSA form to RTL.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2009-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
kono
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
14 GNU General Public License 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
kono
parents:
diff changeset
21 #ifndef GCC_TREE_OUTOF_SSA_H
kono
parents:
diff changeset
22 #define GCC_TREE_OUTOF_SSA_H
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* This structure (of which only a singleton SA exists) is used to
kono
parents:
diff changeset
26 pass around information between the outof-SSA functions, cfgexpand
kono
parents:
diff changeset
27 and expand itself. */
kono
parents:
diff changeset
28 struct ssaexpand
kono
parents:
diff changeset
29 {
kono
parents:
diff changeset
30 /* The computed partitions of SSA names are stored here. */
kono
parents:
diff changeset
31 var_map map;
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 /* For an SSA name version V bit V is set iff TER decided that
kono
parents:
diff changeset
34 its definition should be forwarded. */
kono
parents:
diff changeset
35 bitmap values;
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* For a partition number I partition_to_pseudo[I] contains the
kono
parents:
diff changeset
38 RTL expression of the allocated space of it (either a MEM or
kono
parents:
diff changeset
39 a pseudos REG). */
kono
parents:
diff changeset
40 rtx *partition_to_pseudo;
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* If partition I contains an SSA name that has a default def for a
kono
parents:
diff changeset
43 parameter, bit I will be set in this bitmap. */
kono
parents:
diff changeset
44 bitmap partitions_for_parm_default_defs;
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* If partition I contains an SSA name that has an undefined value,
kono
parents:
diff changeset
47 bit I will be set in this bitmap. */
kono
parents:
diff changeset
48 bitmap partitions_for_undefined_values;
kono
parents:
diff changeset
49 };
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 /* This is the singleton described above. */
kono
parents:
diff changeset
52 extern struct ssaexpand SA;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* Returns the RTX expression representing the storage of the outof-SSA
kono
parents:
diff changeset
55 partition that the SSA name EXP is a member of. */
kono
parents:
diff changeset
56 static inline rtx
kono
parents:
diff changeset
57 get_rtx_for_ssa_name (tree exp)
kono
parents:
diff changeset
58 {
kono
parents:
diff changeset
59 int p = partition_find (SA.map->var_partition, SSA_NAME_VERSION (exp));
kono
parents:
diff changeset
60 if (SA.map->partition_to_view)
kono
parents:
diff changeset
61 p = SA.map->partition_to_view[p];
kono
parents:
diff changeset
62 gcc_assert (p != NO_PARTITION);
kono
parents:
diff changeset
63 return SA.partition_to_pseudo[p];
kono
parents:
diff changeset
64 }
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /* If TER decided to forward the definition of SSA name EXP this function
kono
parents:
diff changeset
67 returns the defining statement, otherwise NULL. */
kono
parents:
diff changeset
68 static inline gimple *
kono
parents:
diff changeset
69 get_gimple_for_ssa_name (tree exp)
kono
parents:
diff changeset
70 {
kono
parents:
diff changeset
71 int v = SSA_NAME_VERSION (exp);
kono
parents:
diff changeset
72 if (SA.values && bitmap_bit_p (SA.values, v))
kono
parents:
diff changeset
73 return SSA_NAME_DEF_STMT (exp);
kono
parents:
diff changeset
74 return NULL;
kono
parents:
diff changeset
75 }
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 extern bool ssa_is_replaceable_p (gimple *stmt);
kono
parents:
diff changeset
78 extern void finish_out_of_ssa (struct ssaexpand *sa);
kono
parents:
diff changeset
79 extern unsigned int rewrite_out_of_ssa (struct ssaexpand *sa);
kono
parents:
diff changeset
80 extern void expand_phi_nodes (struct ssaexpand *sa);
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 #endif /* GCC_TREE_OUTOF_SSA_H */