GCC Middle and Back End API Reference
tree-ssa.h
Go to the documentation of this file.
1/* Header file for any pass which requires SSA routines.
2 Copyright (C) 2013-2024 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 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#ifndef GCC_TREE_SSA_H
21#define GCC_TREE_SSA_H
22
23/* Mapping for redirected edges. */
25 tree result; /* PHI result. */
26 tree def; /* PHI arg definition. */
27 location_t locus; /* PHI arg location. */
28};
29
30/* A vector of var maps. */
32
33
34extern void redirect_edge_var_map_add (edge, tree, tree, location_t);
38extern void redirect_edge_var_map_empty (void);
40extern void flush_pending_stmts (edge);
41extern void gimple_replace_ssa_lhs (gimple *, tree);
45extern void reset_debug_uses (gimple *);
46extern void release_defs_bitset (bitmap toremove);
47extern void verify_ssa (bool, bool);
48extern void init_tree_ssa (function *, int size = 0);
49extern void delete_tree_ssa (function *);
52extern tree find_released_ssa_name (tree *, int *, void *);
53
54
55extern bool ssa_defined_default_def_p (tree t);
56extern bool ssa_undefined_value_p (tree, bool = true);
57
58
60extern void mark_ssa_maybe_undefs (void);
61
62/* Return TRUE iff VAR is marked as maybe-undefined. See
63 mark_ssa_maybe_undefs. */
64
65inline bool
67{
68 gcc_checking_assert (TREE_CODE (var) == SSA_NAME);
69 return TREE_VISITED (var);
70}
71
72/* Set (or clear, depending on VALUE) VAR's maybe-undefined mark. */
73
74inline void
75ssa_name_set_maybe_undef (tree var, bool value = true)
76{
77 gcc_checking_assert (TREE_CODE (var) == SSA_NAME);
78 TREE_VISITED (var) = value;
79}
80
81
82extern void execute_update_addresses_taken (void);
83
84/* Given an edge_var_map V, return the PHI arg definition. */
85
86inline tree
88{
89 return v->def;
90}
91
92/* Given an edge_var_map V, return the PHI result. */
93
94inline tree
99
100/* Given an edge_var_map V, return the PHI arg location. */
101
102inline location_t
107
108/* Verify SSA invariants, if internal consistency checks are enabled. */
109
110inline void
111checking_verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
112{
113 if (flag_checking)
114 verify_ssa (check_modified_stmt, check_ssa_operands);
115}
116
117#endif /* GCC_TREE_SSA_H */
class edge_def * edge
Definition coretypes.h:352
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
Definition basic-block.h:117
Definition tree-ssa.h:24
tree def
Definition tree-ssa.h:26
location_t locus
Definition tree-ssa.h:27
tree result
Definition tree-ssa.h:25
Definition function.h:249
Definition gimple-iterator.h:26
Definition gimple.h:221
Definition vec.h:450
#define gcc_checking_assert(EXPR)
Definition system.h:828
location_t redirect_edge_var_map_location(edge_var_map *v)
Definition tree-ssa.h:103
bool ssa_defined_default_def_p(tree t)
Definition tree-ssa.cc:1289
void flush_pending_stmts(edge)
Definition tree-ssa.cc:177
void insert_debug_temps_for_defs(gimple_stmt_iterator *)
Definition tree-ssa.cc:489
edge ssa_redirect_edge(edge, basic_block)
Definition tree-ssa.cc:141
void redirect_edge_var_map_add(edge, tree, tree, location_t)
Definition tree-ssa.cc:56
void gimple_replace_ssa_lhs(gimple *, tree)
Definition tree-ssa.cc:222
bool ssa_name_any_use_dominates_bb_p(tree var, basic_block bb)
Definition tree-ssa.cc:1389
void verify_ssa(bool, bool)
Definition tree-ssa.cc:1039
tree target_for_debug_bind(tree)
Definition tree-ssa.cc:244
void delete_tree_ssa(function *)
Definition tree-ssa.cc:1227
bool ssa_undefined_value_p(tree, bool=true)
Definition tree-ssa.cc:1314
tree redirect_edge_var_map_result(edge_var_map *v)
Definition tree-ssa.h:95
void insert_debug_temp_for_var_def(gimple_stmt_iterator *, tree)
Definition tree-ssa.cc:302
void redirect_edge_var_map_clear(edge)
Definition tree-ssa.cc:75
vec< edge_var_map, va_heap, vl_embed > edge_var_map_vector
Definition tree-ssa.h:31
bool ssa_name_maybe_undef_p(tree var)
Definition tree-ssa.h:66
vec< edge_var_map > * redirect_edge_var_map_vector(edge)
Definition tree-ssa.cc:112
void checking_verify_ssa(bool check_modified_stmt, bool check_ssa_operands)
Definition tree-ssa.h:111
void execute_update_addresses_taken(void)
Definition tree-ssa.cc:1861
tree find_released_ssa_name(tree *, int *, void *)
Definition tree-ssa.cc:277
void redirect_edge_var_map_empty(void)
Definition tree-ssa.cc:128
tree redirect_edge_var_map_def(edge_var_map *v)
Definition tree-ssa.h:87
void release_defs_bitset(bitmap toremove)
Definition tree-ssa.cc:547
void init_tree_ssa(function *, int size=0)
Definition tree-ssa.cc:1215
bool tree_ssa_useless_type_conversion(tree)
Definition tree-ssa.cc:1252
tree tree_ssa_strip_useless_type_conversions(tree)
Definition tree-ssa.cc:1279
void ssa_name_set_maybe_undef(tree var, bool value=true)
Definition tree-ssa.h:75
void reset_debug_uses(gimple *)
Definition tree-ssa.cc:514
void redirect_edge_var_map_dup(edge, edge)
Definition tree-ssa.cc:94
void mark_ssa_maybe_undefs(void)
Definition tree-ssa.cc:1410
#define TREE_CODE(NODE)
Definition tree.h:324
#define TREE_VISITED(NODE)
Definition tree.h:2450