SSA Dominator optimizations for trees
Copyright (C) 2001-2024 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.
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().