GCC Middle and Back End API Reference
value-pointer-equiv.h
Go to the documentation of this file.
1/* Header file for the context-aware pointer equivalence tracker.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 Contributed by Aldy Hernandez <aldyh@redhat.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_VALUE_POINTER_EQUIV_H
22#define GCC_VALUE_POINTER_EQUIV_H
23
24// Simple context-aware pointer equivalency analyzer that returns what
25// a pointer SSA name is equivalent to at a given point during a walk
26// of the IL.
27//
28// Note that global equivalency take priority over conditional
29// equivalency. That is, p = &q takes priority over a later p == &t.
30//
31// This class is meant to be called during a DOM walk.
32
34{
35public:
38 void enter (basic_block);
39 void leave (basic_block);
40 void visit_stmt (gimple *stmt);
41 tree get_equiv (tree ssa);
42
43private:
44 void visit_edge (edge e);
46 void set_global_equiv (tree ssa, tree pointee);
47 void set_cond_equiv (tree ssa, tree pointee);
48
50 // Global pointer equivalency indexed by SSA_NAME_VERSION.
52 // Conditional pointer equivalency.
54};
55
56inline bool
61
62#endif // GCC_VALUE_POINTER_EQUIV_H
Definition vec.h:1656
Definition genmatch.cc:1496
Definition gimple-range.h:48
Definition value-pointer-equiv.h:34
void visit_stmt(gimple *stmt)
Definition value-pointer-equiv.cc:268
void leave(basic_block)
Definition value-pointer-equiv.cc:220
class ssa_equiv_stack * m_cond_points
Definition value-pointer-equiv.h:53
tree get_equiv(tree ssa)
Definition value-pointer-equiv.cc:162
gimple_ranger * m_ranger
Definition value-pointer-equiv.h:49
auto_vec< tree > m_global_points
Definition value-pointer-equiv.h:51
void visit_edge(edge e)
Definition value-pointer-equiv.cc:303
void set_cond_equiv(tree ssa, tree pointee)
Definition value-pointer-equiv.cc:152
void enter(basic_block)
Definition value-pointer-equiv.cc:178
pointer_equiv_analyzer(gimple_ranger *r)
Definition value-pointer-equiv.cc:124
tree get_equiv_expr(tree_code code, tree expr)
Definition value-pointer-equiv.cc:232
~pointer_equiv_analyzer()
Definition value-pointer-equiv.cc:131
void set_global_equiv(tree ssa, tree pointee)
Definition value-pointer-equiv.cc:139
Definition value-pointer-equiv.cc:54
class edge_def * edge
Definition coretypes.h:352
union tree_node * tree
Definition coretypes.h:97
tree_code
Definition genmatch.cc:992
poly_int< N, C > r
Definition poly-int.h:774
Definition basic-block.h:117
Definition gimple.h:221
#define TREE_CODE(NODE)
Definition tree.h:324
#define POINTER_TYPE_P(TYPE)
Definition tree.h:700
#define TREE_TYPE(NODE)
Definition tree.h:512
bool supported_pointer_equiv_p(tree expr)
Definition value-pointer-equiv.h:57