GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "cfghooks.h"
#include "tree-pass.h"
#include "ssa.h"
#include "tree-pretty-print.h"
#include "fold-const.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-pretty-print.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-ssa-loop.h"
#include "tree-into-ssa.h"
#include "cfgloop.h"
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
#include "tree-ssa-propagate.h"
#include "cfganal.h"
#include "sese.h"
DEBUG_FUNCTION void debug_edge | ( | const_edge | e | ) |
Pretty print edge E to STDERR.
References print_edge().
DEBUG_FUNCTION void debug_sese | ( | const sese_l & | s | ) |
Pretty print sese S to STDERR.
References print_sese().
void free_sese_info | ( | sese_info_p | region | ) |
Deletes REGION.
References BITMAP_FREE, and NULL.
edge get_false_edge_from_guard_bb | ( | basic_block | bb | ) |
Returns the first successor edge of BB with EDGE_TRUE_VALUE flag cleared.
References FOR_EACH_EDGE, gcc_unreachable, NULL, and basic_block_def::succs.
edge get_true_edge_from_guard_bb | ( | basic_block | bb | ) |
Returns the first successor edge of BB with EDGE_TRUE_VALUE flag set.
References FOR_EACH_EDGE, gcc_unreachable, NULL, and basic_block_def::succs.
Return true when T is defined outside REGION or when no definitions are variant in REGION. When HAS_VDEFS is a valid pointer, sets HAS_VDEFS to true when T depends on memory that may change in REGION.
References defined_in_sese_p(), FOR_EACH_SSA_USE_OPERAND, gimple_vdef(), gimple_vuse(), invariant_in_sese_p_rec(), SSA_NAME_DEF_STMT, SSA_OP_USE, and USE_FROM_PTR.
Referenced by invariant_in_sese_p_rec().
ifsese move_sese_in_condition | ( | sese_info_p | region | ) |
Moves REGION in a condition expression: | if (1) | ; | else | REGION;
References CDI_DOMINATORS, dom_info_available_p(), ifsese_s::false_region, find_edge(), gimple_build_cond(), GSI_CONTINUE_LINKING, gsi_insert_after(), gsi_last_bb(), integer_one_node, integer_zero_node, make_edge(), NULL_TREE, ifsese_s::region, set_immediate_dominator(), single_pred_edge(), single_succ_edge(), split_edge(), and ifsese_s::true_region.
sese_info_p new_sese_info | ( | edge | entry, |
edge | exit ) |
Builds a new SESE region from edges ENTRY and EXIT.
References NULL.
loop_p outermost_loop_in_sese | ( | sese_l & | region, |
basic_block | bb ) |
Same as outermost_loop_in_sese_1, returns the outermost loop containing BB in REGION, but makes sure that the returned loop belongs to the REGION, and so this returns the first loop in the REGION when the loop containing BB does not belong to REGION.
References gcc_assert, loop_in_sese_p(), and outermost_loop_in_sese_1().
class loop * outermost_loop_in_sese_1 | ( | sese_l & | region, |
basic_block | bb ) |
Returns the outermost loop in SCOP that contains BB.
References basic_block_def::loop_father, loop_in_sese_p(), and loop_outer().
Referenced by outermost_loop_in_sese().
void print_edge | ( | FILE * | file, |
const_edge | e ) |
Pretty print edge E to FILE.
Referenced by debug_edge(), and print_sese().
void print_sese | ( | FILE * | file, |
const sese_l & | s ) |
Pretty print sese S to FILE.
References sese_l::entry, sese_l::exit, and print_edge().
Referenced by debug_sese().
Returns the scalar evolution of T in REGION. Every variable that is not defined in the REGION is considered a parameter.
References analyze_scalar_evolution(), defined_in_sese_p(), sese_l::entry, instantiate_scev(), loop_in_sese_p(), NULL, and TREE_CODE.
Referenced by scev_analyzable_p().
Return true when DEF can be analyzed in REGION by the scalar evolution analyzer.
References chrec_contains_symbols_defined_in_loop(), chrec_contains_undetermined(), defined_in_sese_p(), INTEGRAL_TYPE_P, loop_containing_stmt(), loop_in_sese_p(), loop::num, POINTER_TYPE_P, scalar_evolution_in_region(), scev_is_linear_expression(), SSA_NAME_DEF_STMT, TREE_CODE, and TREE_TYPE.
|
static |
Add exit phis for USE on EXIT.
References add_phi_arg(), create_new_def_for(), create_phi_node(), gimple_phi_result_ptr(), NULL_TREE, UNKNOWN_LOCATION, and update_stmt().
Referenced by sese_insert_phis_for_liveouts().
void sese_build_liveouts | ( | sese_info_p | region | ) |
Build the LIVEOUTS of REGION: the set of variables defined inside and used outside the REGION.
References bb_in_sese_p(), BITMAP_ALLOC, cfun, FOR_EACH_BB_FN, gcc_assert, NULL, and sese_build_liveouts_bb().
|
static |
Marks for rewrite all the SSA_NAMES defined in REGION and that are used in BB that is outside of the REGION.
References FOR_EACH_PHI_ARG, FOR_EACH_SSA_USE_OPERAND, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), sese_build_liveouts_use(), SSA_OP_USE, and USE_FROM_PTR.
Referenced by sese_build_liveouts().
|
static |
Single entry single exit control flow regions. Copyright (C) 2008-2024 Free Software Foundation, Inc. Contributed by Jan Sjodin <jan.sjodin@amd.com> and Sebastian Pop <sebastian.pop@amd.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/>.
For a USE in BB, if BB is outside REGION, mark the USE in the LIVEOUTS set.
References bb_in_sese_p(), bitmap_set_bit, gcc_assert, gimple_bb(), SSA_NAME_DEF_STMT, SSA_NAME_VERSION, and TREE_CODE.
Referenced by sese_build_liveouts_bb().
void sese_insert_phis_for_liveouts | ( | sese_info_p | region, |
basic_block | bb, | ||
edge | false_e, | ||
edge | true_e ) |
Insert in the block BB phi nodes for variables defined in REGION and used outside the REGION. The code generation moves REGION in the else clause of an "if (1)" and generates code in the then clause that is at this point empty: | if (1) | empty; | else | REGION;
References EXECUTE_IF_SET_IN_BITMAP, i, MAY_HAVE_DEBUG_BIND_STMTS, sese_add_exit_phis_edge(), sese_reset_debug_liveouts(), ssa_name, and virtual_operand_p().
|
static |
Reset debug stmts that reference SSA_NAMES defined in REGION that are not marked as liveouts.
References bb_in_sese_p(), EXECUTE_IF_AND_COMPL_IN_BITMAP, FOR_EACH_IMM_USE_STMT, gimple_bb(), gimple_debug_bind_reset_value(), i, is_gimple_debug(), ssa_name, and update_stmt().
Referenced by sese_insert_phis_for_liveouts().
bool sese_trivially_empty_bb_p | ( | basic_block | bb | ) |
Return true if BB is empty, contains only DEBUG_INSNs.
References gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), and is_gimple_debug().
Replaces the condition of the IF_REGION with CONDITION: | if (CONDITION) | true_region; | else | false_region;
References force_gimple_operand_gsi_1(), gcc_assert, gimple_build_cond_from_tree(), gsi_insert_before(), gsi_last_bb(), gsi_remove(), GSI_SAME_STMT, is_gimple_condexpr_for_cond(), NULL_TREE, and ifsese_s::region.