|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "cfghooks.h"#include "tree.h"#include "gimple.h"#include "predict.h"#include "ssa.h"#include "fold-const.h"#include "cfgloop.h"#include "gimple-iterator.h"#include "tree-cfg.h"#include "tree-ssa-threadupdate.h"#include "tree-ssa-scopedtables.h"#include "tree-ssa-threadedge.h"#include "gimple-fold.h"#include "cfganal.h"#include "alloc-pool.h"#include "vr-values.h"#include "gimple-range.h"#include "gimple-range-path.h"
Functions | |
| void | set_ssa_name_value (tree name, tree value) |
| static bool | has_phis_p (basic_block bb) |
| static bool | empty_block_with_phis_p (basic_block bb) |
| static bool | potentially_threadable_block (basic_block bb) |
| static tree | threadedge_valueize (tree t) |
| void | propagate_threaded_block_debug_into (basic_block dest, basic_block src) |
| static bool | edge_forwards_cmp_to_conditional_jump_through_empty_bb_p (edge e) |
| bool | cond_on_phi_p (basic_block bb, gcond **cond_out, gphi **phi_out) |
| bool | phi_arg_from_cmp_p (gphi *phi, edge e) |
| bool | single_succ_to_potentially_threadable_block (basic_block bb) |
Variables | |
| static int | stmt_count |
| vec< tree > | ssa_name_values |
| bool cond_on_phi_p | ( | basic_block | bb, |
| gcond ** | cond_out, | ||
| gphi ** | phi_out ) |
Return true if BB contains only a conditional jump on a PHI defined in it, compared against 0 or 1: <bb 5>: # t_1 = PHI <t_9(3), t_6(4)> if (t_1 != 0) The conditional and the PHI are returned in *COND_OUT and *PHI_OUT.
References cond_on_phi_p(), dyn_cast(), gimple_bb(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), integer_onep(), integer_zerop(), last_and_only_stmt(), NULL, safe_dyn_cast(), SSA_NAME_DEF_STMT, and TREE_CODE.
Referenced by cond_on_phi_p(), edge_forwards_cmp_to_conditional_jump_through_empty_bb_p(), and replicate_conds_over_phis().
There are basic blocks look like: <P0> p0 = a CMP b ; or p0 = (INT) (a CMP b) goto <X>; <P1> p1 = c CMP d goto <X>; <X> # phi = PHI <p0 (P0), p1 (P1)> if (phi != 0) goto <Y>; else goto <Z>; Then, edge (P0,X) or (P1,X) could be marked as EDGE_START_JUMP_THREAD And edge (X,Y), (X,Z) is EDGE_COPY_SRC_JOINER_BLOCK Return true if E is (P0,X) or (P1,X)
References cond_on_phi_p(), edge_forwards_cmp_to_conditional_jump_through_empty_bb_p(), and phi_arg_from_cmp_p().
Referenced by edge_forwards_cmp_to_conditional_jump_through_empty_bb_p(), and jump_threader::thread_across_edge().
|
static |
Return TRUE for a block with PHIs but no statements.
References empty_block_with_phis_p(), gsi_end_p(), gsi_start_nondebug_bb(), and has_phis_p().
Referenced by empty_block_with_phis_p(), potentially_threadable_block(), and jump_threader::thread_through_normal_block().
|
inlinestatic |
References gsi_end_p(), gsi_start_phis(), and has_phis_p().
Referenced by empty_block_with_phis_p(), has_phis_p(), and jump_threader::thread_around_empty_blocks().
Return true if PHI's incoming value on edge E is a single-use
comparison, possibly through a single-use conversion:
<bb 3>:
t_9 = a < b;
goto <bb 5>;
<bb 5>:
# t_1 = PHI <t_9(3), ...>
References CONVERT_EXPR_CODE_P, dyn_cast(), gimple_assign_rhs1(), gimple_assign_rhs_code(), has_single_use(), PHI_ARG_DEF_FROM_EDGE, phi_arg_from_cmp_p(), SSA_NAME_DEF_STMT, tcc_comparison, TREE_CODE, and TREE_CODE_CLASS.
Referenced by edge_forwards_cmp_to_conditional_jump_through_empty_bb_p(), phi_arg_from_cmp_p(), and replicate_conds_over_phis().
|
static |
Return TRUE if we may be able to thread an incoming edge into BB to an outgoing edge from BB. Return FALSE otherwise.
References empty_block_with_phis_p(), gsi_end_p(), gsi_last_bb(), gsi_stmt(), potentially_threadable_block(), single_pred_p(), and single_succ_p().
Referenced by potentially_threadable_block(), single_succ_to_potentially_threadable_block(), and jump_threader::thread_outgoing_edges().
| void propagate_threaded_block_debug_into | ( | basic_block | dest, |
| basic_block | src ) |
Copy debug stmts from DEST's chain of single predecessors up to SRC, so that we don't lose the bindings as PHI nodes are introduced when DEST gains new predecessors.
References hash_set< KeyId, Lazy, Traits >::add(), gcc_checking_assert, gcc_unreachable, gimple_copy(), gimple_debug_bind_get_var(), gimple_debug_bind_p(), gimple_debug_nonbind_marker_p(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), gsi_after_labels(), gsi_end_p(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_prev(), gsi_stmt(), i, is_gimple_debug(), MAY_HAVE_DEBUG_BIND_STMTS, NULL, propagate_threaded_block_debug_into(), si, single_pred(), and single_pred_p().
Referenced by propagate_threaded_block_debug_into(), and jump_threader::thread_across_edge().
Set the value for the SSA name NAME to VALUE.
References drop_tree_overflow(), set_ssa_name_value(), ssa_name_values, SSA_NAME_VERSION, and TREE_OVERFLOW_P.
Referenced by const_and_copies::pop_to_marker(), const_and_copies::record_const_or_copy_raw(), record_equivalences_from_phis(), record_equivalences_from_stmt(), and set_ssa_name_value().
| bool single_succ_to_potentially_threadable_block | ( | basic_block | bb | ) |
Return TRUE if BB has a single successor to a block with multiple incoming and outgoing edges.
References EDGE_COMPLEX, potentially_threadable_block(), single_succ(), single_succ_edge(), single_succ_p(), and single_succ_to_potentially_threadable_block().
Referenced by single_succ_to_potentially_threadable_block(), and jump_threader::thread_outgoing_edges().
Valueize hook for gimple_fold_stmt_to_constant_1.
References SSA_NAME_VALUE, threadedge_valueize(), and TREE_CODE.
Referenced by jt_state::register_equivs_stmt(), and threadedge_valueize().
Array to record value-handles per SSA_NAME.
Referenced by jump_threader::jump_threader(), set_ssa_name_value(), and jump_threader::~jump_threader().
|
static |
SSA Jump Threading Copyright (C) 2005-2026 Free Software Foundation, Inc. Contributed by Jeff Law <law@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/>.
To avoid code explosion due to jump threading, we limit the number of statements we are going to copy. This variable holds the number of statements currently seen that we'll have to copy as part of the jump threading process.
Referenced by jump_threader::record_temporary_equivalences_from_phis(), jump_threader::record_temporary_equivalences_from_stmts_at_dest(), and jump_threader::thread_across_edge().