GCC Middle and Back End API Reference
tree-ssa-sccvn.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "splay-tree.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "ssa.h"
#include "expmed.h"
#include "insn-config.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "cgraph.h"
#include "gimple-pretty-print.h"
#include "alias.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "cfganal.h"
#include "tree-inline.h"
#include "internal-fn.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "flags.h"
#include "dojump.h"
#include "explow.h"
#include "calls.h"
#include "varasm.h"
#include "stmt.h"
#include "expr.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "dumpfile.h"
#include "cfgloop.h"
#include "tree-ssa-propagate.h"
#include "tree-cfg.h"
#include "domwalk.h"
#include "gimple-match.h"
#include "stringpool.h"
#include "attribs.h"
#include "tree-pass.h"
#include "statistics.h"
#include "langhooks.h"
#include "ipa-utils.h"
#include "dbgcnt.h"
#include "tree-cfgcleanup.h"
#include "tree-ssa-loop.h"
#include "tree-scalar-evolution.h"
#include "tree-ssa-loop-niter.h"
#include "builtins.h"
#include "fold-const-call.h"
#include "ipa-modref-tree.h"
#include "ipa-modref.h"
#include "tree-ssa-sccvn.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
#include "target.h"

Data Structures

struct  vn_nary_op_hasher
 
struct  vn_phi_hasher
 
struct  vn_reference_hasher
 
struct  vn_tables_s
 
struct  vn_constant_hasher
 
struct  vn_ssa_aux_hasher
 
struct  pd_range
 
struct  pd_data
 
struct  vn_walk_cb_data
 
class  eliminate_dom_walker
 
class  rpo_elim
 
struct  unwind_state
 

Macros

#define BB_EXECUTABLE   BB_VISITED
 

Typedefs

typedef hash_table< vn_nary_op_hashervn_nary_op_table_type
 
typedef vn_nary_op_table_type::iterator vn_nary_op_iterator_type
 
typedef hash_table< vn_phi_hashervn_phi_table_type
 
typedef vn_phi_table_type::iterator vn_phi_iterator_type
 
typedef hash_table< vn_reference_hashervn_reference_table_type
 
typedef vn_reference_table_type::iterator vn_reference_iterator_type
 
typedef struct vn_tables_svn_tables_t
 
typedef hash_table< vn_ssa_aux_hasher >::iterator vn_ssa_aux_iterator_type
 

Functions

static int vn_phi_eq (const_vn_phi_t const vp1, const_vn_phi_t const vp2)
 
static int vn_reference_op_eq (const void *p1, const void *p2)
 
static void free_reference (vn_reference_s *vr)
 
void print_vn_reference_ops (FILE *outfile, const vec< vn_reference_op_s > ops)
 
DEBUG_FUNCTION void debug_vn_reference_ops (const vec< vn_reference_op_s > ops)
 
static tree vn_valueize_for_srt (tree t, void *context)
 
static vn_nary_op_t vn_nary_op_insert_stmt (gimple *, tree)
 
static vn_nary_op_t vn_nary_op_insert_into (vn_nary_op_t, vn_nary_op_table_type *)
 
static void init_vn_nary_op_from_pieces (vn_nary_op_t, unsigned int, enum tree_code, tree, tree *)
 
static tree vn_lookup_simplify_result (gimple_match_op *)
 
static vn_reference_t vn_reference_lookup_or_insert_for_pieces (tree, alias_set_type, alias_set_type, poly_int64, poly_int64, tree, vec< vn_reference_op_s, va_heap >, tree)
 
bool has_VN_INFO (tree name)
 
vn_ssa_aux_t VN_INFO (tree name)
 
tree SSA_VAL (tree x, bool *visited=NULL)
 
static tree vuse_ssa_val (tree x)
 
static tree vuse_valueize (tree vuse)
 
enum vn_kind vn_get_stmt_kind (gimple *stmt)
 
unsigned int get_constant_value_id (tree constant)
 
unsigned int get_or_alloc_constant_value_id (tree constant)
 
static void vn_reference_op_compute_hash (const vn_reference_op_t vro1, inchash::hash &hstate)
 
static hashval_t vn_reference_compute_hash (const vn_reference_t vr1)
 
bool vn_reference_eq (const_vn_reference_t const vr1, const_vn_reference_t const vr2)
 
static void copy_reference_ops_from_ref (tree ref, vec< vn_reference_op_s > *result)
 
bool ao_ref_init_from_vn_reference (ao_ref *ref, alias_set_type set, alias_set_type base_set, tree type, const vec< vn_reference_op_s > &ops)
 
static void copy_reference_ops_from_call (gcall *call, vec< vn_reference_op_s > *result)
 
static bool vn_reference_fold_indirect (vec< vn_reference_op_s > *ops, unsigned int *i_p)
 
static bool vn_reference_maybe_forwprop_address (vec< vn_reference_op_s > *ops, unsigned int *i_p)
 
tree fully_constant_vn_reference_p (vn_reference_t ref)
 
static bool contains_storage_order_barrier_p (vec< vn_reference_op_s > ops)
 
static bool reverse_storage_order_for_component_p (vec< vn_reference_op_s > ops)
 
static void valueize_refs_1 (vec< vn_reference_op_s > *orig, bool *valueized_anything, bool with_avail=false)
 
static void valueize_refs (vec< vn_reference_op_s > *orig)
 
static vec< vn_reference_op_svalueize_shared_reference_ops_from_ref (tree ref, bool *valueized_anything)
 
static vec< vn_reference_op_svalueize_shared_reference_ops_from_call (gcall *call)
 
static tree vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
 
static int pd_range_compare (splay_tree_key offset1p, splay_tree_key offset2p)
 
static voidpd_tree_alloc (int size, void *data_)
 
static void pd_tree_dealloc (void *, void *)
 
static voidvn_reference_lookup_2 (ao_ref *op, tree vuse, void *data_)
 
static tree vn_nary_build_or_lookup_1 (gimple_match_op *res_op, bool insert, bool simplify)
 
static tree vn_nary_build_or_lookup (gimple_match_op *res_op)
 
tree vn_nary_simplify (vn_nary_op_t nary)
 
static bool adjust_offsets_for_equal_base_address (tree base1, poly_int64 *offset1, tree base2, poly_int64 *offset2)
 
static voidvn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, translate_flags *disambiguate_only)
 
vec< vn_reference_op_svn_reference_operands_for_lookup (tree op)
 
tree vn_reference_lookup_pieces (tree vuse, alias_set_type set, alias_set_type base_set, tree type, vec< vn_reference_op_s > operands, vn_reference_t *vnresult, vn_lookup_kind kind)
 
tree vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind, vn_reference_t *vnresult, bool tbaa_p, tree *last_vuse_ptr, tree mask, bool redundant_store_removal_p)
 
void vn_reference_lookup_call (gcall *call, vn_reference_t *vnresult, vn_reference_t vr)
 
static void vn_reference_insert (tree op, tree result, tree vuse, tree vdef)
 
vn_reference_t vn_reference_insert_pieces (tree vuse, alias_set_type set, alias_set_type base_set, poly_int64 offset, poly_int64 max_size, tree type, vec< vn_reference_op_s > operands, tree result, unsigned int value_id)
 
hashval_t vn_nary_op_compute_hash (const vn_nary_op_t vno1)
 
bool vn_nary_op_eq (const_vn_nary_op_t const vno1, const_vn_nary_op_t const vno2)
 
unsigned int vn_nary_length_from_stmt (gimple *stmt)
 
void init_vn_nary_op_from_stmt (vn_nary_op_t vno, gassign *stmt)
 
static tree vn_nary_op_lookup_1 (vn_nary_op_t vno, vn_nary_op_t *vnresult)
 
tree vn_nary_op_lookup_pieces (unsigned int length, enum tree_code code, tree type, tree *ops, vn_nary_op_t *vnresult)
 
tree vn_nary_op_lookup_stmt (gimple *stmt, vn_nary_op_t *vnresult)
 
vn_nary_op_t alloc_vn_nary_op_noinit (unsigned int length, struct obstack *stack)
 
static vn_nary_op_t alloc_vn_nary_op (unsigned int length, tree result, unsigned int value_id)
 
vn_nary_op_t vn_nary_op_insert_pieces (unsigned int length, enum tree_code code, tree type, tree *ops, tree result, unsigned int value_id)
 
static bool can_track_predicate_on_edge (edge pred_e)
 
static vn_nary_op_t vn_nary_op_insert_pieces_predicated (unsigned int length, enum tree_code code, tree type, tree *ops, tree result, unsigned int value_id, edge pred_e)
 
static bool dominated_by_p_w_unex (basic_block bb1, basic_block bb2, bool)
 
static tree vn_nary_op_get_predicated_value (vn_nary_op_t vno, basic_block bb, edge e=NULL)
 
static tree vn_nary_op_get_predicated_value (vn_nary_op_t vno, edge e)
 
static hashval_t vn_phi_compute_hash (vn_phi_t vp1)
 
static bool cond_stmts_equal_p (gcond *cond1, tree lhs1, tree rhs1, gcond *cond2, tree lhs2, tree rhs2, bool *inverted_p)
 
static tree vn_phi_lookup (gimple *phi, bool backedges_varying_p)
 
static vn_phi_t vn_phi_insert (gimple *phi, tree result, bool backedges_varying_p)
 
static bool set_ssa_val_to (tree from, tree to)
 
static bool defs_to_varying (gimple *stmt)
 
static bool visit_copy (tree lhs, tree rhs)
 
static tree valueized_wider_op (tree wide_type, tree op, bool allow_truncate)
 
static bool visit_nary_op (tree lhs, gassign *stmt)
 
static bool visit_reference_op_call (tree lhs, gcall *stmt)
 
static bool visit_reference_op_load (tree lhs, tree op, gimple *stmt)
 
static bool visit_reference_op_store (tree lhs, tree op, gimple *stmt)
 
static bool visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p)
 
static tree try_to_simplify (gassign *stmt)
 
static bool visit_stmt (gimple *stmt, bool backedges_varying_p=false)
 
static void allocate_vn_table (vn_tables_t table, unsigned size)
 
static void free_vn_table (vn_tables_t table)
 
static void set_value_id_for_result (tree result, unsigned int *id)
 
static void set_hashtable_value_ids (void)
 
unsigned int get_max_value_id (void)
 
unsigned int get_max_constant_value_id (void)
 
unsigned int get_next_value_id (void)
 
unsigned int get_next_constant_value_id (void)
 
bool expressions_equal_p (tree e1, tree e2, bool match_vn_top_optimistically)
 
bool vn_nary_may_trap (vn_nary_op_t nary)
 
bool vn_reference_may_trap (vn_reference_t ref)
 
unsigned eliminate_with_rpo_vn (bitmap inserted_exprs)
 
static unsigned do_rpo_vn_1 (function *fn, edge entry, bitmap exit_bbs, bool iterate, bool eliminate, bool skip_entry_phis, vn_lookup_kind kind)
 
void run_rpo_vn (vn_lookup_kind kind)
 
void free_rpo_vn (void)
 
tree rpo_vn_valueize (tree name)
 
static void insert_related_predicates_on_edge (enum tree_code code, tree *ops, edge pred_e)
 
static unsigned process_bb (rpo_elim &avail, basic_block bb, bool bb_visited, bool iterate_phis, bool iterate, bool eliminate, bool do_region, bitmap exit_bbs, bool skip_phis)
 
static void do_unwind (unwind_state *to, rpo_elim &avail)
 
unsigned do_rpo_vn (function *fn, edge entry, bitmap exit_bbs, bool iterate, bool eliminate, bool skip_entry_phis, vn_lookup_kind kind)
 
gimple_opt_passmake_pass_fre (gcc::context *ctxt)
 

Variables

static vn_lookup_kind default_vn_walk_kind
 
static hash_table< vn_constant_hasher > * constant_to_value_id
 
static obstack vn_tables_obstack
 
static obstack vn_tables_insert_obstack
 
static vn_reference_t last_inserted_ref
 
static vn_phi_t last_inserted_phi
 
static vn_nary_op_t last_inserted_nary
 
static vn_ssa_aux_t last_pushed_avail
 
static vn_tables_t valid_info
 
tree(* vn_valueize )(tree)
 
tree VN_TOP
 
static unsigned int next_value_id
 
static int next_constant_value_id
 
static hash_table< vn_ssa_aux_hasher > * vn_ssa_aux_hash
 
static struct obstack vn_ssa_aux_obstack
 
static vec< vn_reference_op_sshared_lookup_references
 
static eliminate_dom_walkerrpo_avail
 
basic_block vn_context_bb
 

Macro Definition Documentation

◆ BB_EXECUTABLE

#define BB_EXECUTABLE   BB_VISITED
SCC value numbering for trees
   Copyright (C) 2006-2024 Free Software Foundation, Inc.
   Contributed by Daniel Berlin <dan@dberlin.org>

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
This algorithm is based on the SCC algorithm presented by Keith
  Cooper and L. Taylor Simpson in "SCC-Based Value numbering"
  (http://citeseer.ist.psu.edu/41805.html).  In
  straight line code, it is equivalent to a regular hash based value
  numbering that is performed in reverse postorder.

  For code with cycles, there are two alternatives, both of which
  require keeping the hashtables separate from the actual list of
  value numbers for SSA names.

  1. Iterate value numbering in an RPO walk of the blocks, removing
  all the entries from the hashtable after each iteration (but
  keeping the SSA name->value number mapping between iterations).
  Iterate until it does not change.

  2. Perform value numbering as part of an SCC walk on the SSA graph,
  iterating only the cycles in the SSA graph until they do not change
  (using a separate, optimistic hashtable for value numbering the SCC
  operands).

  The second is not just faster in practice (because most SSA graph
  cycles do not involve all the variables in the graph), it also has
  some nice properties.

  One of these nice properties is that when we pop an SCC off the
  stack, we are guaranteed to have processed all the operands coming from
  *outside of that SCC*, so we do not need to do anything special to
  ensure they have value numbers.

  Another nice property is that the SCC walk is done as part of a DFS
  of the SSA graph, which makes it easy to perform combining and
  simplifying operations at the same time.

  The code below is deliberately written in a way that makes it easy
  to separate the SCC walk from the other work it does.

  In order to propagate constants through the code, we track which
  expressions contain constants, and use those while folding.  In
  theory, we could also track expressions whose value numbers are
  replaced, in case we end up folding based on expression
  identities.

  In order to value number memory, we assign value numbers to vuses.
  This enables us to note that, for example, stores to the same
  address of the same value from the same starting memory states are
  equivalent.
  TODO:

  1. We can iterate only the changing portions of the SCC's, but
  I have not seen an SCC big enough for this to be a win.
  2. If you differentiate between phi nodes for loops and phi nodes
  for if-then-else, you can properly consider phi nodes in different
  blocks for equivalence.
  3. We could value number vuses in more cases, particularly, whole
  structure copies.
There's no BB_EXECUTABLE but we can use BB_VISITED.   

Referenced by eliminate_dom_walker::before_dom_children(), do_rpo_vn_1(), and process_bb().

Typedef Documentation

◆ vn_nary_op_iterator_type

◆ vn_nary_op_table_type

◆ vn_phi_iterator_type

◆ vn_phi_table_type

◆ vn_reference_iterator_type

◆ vn_reference_table_type

◆ vn_ssa_aux_iterator_type

◆ vn_tables_t

The set of VN hashtables.   

Function Documentation

◆ adjust_offsets_for_equal_base_address()

static bool adjust_offsets_for_equal_base_address ( tree base1,
poly_int64 * offset1,
tree base2,
poly_int64 * offset2 )
static
Return true if BASE1 and BASE2 can be adjusted so they have the
same address and adjust *OFFSET1 and *OFFSET2 accordingly.
Otherwise return false.   

References ggc_alloc(), mem_ref_offset(), OEP_ADDRESS_OF, operand_equal_p(), TREE_CODE, and TREE_OPERAND.

Referenced by vn_reference_lookup_3().

◆ alloc_vn_nary_op()

static vn_nary_op_t alloc_vn_nary_op ( unsigned int length,
tree result,
unsigned int value_id )
static

◆ alloc_vn_nary_op_noinit()

vn_nary_op_t alloc_vn_nary_op_noinit ( unsigned int length,
struct obstack * stack )
Allocate a vn_nary_op_t with LENGTH operands on STACK.   

References ggc_alloc(), and sizeof_vn_nary_op().

Referenced by alloc_vn_nary_op(), get_or_alloc_expr_for_nary(), VN_INFO(), and vn_nary_build_or_lookup_1().

◆ allocate_vn_table()

static void allocate_vn_table ( vn_tables_t table,
unsigned size )
static
Allocate a value number table.   

References table.

Referenced by do_rpo_vn_1().

◆ ao_ref_init_from_vn_reference()

◆ can_track_predicate_on_edge()

static bool can_track_predicate_on_edge ( edge pred_e)
static
Return whether we can track a predicate valid when PRED_E is executed.   

References CDI_DOMINATORS, dominated_by_p(), FOR_EACH_EDGE, ggc_alloc(), and single_pred_p().

Referenced by process_bb(), and vn_nary_op_insert_pieces_predicated().

◆ cond_stmts_equal_p()

static bool cond_stmts_equal_p ( gcond * cond1,
tree lhs1,
tree rhs1,
gcond * cond2,
tree lhs2,
tree rhs2,
bool * inverted_p )
static
Return true if COND1 and COND2 represent the same condition, set
*INVERTED_P if one needs to be inverted to make it the same as
the other.   

References commutative_tree_code(), expressions_equal_p(), ggc_alloc(), gimple_cond_code(), HONOR_NANS(), invert_tree_comparison(), and swap_tree_comparison().

Referenced by vn_phi_eq().

◆ contains_storage_order_barrier_p()

static bool contains_storage_order_barrier_p ( vec< vn_reference_op_s > ops)
static
Return true if OPS contain a storage order barrier.   

References FOR_EACH_VEC_ELT, ggc_alloc(), i, vn_reference_op_struct::opcode, and vn_reference_op_struct::reverse.

Referenced by vn_reference_lookup_3().

◆ copy_reference_ops_from_call()

◆ copy_reference_ops_from_ref()

◆ debug_vn_reference_ops()

DEBUG_FUNCTION void debug_vn_reference_ops ( const vec< vn_reference_op_s > ops)

◆ defs_to_varying()

static bool defs_to_varying ( gimple * stmt)
static
Set all definitions in STMT to value number to themselves.
Return true if a value number changed.  

References changed, DEF_FROM_PTR, FOR_EACH_SSA_DEF_OPERAND, ggc_alloc(), set_ssa_val_to(), and SSA_OP_ALL_DEFS.

Referenced by visit_stmt().

◆ do_rpo_vn()

unsigned do_rpo_vn ( function * fn,
edge entry,
bitmap exit_bbs,
bool iterate,
bool eliminate,
bool skip_entry_phis,
vn_lookup_kind kind )
Region-based entry for RPO VN.  Performs value-numbering and elimination
on the SEME region specified by ENTRY and EXIT_BBS.  If ENTRY is not
the only edge into the region at ENTRY->dest PHI nodes in ENTRY->dest
are not considered.
If ITERATE is true then treat backedges optimistically as not
executed and iterate.  If ELIMINATE is true then perform
elimination, otherwise leave that to the caller.
If SKIP_ENTRY_PHIS is true then force PHI nodes in ENTRY->dest to VARYING.
KIND specifies the amount of work done for handling memory operations.   

References do_rpo_vn_1(), free_rpo_vn(), ggc_alloc(), and todo.

Referenced by execute_early_warn_uninitialized(), tree_if_conversion(), tree_loop_unroll_and_jam(), and tree_unroll_loops_completely().

◆ do_rpo_vn_1()

static unsigned do_rpo_vn_1 ( function * fn,
edge entry,
bitmap exit_bbs,
bool iterate,
bool eliminate,
bool skip_entry_phis,
vn_lookup_kind kind )
static
Do VN on a SEME region specified by ENTRY and EXIT_BBS in FN.
If ITERATE is true then treat backedges optimistically as not
executed and iterate.  If ELIMINATE is true then perform
elimination, otherwise leave that to the caller.  If SKIP_ENTRY_PHIS
is true then force PHI nodes in ENTRY->dest to VARYING.   

References allocate_vn_table(), vn_ssa_aux::avail, BASIC_BLOCK_FOR_FN, BB_EXECUTABLE, bb_in_region(), BITMAP_ALLOC, bitmap_bit_p, bitmap_clear_first_set_bit(), bitmap_empty_p(), BITMAP_FREE, bitmap_set_bit, CDI_DOMINATORS, cfun, create_tmp_var_raw(), default_vn_walk_kind, do_unwind(), dominated_by_p(), dump_file, dump_flags, eliminate_dom_walker::eliminate_cleanup(), eliminate_with_rpo_vn(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK, basic_block_def::flags, FOR_EACH_EDGE, gcc_assert, gcc_obstack_init, GF_PLF_1, ggc_alloc(), gimple_plf(), gsi_end_p(), gsi_next(), gsi_start_phis(), loop::header, i, basic_block_def::index, inserted, last_basic_block_for_fn, last_inserted_nary, last_inserted_phi, last_inserted_ref, last_pushed_avail, LI_ONLY_INNERMOST, loop_depth(), LOOPS_NEED_FIXUP, loops_state_satisfies_p(), n_basic_blocks_for_fn, vn_avail::next, next_constant_value_id, next_value_id, NULL, loop::num, NUM_FIXED_BLOCKS, num_ssa_names, gphi_iterator::phi(), basic_block_def::preds, PRIu64, process_bb(), rev_post_order_and_mark_dfs_back_seme(), rpo_avail, rpo_vn_valueize(), single_succ_edge(), statistics_counter_event(), statistics_histogram_event(), basic_block_def::succs, superloop_at_depth(), TDF_DETAILS, TDF_STATS, todo, valid_info, visit_phi(), visited, vn_context_bb, vn_ssa_aux_hash, vn_ssa_aux_obstack, vn_tables_insert_obstack, vn_tables_obstack, VN_TOP, vn_valueize, void_type_node, and worklist.

Referenced by do_rpo_vn(), and run_rpo_vn().

◆ do_unwind()

◆ dominated_by_p_w_unex()

static bool dominated_by_p_w_unex ( basic_block bb1,
basic_block bb2,
bool allow_back )
static
Return true if BB1 is dominated by BB2 taking into account edges
that are not executable.  When ALLOW_BACK is false consider not
executable backedges as executable.   

References CDI_DOMINATORS, dominated_by_p(), EDGE_COUNT, FOR_EACH_EDGE, ggc_alloc(), and NULL.

Referenced by rpo_elim::eliminate_avail(), and vn_nary_op_get_predicated_value().

◆ eliminate_with_rpo_vn()

unsigned eliminate_with_rpo_vn ( bitmap inserted_exprs)
Eliminate fully redundant computations.   

References CDI_DOMINATORS, cfun, ggc_alloc(), inserted_exprs, and rpo_avail.

Referenced by do_rpo_vn_1().

◆ expressions_equal_p()

bool expressions_equal_p ( tree e1,
tree e2,
bool match_vn_top_optimistically )
Compare two expressions E1 and E2 and return true if they are equal.
If match_vn_top_optimistically is true then VN_TOP is equal to anything,
otherwise VN_TOP only matches VN_TOP.   

References ggc_alloc(), OEP_PURE_SAME, operand_equal_p(), TREE_CODE, and VN_TOP.

Referenced by cond_stmts_equal_p(), visit_phi(), visit_reference_op_store(), vn_constant_eq_with_type(), vn_nary_op_eq(), vn_nary_op_insert_into(), vn_phi_eq(), vn_reference_eq(), and vn_reference_op_eq().

◆ free_reference()

static void free_reference ( vn_reference_s * vr)
inlinestatic
Free a reference operation structure VP.   

References vn_reference_s::operands.

Referenced by vn_reference_insert().

◆ free_rpo_vn()

◆ free_vn_table()

static void free_vn_table ( vn_tables_t table)
static
Free a value number table.   

References FOR_EACH_HASH_TABLE_ELEMENT, ggc_alloc(), NULL, vn_reference_s::operands, and table.

Referenced by free_rpo_vn().

◆ fully_constant_vn_reference_p()

◆ get_constant_value_id()

unsigned int get_constant_value_id ( tree constant)
Lookup a value id for CONSTANT and return it.  If it does not
exist returns 0.   

References vn_constant_s::constant, constant_to_value_id, ggc_alloc(), and vn_hash_constant_with_type().

◆ get_max_constant_value_id()

unsigned int get_max_constant_value_id ( void )
Return the maximum constant value id we have ever seen.   

References next_constant_value_id.

Referenced by init_pre().

◆ get_max_value_id()

unsigned int get_max_value_id ( void )
Return the maximum value id we have ever seen.   

References next_value_id.

Referenced by init_pre().

◆ get_next_constant_value_id()

unsigned int get_next_constant_value_id ( void )
Return the next unique value id for constants.   

References gcc_checking_assert, and next_constant_value_id.

Referenced by get_or_alloc_constant_value_id().

◆ get_next_value_id()

◆ get_or_alloc_constant_value_id()

unsigned int get_or_alloc_constant_value_id ( tree constant)
Lookup a value id for CONSTANT, and if it does not exist, create a
new one and return it.  If it does exist, return it.   

References vn_constant_s::constant, constant_to_value_id, get_next_constant_value_id(), ggc_alloc(), and vn_hash_constant_with_type().

Referenced by get_or_alloc_expr_for_constant(), run_rpo_vn(), set_value_id_for_result(), vn_reference_insert(), and vn_reference_lookup_or_insert_for_pieces().

◆ has_VN_INFO()

bool has_VN_INFO ( tree name)
Return whether there is value numbering information for a given SSA name.   

References SSA_NAME_VERSION, and vn_ssa_aux_hash.

Referenced by eliminate_dom_walker::eliminate_stmt(), and tail_merge_valueize().

◆ init_vn_nary_op_from_pieces()

static void init_vn_nary_op_from_pieces ( vn_nary_op_t vno,
unsigned int length,
enum tree_code code,
tree type,
tree * ops )
static
Initialize VNO from the pieces provided.   

References ggc_alloc(), and type().

Referenced by VN_INFO(), vn_nary_op_insert_pieces(), vn_nary_op_insert_pieces_predicated(), and vn_nary_op_lookup_pieces().

◆ init_vn_nary_op_from_stmt()

◆ insert_related_predicates_on_edge()

static void insert_related_predicates_on_edge ( enum tree_code code,
tree * ops,
edge pred_e )
static
Insert on PRED_E predicates derived from CODE OPS being true besides the
inverted condition.   

References boolean_false_node, boolean_true_node, boolean_type_node, ggc_alloc(), and vn_nary_op_insert_pieces_predicated().

Referenced by process_bb().

◆ make_pass_fre()

gimple_opt_pass * make_pass_fre ( gcc::context * ctxt)

References ggc_alloc().

◆ pd_range_compare()

static int pd_range_compare ( splay_tree_key offset1p,
splay_tree_key offset2p )
static
pd_range splay-tree helpers.   

References ggc_alloc().

Referenced by vn_walk_cb_data::push_partial_def().

◆ pd_tree_alloc()

static void * pd_tree_alloc ( int size,
void * data_ )
static

◆ pd_tree_dealloc()

static void pd_tree_dealloc ( void * ,
void *  )
static

◆ print_vn_reference_ops()

void print_vn_reference_ops ( FILE * outfile,
const vec< vn_reference_op_s > ops )

◆ process_bb()

static unsigned process_bb ( rpo_elim & avail,
basic_block bb,
bool bb_visited,
bool iterate_phis,
bool iterate,
bool eliminate,
bool do_region,
bitmap exit_bbs,
bool skip_phis )
static
Main stmt worker for RPO VN, process BB.   

References BB_EXECUTABLE, bitmap_bit_p, boolean_false_node, boolean_true_node, boolean_type_node, can_track_predicate_on_edge(), dump_file, dump_flags, rpo_elim::eliminate_avail(), rpo_elim::eliminate_push_avail(), eliminate_dom_walker::eliminate_stmt(), eliminate_dom_walker::eliminations, extract_true_false_edges_from_block(), find_taken_edge(), flow_loop_nested_p(), FOR_EACH_EDGE, FOR_EACH_SSA_TREE_OPERAND, gcc_assert, ggc_alloc(), gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_goto_dest(), gimple_simplify(), gimple_switch_index(), gsi_end_p(), gsi_next(), gsi_one_before_end_p(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), has_zero_uses(), loop::header, HONOR_NANS(), i, insert_related_predicates_on_edge(), INTEGRAL_TYPE_P, invert_tree_comparison(), is_gimple_min_invariant(), last, LOOP_CLOSED_SSA, basic_block_def::loop_father, loops_state_satisfies_p(), may_propagate_copy(), loop::nb_iterations, NULL, NULL_TREE, PHI_ARG_DEF_PTR_FROM_EDGE, PHI_RESULT, basic_block_def::preds, print_generic_expr(), print_gimple_stmt(), propagate_value(), simplify_replace_tree(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_OP_ALL_DEFS, SSA_OP_DEF, SSA_VAL(), basic_block_def::succs, TDF_DETAILS, TDF_NONE, TDF_SLIM, eliminate_dom_walker::to_remove, todo, TODO_cleanup_cfg, TREE_CODE, TREE_TYPE, USE_FROM_PTR, vn_ssa_aux::valnum, virtual_operand_p(), visit_stmt(), vn_ssa_aux::visited, vn_context_bb, VN_INFO(), vn_nary_op_get_predicated_value(), vn_nary_op_insert_pieces_predicated(), vn_nary_op_lookup_pieces(), VN_TOP, vn_valueize, and vn_valueize_for_srt().

Referenced by do_rpo_vn_1().

◆ reverse_storage_order_for_component_p()

static bool reverse_storage_order_for_component_p ( vec< vn_reference_op_s > ops)
static
Return true if OPS represent an access with reverse storage order.   

References ggc_alloc(), and i.

Referenced by loop_distribution::classify_builtin_ldst(), create_total_scalarization_access(), get_inner_reference(), get_ref_base_and_extent(), and vn_reference_lookup_3().

◆ rpo_vn_valueize()

tree rpo_vn_valueize ( tree name)
Valueization hook for RPO VN plus required state.   

References eliminate_dom_walker::eliminate_avail(), ggc_alloc(), rpo_avail, TREE_CODE, vn_ssa_aux::valnum, vn_context_bb, VN_INFO(), and VN_TOP.

Referenced by do_rpo_vn_1().

◆ run_rpo_vn()

◆ set_hashtable_value_ids()

◆ set_ssa_val_to()

◆ set_value_id_for_result()

static void set_value_id_for_result ( tree result,
unsigned int * id )
static

◆ SSA_VAL()

◆ try_to_simplify()

static tree try_to_simplify ( gassign * stmt)
static

◆ valueize_refs()

◆ valueize_refs_1()

static void valueize_refs_1 ( vec< vn_reference_op_s > * orig,
bool * valueized_anything,
bool with_avail = false )
static
Transform any SSA_NAME's in a vector of vn_reference_op_s
structures into their value numbers.  This is done in-place, and
the vector passed in is returned.  *VALUEIZED_ANYTHING will specify
whether any operands were valueized.   

References ggc_alloc(), i, known_eq, poly_int_tree_p(), SSA_VAL(), wi::to_offset(), wi::to_poly_offset(), poly_int< N, C >::to_shwi(), TREE_CODE, vn_ref_op_align_unit(), vn_reference_fold_indirect(), vn_reference_maybe_forwprop_address(), and vn_valueize.

Referenced by valueize_refs(), valueize_shared_reference_ops_from_ref(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().

◆ valueize_shared_reference_ops_from_call()

static vec< vn_reference_op_s > valueize_shared_reference_ops_from_call ( gcall * call)
static
Create a vector of vn_reference_op_s structures from CALL, a
call statement.  The vector is shared among all callers of
this function.   

References copy_reference_ops_from_call(), shared_lookup_references, valueize_refs(), and vNULL.

Referenced by vn_reference_lookup_call().

◆ valueize_shared_reference_ops_from_ref()

static vec< vn_reference_op_s > valueize_shared_reference_ops_from_ref ( tree ref,
bool * valueized_anything )
static
Create a vector of vn_reference_op_s structures from REF, a
REFERENCE_CLASS_P tree.  The vector is shared among all callers of
this function.  *VALUEIZED_ANYTHING will specify whether any
operands were valueized.   

References copy_reference_ops_from_ref(), ggc_alloc(), shared_lookup_references, valueize_refs_1(), and vNULL.

Referenced by vn_reference_insert(), vn_reference_lookup(), and vn_reference_operands_for_lookup().

◆ valueized_wider_op()

static tree valueized_wider_op ( tree wide_type,
tree op,
bool allow_truncate )
static

◆ visit_copy()

static bool visit_copy ( tree lhs,
tree rhs )
static
Visit a copy between LHS and RHS, return true if the value number
changed.   

References set_ssa_val_to(), and SSA_VAL().

Referenced by visit_stmt().

◆ visit_nary_op()

◆ visit_phi()

◆ visit_reference_op_call()

◆ visit_reference_op_load()

◆ visit_reference_op_store()

◆ visit_stmt()

◆ vn_get_stmt_kind()

◆ VN_INFO()

vn_ssa_aux_t VN_INFO ( tree name)

◆ vn_lookup_simplify_result()

static tree vn_lookup_simplify_result ( gimple_match_op * res_op)
static

◆ vn_nary_build_or_lookup()

static tree vn_nary_build_or_lookup ( gimple_match_op * res_op)
static
Return a value-number for RCODE OPS... either by looking up an existing
value-number for the simplified result or by inserting the operation.   

References ggc_alloc(), and vn_nary_build_or_lookup_1().

Referenced by visit_nary_op(), visit_reference_op_load(), and vn_reference_lookup_3().

◆ vn_nary_build_or_lookup_1()

◆ vn_nary_length_from_stmt()

unsigned int vn_nary_length_from_stmt ( gimple * stmt)
Return the number of operands for a vn_nary ops structure from STMT.   

References CONSTRUCTOR_NELTS, ggc_alloc(), gimple_assign_rhs1(), gimple_assign_rhs_code(), and gimple_num_ops().

Referenced by compute_avail(), vn_nary_build_or_lookup_1(), vn_nary_op_insert_stmt(), and vn_nary_op_lookup_stmt().

◆ vn_nary_may_trap()

bool vn_nary_may_trap ( vn_nary_op_t nary)

◆ vn_nary_op_compute_hash()

◆ vn_nary_op_eq()

bool vn_nary_op_eq ( const_vn_nary_op_t const vno1,
const_vn_nary_op_t const vno2 )
Compare nary operations VNO1 and VNO2 and return true if they are
equivalent.   

References expressions_equal_p(), ggc_alloc(), i, TREE_CODE, TREE_TYPE, TYPE_PRECISION, and types_compatible_p().

Referenced by pre_expr_d::equal(), and vn_nary_op_hasher::equal().

◆ vn_nary_op_get_predicated_value() [1/2]

◆ vn_nary_op_get_predicated_value() [2/2]

static tree vn_nary_op_get_predicated_value ( vn_nary_op_t vno,
edge e )
static

◆ vn_nary_op_insert_into()

◆ vn_nary_op_insert_pieces()

vn_nary_op_t vn_nary_op_insert_pieces ( unsigned int length,
enum tree_code code,
tree type,
tree * ops,
tree result,
unsigned int value_id )
Insert a n-ary operation into the current hash table using it's
pieces.  Return the vn_nary_op_t structure we created and put in
the hashtable.   

References alloc_vn_nary_op(), ggc_alloc(), init_vn_nary_op_from_pieces(), vn_tables_s::nary, vn_reference_s::result, valid_info, vn_reference_s::value_id, and vn_nary_op_insert_into().

Referenced by vn_reference_insert().

◆ vn_nary_op_insert_pieces_predicated()

◆ vn_nary_op_insert_stmt()

static vn_nary_op_t vn_nary_op_insert_stmt ( gimple * stmt,
tree result )
static

◆ vn_nary_op_lookup_1()

static tree vn_nary_op_lookup_1 ( vn_nary_op_t vno,
vn_nary_op_t * vnresult )
static
Compute the hashcode for VNO and look for it in the hash table;
return the resulting value number if it exists in the hash table.
Return NULL_TREE if it does not exist in the hash table or if the
result field of the operation is NULL.  VNRESULT will contain the
vn_nary_op_t from the hashtable if it exists.   

References hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), ggc_alloc(), i, vn_tables_s::nary, NULL, NULL_TREE, SSA_VAL(), TREE_CODE, valid_info, and vn_nary_op_compute_hash().

Referenced by vn_nary_op_lookup_pieces(), and vn_nary_op_lookup_stmt().

◆ vn_nary_op_lookup_pieces()

tree vn_nary_op_lookup_pieces ( unsigned int length,
enum tree_code code,
tree type,
tree * ops,
vn_nary_op_t * vnresult )
Lookup a n-ary operation by its pieces and return the resulting value
number if it exists in the hash table.  Return NULL_TREE if it does
not exist in the hash table or if the result field of the operation
is NULL. VNRESULT will contain the vn_nary_op_t from the hashtable
if it exists.   

References ggc_alloc(), init_vn_nary_op_from_pieces(), sizeof_vn_nary_op(), and vn_nary_op_lookup_1().

Referenced by phi_translate_1(), process_bb(), valueized_wider_op(), visit_nary_op(), visit_phi(), vn_lookup_simplify_result(), and vn_reference_lookup().

◆ vn_nary_op_lookup_stmt()

tree vn_nary_op_lookup_stmt ( gimple * stmt,
vn_nary_op_t * vnresult )
Lookup the rhs of STMT in the current hash table, and return the resulting
value number if it exists in the hash table.  Return NULL_TREE if
it does not exist in the hash table.  VNRESULT will contain the
vn_nary_op_t from the hashtable if it exists.   

References ggc_alloc(), init_vn_nary_op_from_stmt(), sizeof_vn_nary_op(), vn_nary_length_from_stmt(), and vn_nary_op_lookup_1().

Referenced by compute_avail(), visit_nary_op(), and vn_nary_build_or_lookup_1().

◆ vn_nary_simplify()

tree vn_nary_simplify ( vn_nary_op_t nary)

◆ vn_phi_compute_hash()

static hashval_t vn_phi_compute_hash ( vn_phi_t vp1)
inlinestatic
Compute a hashcode for PHI operation VP1 and return it.   

References inchash::add_expr(), EDGE_COUNT, FOR_EACH_EDGE, ggc_alloc(), type(), vn_hash_type(), and VN_TOP.

Referenced by vn_phi_insert(), and vn_phi_lookup().

◆ vn_phi_eq()

static int vn_phi_eq ( const_vn_phi_t const vp1,
const_vn_phi_t const vp2 )
static
vn_phi hashtable helpers.   
Compare two phi entries for equality, ignoring VN_TOP arguments.   

References CDI_DOMINATORS, cond_stmts_equal_p(), EDGE_COUNT, expressions_equal_p(), extract_true_false_controlled_edges(), gcc_checking_assert, get_immediate_dominator(), ggc_alloc(), gsi_last_bb(), i, and types_compatible_p().

Referenced by vn_phi_hasher::equal().

◆ vn_phi_insert()

◆ vn_phi_lookup()

static tree vn_phi_lookup ( gimple * phi,
bool backedges_varying_p )
static

◆ vn_reference_compute_hash()

◆ vn_reference_eq()

bool vn_reference_eq ( const_vn_reference_t const vr1,
const_vn_reference_t const vr2 )
Return true if reference operations VR1 and VR2 are equivalent.  This
means they have the same set of operands and vuses.   

References COMPLETE_TYPE_P, expressions_equal_p(), ggc_alloc(), i, INTEGRAL_TYPE_P, known_eq, TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, TYPE_PRECISION, TYPE_SIZE, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), VECTOR_BOOLEAN_TYPE_P, and vn_reference_op_eq().

Referenced by pre_expr_d::equal(), and vn_reference_hasher::equal().

◆ vn_reference_fold_indirect()

static bool vn_reference_fold_indirect ( vec< vn_reference_op_s > * ops,
unsigned int * i_p )
static

◆ vn_reference_insert()

◆ vn_reference_insert_pieces()

◆ vn_reference_lookup()

tree vn_reference_lookup ( tree op,
tree vuse,
vn_lookup_kind kind,
vn_reference_t * vnresult,
bool tbaa_p,
tree * last_vuse_ptr,
tree mask,
bool redundant_store_removal_p )
Lookup OP in the current hash table, and return the resulting value
number if it exists in the hash table.  Return NULL_TREE if it does
not exist in the hash table or if the result field of the structure
was NULL..  VNRESULT will be filled in with the vn_reference_t
stored in the hashtable if one exists.  When TBAA_P is false assume
we are looking up a store and treat it as having alias-set zero.
*LAST_VUSE_PTR will be updated with the VUSE the value lookup succeeded.
MASK is either NULL_TREE, or can be an INTEGER_CST if the result of the
load is bitwise anded with MASK and so we are only interested in a subset
of the bits and can ignore if the other bits are uninitialized or
not initialized with constants.  When doing redundant store removal
the caller has to set REDUNDANT_STORE_REMOVAL_P.   

References ao_ref_alias_set(), ao_ref_base(), ao_ref_base_alias_set(), ao_ref_init(), ao_ref_init_from_vn_reference(), cfun, poly_int< N, C >::coeffs, fully_constant_vn_reference_p(), gcc_assert, gcc_checking_assert, ggc_alloc(), i, known_eq, NULL, NULL_TREE, operand_equal_p(), vn_reference_s::operands, PROP_objsz, r, sext_hwi(), shared_lookup_references, sizetype, TREE_TYPE, TYPE_PRECISION, valueize_shared_reference_ops_from_ref(), vn_nary_op_lookup_pieces(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_reference_s::vuse, vuse_ssa_val(), vuse_valueize(), walk_non_aliased_vuses(), and wide_int_to_tree().

Referenced by eliminate_dom_walker::eliminate_stmt(), visit_nary_op(), visit_reference_op_load(), and visit_reference_op_store().

◆ vn_reference_lookup_1()

static tree vn_reference_lookup_1 ( vn_reference_t vr,
vn_reference_t * vnresult )
static
Lookup a SCCVN reference operation VR in the current hash table.
Returns the resulting value number if it exists in the hash table,
NULL_TREE otherwise.  VNRESULT will be filled in with the actual
vn_reference_t stored in the hashtable if something is found.   

References hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), ggc_alloc(), vn_reference_s::hashcode, NULL_TREE, vn_tables_s::references, and valid_info.

Referenced by visit_reference_op_call(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_call(), vn_reference_lookup_or_insert_for_pieces(), and vn_reference_lookup_pieces().

◆ vn_reference_lookup_2()

◆ vn_reference_lookup_3()

static void * vn_reference_lookup_3 ( ao_ref * ref,
tree vuse,
void * data_,
translate_flags * disambiguate_only )
static
Callback for walk_non_aliased_vuses.  Tries to perform a lookup
from the statement defining VUSE and if not successful tries to
translate *REFP and VR_ through an aggregate copy at the definition
of VUSE.  If *DISAMBIGUATE_ONLY is true then do not perform translation
of *REF and *VR.  If only disambiguation was performed then
*DISAMBIGUATE_ONLY is set to true.   

References adjust_offsets_for_equal_base_address(), AGGREGATE_TYPE_P, ao_ref_alias_set(), ao_ref_base(), ao_ref_base_alias_set(), ao_ref_init(), ao_ref_init_from_ptr_and_size(), ao_ref_init_from_vn_reference(), bitsize_int, build_constructor(), build_fold_addr_expr, build_int_cst(), build_nonstandard_integer_type(), build_zero_cst(), BUILT_IN_NORMAL, call_may_clobber_ref_p_1(), CHAR_BIT, CONSTANT_CLASS_P, CONSTRUCTOR_NELTS, contains_storage_order_barrier_p(), copy_reference_ops_from_ref(), DECL_P, dump_file, dump_flags, fold_convert, FOR_EACH_VEC_ELT, poly_int< N, C >::from(), fully_constant_vn_reference_p(), gcc_assert, gcc_unreachable, get_addr_base_and_unit_offset(), get_deref_alias_set(), GET_MODE_SIZE(), get_object_alignment(), get_ref_base_and_extent(), ggc_alloc(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_bb(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gimple_call_set_arg(), gimple_clobber_p(), gimple_vuse(), handled_component_p(), vn_reference_s::hashcode, i, int_const_binop(), int_fits_type_p(), integer_zerop(), INTEGRAL_TYPE_P, internal_fn_len_index(), internal_fn_mask_index(), internal_fn_stored_value_index(), internal_store_fn_p(), INTTYPE_MAXIMUM, poly_int< N, C >::is_constant(), is_gimple_assign(), is_gimple_call(), is_gimple_min_invariant(), is_gimple_reg_type(), known_eq, known_lt, ao_ref::max_size, vn_reference_s::max_size, ao_ref::max_size_known_p(), mem_ref_offset(), native_encode_expr(), native_interpret_expr(), NULL, NULL_TREE, OEP_ADDRESS_OF, vn_reference_op_struct::off, offset, ao_ref::offset, vn_reference_s::offset, vn_reference_op_struct::op0, vn_reference_op_struct::opcode, operand_equal_p(), vn_reference_s::operands, poly_int_tree_p(), print_gimple_stmt(), ptr_type_node, r, ao_ref::ref, refs_may_alias_p_1(), reverse_storage_order_for_component_p(), SCALAR_INT_TYPE_MODE, shared_lookup_references, shift_bytes_in_array_left(), shift_bytes_in_array_right(), SIGNED, ao_ref::size, SSA_NAME_DEF_STMT, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_VERSION, SSA_VAL(), stmt_kills_ref_p(), storage_order_barrier_p(), TDF_DETAILS, wi::to_poly_offset(), wi::to_poly_wide(), TR_DISAMBIGUATE, TR_TRANSLATE, TR_VALUEIZE_AND_DISAMBIGUATE, TREE_CODE, tree_fits_poly_int64_p(), tree_fits_shwi_p(), tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_INT_CST_LOW, TREE_OPERAND, tree_to_poly_int64(), tree_to_shwi(), tree_to_uhwi(), TREE_TYPE, vn_reference_op_struct::type, vn_reference_s::type, type_has_mode_precision_p(), TYPE_MODE, TYPE_PRECISION, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), gimple_match_cond::UNCOND, valueize_refs(), valueize_refs_1(), VECTOR_CST_ELT, vn_context_bb, vn_nary_build_or_lookup(), vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_op_eq(), vn_valueize, VN_WALKREWRITE, vn_reference_s::vuse, and vuse_ssa_val().

Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().

◆ vn_reference_lookup_call()

◆ vn_reference_lookup_or_insert_for_pieces()

static vn_reference_t vn_reference_lookup_or_insert_for_pieces ( tree vuse,
alias_set_type set,
alias_set_type base_set,
poly_int64 offset,
poly_int64 max_size,
tree type,
vec< vn_reference_op_s, va_heap > operands,
tree value )
static
Lookup an existing or insert a new vn_reference entry into the
value table for the VUSE, SET, TYPE, OPERANDS reference which
has the value VALUE which is either a constant or an SSA name.   

References get_or_alloc_constant_value_id(), ggc_alloc(), NULL_TREE, offset, SSA_VAL(), TREE_CODE, type(), vn_ssa_aux::value_id, VN_INFO(), vn_reference_compute_hash(), vn_reference_insert_pieces(), and vn_reference_lookup_1().

Referenced by vn_walk_cb_data::finish().

◆ vn_reference_lookup_pieces()

tree vn_reference_lookup_pieces ( tree vuse,
alias_set_type set,
alias_set_type base_set,
tree type,
vec< vn_reference_op_s > operands,
vn_reference_t * vnresult,
vn_lookup_kind kind )
Lookup a reference operation by it's parts, in the current hash table.
Returns the resulting value number if it exists in the hash table,
NULL_TREE otherwise.  VNRESULT will be filled in with the actual
vn_reference_t stored in the hashtable if something is found.   

References ao_ref_init_from_vn_reference(), vn_reference_s::base_set, fully_constant_vn_reference_p(), gcc_checking_assert, ggc_alloc(), NULL, NULL_TREE, operand_equal_p(), vn_reference_s::operands, r, vn_reference_s::set, shared_lookup_references, type(), valueize_refs_1(), VN_NOWALK, vn_reference_compute_hash(), vn_reference_lookup_1(), vn_reference_lookup_2(), vn_reference_lookup_3(), vn_reference_s::vuse, vuse_ssa_val(), vuse_valueize(), and walk_non_aliased_vuses().

Referenced by compute_avail(), and phi_translate_1().

◆ vn_reference_may_trap()

◆ vn_reference_maybe_forwprop_address()

◆ vn_reference_op_compute_hash()

static void vn_reference_op_compute_hash ( const vn_reference_op_t vro1,
inchash::hash & hstate )
static
Compute the hash for a reference operand VRO1.   

References inchash::add_expr(), and ggc_alloc().

Referenced by vn_reference_compute_hash().

◆ vn_reference_op_eq()

static int vn_reference_op_eq ( const void * p1,
const void * p2 )
static
Compare two reference operands P1 and P2 for equality.  Return true if
they are equal, and false otherwise.   

References expressions_equal_p(), ggc_alloc(), TYPE_MAIN_VARIANT, and types_compatible_p().

Referenced by vn_reference_eq(), and vn_reference_lookup_3().

◆ vn_reference_operands_for_lookup()

vec< vn_reference_op_s > vn_reference_operands_for_lookup ( tree op)
Return a reference op vector from OP that can be used for
vn_reference_lookup_pieces.  The caller is responsible for releasing
the vector.   

References ggc_alloc(), and valueize_shared_reference_ops_from_ref().

Referenced by compute_avail().

◆ vn_valueize_for_srt()

static tree vn_valueize_for_srt ( tree t,
void * context )
static

◆ vuse_ssa_val()

static tree vuse_ssa_val ( tree x)
inlinestatic
Return the SSA value of the VUSE x, supporting released VDEFs
during elimination which will value-number the VDEF to the
associated VUSE (but not substitute in the whole lattice).   

References gcc_assert, NULL_TREE, SSA_NAME_IN_FREE_LIST, SSA_VAL(), and VN_TOP.

Referenced by visit_reference_op_call(), vn_reference_insert(), vn_reference_insert_pieces(), vn_reference_lookup(), vn_reference_lookup_2(), vn_reference_lookup_3(), and vn_reference_lookup_pieces().

◆ vuse_valueize()

static tree vuse_valueize ( tree vuse)
static
Similar to the above but used as callback for walk_non_aliased_vuses
and thus should stop at unvisited VUSE to not walk across region
boundaries.   

References gcc_assert, NULL_TREE, SSA_NAME_IN_FREE_LIST, SSA_VAL(), visited, and VN_TOP.

Referenced by vn_reference_lookup(), and vn_reference_lookup_pieces().

Variable Documentation

◆ constant_to_value_id

◆ default_vn_walk_kind

◆ last_inserted_nary

◆ last_inserted_phi

vn_phi_t last_inserted_phi
static

◆ last_inserted_ref

◆ last_pushed_avail

vn_ssa_aux_t last_pushed_avail
static

◆ next_constant_value_id

int next_constant_value_id
static

◆ next_value_id

unsigned int next_value_id
static
Unique counter for our value ids.   

Referenced by do_rpo_vn_1(), get_max_value_id(), and get_next_value_id().

◆ rpo_avail

eliminate_dom_walker* rpo_avail
static
Global RPO state for access from hooks.   

Referenced by do_rpo_vn_1(), eliminate_with_rpo_vn(), rpo_vn_valueize(), visit_nary_op(), and vn_lookup_simplify_result().

◆ shared_lookup_references

◆ valid_info

◆ vn_context_bb

◆ vn_ssa_aux_hash

hash_table<vn_ssa_aux_hasher>* vn_ssa_aux_hash
static

◆ vn_ssa_aux_obstack

struct obstack vn_ssa_aux_obstack
static

◆ vn_tables_insert_obstack

obstack vn_tables_insert_obstack
static
Special obstack we never unwind.   

Referenced by do_rpo_vn_1(), free_rpo_vn(), VN_INFO(), and vn_nary_build_or_lookup_1().

◆ vn_tables_obstack

◆ VN_TOP

◆ vn_valueize