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:

Namespaces

namespace  inchash
 

Functions

static bool hashable_expr_equal_p (const struct hashable_expr *, const struct hashable_expr *)
 
static void * vuse_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)
static
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(), inchash::hash::add_object(), inchash::hash::end(), expr_hash_elt::expr(), EXPR_SINGLE, get_ref_base_and_extent(), 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 )
static

◆ equal_mem_array_ref_p()

static bool equal_mem_array_ref_p ( tree t0,
tree t1 )
static
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(), 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 )
static
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
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/>.   
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 hashable_expr::args, hashable_expr::binary, hashable_expr::call, 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, hashable_expr::fn_from, gcc_unreachable, gimple_call_same_target_p(), i, hashable_expr::kind, lookup_stmt_eh_lp(), hashable_expr::nargs, NULL_TREE, hashable_expr::op, operand_equal_p(), hashable_expr::opnd, hashable_expr::opnd0, hashable_expr::opnd1, hashable_expr::opnd2, hashable_expr::ops, hashable_expr::phi, hashable_expr::pure, hashable_expr::rhs, hashable_expr::single, stmt_could_throw_p(), hashable_expr::ternary, TREE_CODE, TREE_TYPE, hashable_expr::type, TYPE_MODE, TYPE_PRECISION, TYPE_UNSIGNED, and hashable_expr::unary.

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, 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, 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 )
static
Helper for walk_non_aliased_vuses.  Determine if we arrived at
the desired memory state.   

References NULL.