GCC Middle and Back End API Reference
edge_info Class Reference
Collaboration diagram for edge_info:

Public Types

typedef std::pair< tree, treeequiv_pair
 

Public Member Functions

 edge_info (edge)
 
 ~edge_info ()
 
void record_simple_equiv (tree, tree)
 

Data Fields

vec< equiv_pairsimple_equivalences
 
vec< cond_equivalencecond_equivalences
 

Private Member Functions

void derive_equivalences (tree, tree, int)
 

Detailed Description

SSA Dominator optimizations for trees Copyright (C) 2001-2025 Free Software Foundation, Inc. Contributed by Diego Novillo <dnovillo@redhat.com> 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 file implements optimizations on the dominator tree.
Structure for recording edge equivalences. Computing and storing the edge equivalences instead of creating them on-demand can save significant amounts of time, particularly for pathological cases involving switch statements. These structures live for a single iteration of the dominator optimizer in the edge's AUX field. At the end of an iteration we free each of these structures.

Member Typedef Documentation

◆ equiv_pair

typedef std::pair<tree, tree> edge_info::equiv_pair

Constructor & Destructor Documentation

◆ edge_info()

edge_info::edge_info ( edge e)
Constructor for EDGE_INFO. An EDGE_INFO instance is always associated with an edge E.

References cond_equivalences, free_dom_edge_info(), simple_equivalences, and vNULL.

◆ ~edge_info()

edge_info::~edge_info ( void )
Destructor just needs to release the vectors.

References cond_equivalences, and simple_equivalences.

Member Function Documentation

◆ derive_equivalences()

void edge_info::derive_equivalences ( tree name,
tree value,
int recursion_limit )
private
NAME is known to have the value VALUE, which must be a constant. Walk through its use-def chain to see if there are other equivalences we might be able to derive. RECURSION_LIMIT controls how far back we recurse through the use-def chains.

References boolean_type_node, build2(), build_one_cst(), build_zero_cst(), CASE_CONVERT, cond_equivalences, derive_equivalences(), fold_binary, fold_build1, fold_convert, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), int_fits_type_p(), integer_onep(), integer_zerop(), INTEGRAL_TYPE_P, invert_truthvalue, is_gimple_assign(), record_conditions(), simple_equivalences, SSA_NAME_DEF_STMT, ssa_name_has_boolean_range(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_INT_CST_LOW, TREE_TYPE, and TYPE_PRECISION.

Referenced by derive_equivalences(), and record_simple_equiv().

◆ record_simple_equiv()

void edge_info::record_simple_equiv ( tree lhs,
tree rhs )

Field Documentation

◆ cond_equivalences

◆ simple_equivalences


The documentation for this class was generated from the following file: