GCC Middle and Back End API Reference
tree-ssa-scopedtables.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "function.h"
#include "basic-block.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "tree-pretty-print.h"
#include "tree-ssa-scopedtables.h"
#include "tree-ssa-threadedge.h"
#include "stor-layout.h"
#include "fold-const.h"
#include "tree-eh.h"
#include "internal-fn.h"
#include "tree-dfa.h"
#include "options.h"
Include dependency graph for tree-ssa-scopedtables.cc:


namespace  inchash


static bool hashable_expr_equal_p (const struct hashable_expr *, const struct hashable_expr *)
static voidvuse_eq (ao_ref *, tree vuse1, void *data)
static void inchash::add_expr_commutative (const_tree t1, const_tree t2, hash &hstate)
static void inchash::add_hashable_expr (const struct hashable_expr *expr, hash &hstate)
static hashval_t avail_expr_hash (class expr_hash_elt *p)
static bool equal_mem_array_ref_p (tree t0, tree t1)
void initialize_expr_from_cond (tree cond, struct hashable_expr *expr)
static void build_and_record_new_cond (enum tree_code code, tree op0, tree op1, vec< cond_equivalence > *p, bool val=true)
void record_conditions (vec< cond_equivalence > *p, tree cond, tree inverted)

Function Documentation

◆ avail_expr_hash()

static hashval_t avail_expr_hash ( class expr_hash_elt * p)
Hashing and equality functions.  We compute a value number for expressions
using the code of the expression and the SSA numbers of its operands.   

References inchash::add_expr(), inchash::add_hashable_expr(), expr_hash_elt::expr(), EXPR_SINGLE, get_ref_base_and_extent(), ggc_alloc(), handled_component_p(), known_eq, OEP_ADDRESS_OF, offset, expr::ops, and TREE_CODE.

Referenced by expr_hash_elt::expr_hash_elt(), and expr_hash_elt::expr_hash_elt().

◆ build_and_record_new_cond()

static void build_and_record_new_cond ( enum tree_code code,
tree op0,
tree op1,
vec< cond_equivalence > * p,
bool val = true )

◆ equal_mem_array_ref_p()

static bool equal_mem_array_ref_p ( tree t0,
tree t1 )
Compares trees T0 and T1 to see if they are MEM_REF or ARRAY_REFs equivalent
to each other.  (That is, they return the value of the same bit of memory.)

Return TRUE if the two are so equivalent; FALSE if not (which could still
mean the two are equivalent by other means).   

References get_ref_base_and_extent(), ggc_alloc(), handled_component_p(), OEP_ADDRESS_OF, operand_equal_p(), TREE_CODE, TREE_TYPE, and types_compatible_p().

Referenced by hashable_expr_equal_p().

◆ hashable_expr_equal_p()

static bool hashable_expr_equal_p ( const struct hashable_expr * expr0,
const struct hashable_expr * expr1 )
Header file for SSA dominator optimizations.
   Copyright (C) 2013-2024 Free Software Foundation, Inc.

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

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
 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
Compare two hashable_expr structures for equivalence.  They are
considered equivalent when the expressions they denote must
necessarily be equal.  The logic is intended to follow that of
operand_equal_p in fold-const.cc  

References cfun, commutative_ternary_tree_code(), commutative_tree_code(), CONVERT_EXPR_CODE_P, element_precision(), equal_mem_array_ref_p(), EXPR_BINARY, EXPR_CALL, EXPR_PHI, EXPR_SINGLE, EXPR_TERNARY, EXPR_UNARY, gcc_unreachable, ggc_alloc(), gimple_call_same_target_p(), i, lookup_stmt_eh_lp(), NULL_TREE, operand_equal_p(), stmt_could_throw_p(), TREE_CODE, TREE_TYPE, TYPE_MODE, TYPE_PRECISION, and TYPE_UNSIGNED.

Referenced by expr_elt_hasher::equal().

◆ initialize_expr_from_cond()

void initialize_expr_from_cond ( tree cond,
struct hashable_expr * expr )
Given a conditional expression COND as a tree, initialize
a hashable_expr expression EXPR.  The conditional must be a
comparison or logical negation.  A constant or a variable is
not permitted.   

References boolean_type_node, COMPARISON_CLASS_P, EXPR_BINARY, EXPR_UNARY, gcc_unreachable, ggc_alloc(), expr::ops, TREE_CODE, TREE_OPERAND, and operand::type.

Referenced by record_conditions().

◆ record_conditions()

void record_conditions ( vec< cond_equivalence > * p,
tree cond,
tree inverted )
Record that COND is true and INVERTED is false into the edge information
structure.  Also record that any conditions dominated by COND are true
as well.

For example, if a < b is true, then a <= b must also be true.   

References boolean_false_node, boolean_true_node, build_and_record_new_cond(), COMPARISON_CLASS_P, cond_equivalence::cond, FLOAT_TYPE_P, ggc_alloc(), initialize_expr_from_cond(), TREE_CODE, TREE_OPERAND, TREE_TYPE, and cond_equivalence::value.

Referenced by edge_info::derive_equivalences(), and record_edge_info().

◆ vuse_eq()

static void * vuse_eq ( ao_ref * ,
tree vuse1,
void * data )
Helper for walk_non_aliased_vuses.  Determine if we arrived at
the desired memory state.   

References ggc_alloc(), and NULL.

Referenced by avail_exprs_stack::lookup_avail_expr().