GCC Middle and Back End API Reference
tree-outof-ssa.h
Go to the documentation of this file.
1/* Routines for expanding from SSA form to RTL.
2 Copyright (C) 2009-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20
21#ifndef GCC_TREE_OUTOF_SSA_H
22#define GCC_TREE_OUTOF_SSA_H
23
24
25/* This structure (of which only a singleton SA exists) is used to
26 pass around information between the outof-SSA functions, cfgexpand
27 and expand itself. */
29{
30 /* The computed partitions of SSA names are stored here. */
32
33 /* For an SSA name version V bit V is set iff TER decided that
34 its definition should be forwarded. */
36
37 /* For an SSA name version V bit V is set iff conditional-compare
38 recognition found no explicit comparison that can be folded. */
40
41 /* For a partition number I partition_to_pseudo[I] contains the
42 RTL expression of the allocated space of it (either a MEM or
43 a pseudos REG). */
45
46 /* If partition I contains an SSA name that has a default def for a
47 parameter, bit I will be set in this bitmap. */
49
50 /* If partition I contains an SSA name that has an undefined value,
51 bit I will be set in this bitmap. */
53};
54
55/* This is the singleton described above. */
56extern struct ssaexpand SA;
57
58/* Returns the RTX expression representing the storage of the outof-SSA
59 partition that the SSA name EXP is a member of. */
60inline rtx
62{
63 int p = partition_find (SA.map->var_partition, SSA_NAME_VERSION (exp));
65 p = SA.map->partition_to_view[p];
67 return SA.partition_to_pseudo[p];
68}
69
70/* If TER decided to forward the definition of SSA name EXP this function
71 returns the defining statement, otherwise NULL. */
72inline gimple *
74{
75 int v = SSA_NAME_VERSION (exp);
76 if (SA.values && bitmap_bit_p (SA.values, v))
77 return SSA_NAME_DEF_STMT (exp);
78 return NULL;
79}
80
81extern bool ssa_is_replaceable_p (gimple *stmt);
82extern void finish_out_of_ssa (struct ssaexpand *sa);
83extern unsigned int rewrite_out_of_ssa (struct ssaexpand *sa);
84extern void remove_gimple_phi_args (gphi *phi);
85extern void expand_phi_nodes (struct ssaexpand *sa);
86
87#endif /* GCC_TREE_OUTOF_SSA_H */
struct ssaexpand SA
Definition cfgexpand.cc:90
struct rtx_def * rtx
Definition coretypes.h:57
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
double exp(double)
#define bitmap_bit_p(bitstring, bitno)
Definition genautomata.cc:3429
partition var_partition
Definition tree-ssa-live.h:48
int * partition_to_view
Definition tree-ssa-live.h:51
Definition gimple.h:224
Definition gimple.h:464
Definition tree-outof-ssa.h:29
bitmap partitions_for_undefined_values
Definition tree-outof-ssa.h:52
bitmap ccmp_no_comparison
Definition tree-outof-ssa.h:39
bitmap values
Definition tree-outof-ssa.h:35
bitmap partitions_for_parm_default_defs
Definition tree-outof-ssa.h:48
rtx * partition_to_pseudo
Definition tree-outof-ssa.h:44
var_map map
Definition tree-outof-ssa.h:31
#define NULL
Definition system.h:55
#define gcc_assert(EXPR)
Definition system.h:772
unsigned int rewrite_out_of_ssa(struct ssaexpand *sa)
Definition tree-outof-ssa.cc:1505
bool ssa_is_replaceable_p(gimple *stmt)
Definition tree-outof-ssa.cc:61
void remove_gimple_phi_args(gphi *phi)
Definition tree-outof-ssa.cc:797
void expand_phi_nodes(struct ssaexpand *sa)
Definition tree-outof-ssa.cc:1014
void finish_out_of_ssa(struct ssaexpand *sa)
Definition tree-outof-ssa.cc:1487
gimple * get_gimple_for_ssa_name(tree exp)
Definition tree-outof-ssa.h:73
rtx get_rtx_for_ssa_name(tree exp)
Definition tree-outof-ssa.h:61
#define NO_PARTITION
Definition tree-ssa-live.h:85
struct _var_map * var_map
#define SSA_NAME_DEF_STMT(NODE)
Definition tree.h:2292
#define SSA_NAME_VERSION(NODE)
Definition tree.h:2296