GCC Middle and Back End API Reference
ssa-iterators.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  imm_use_iterator
 
struct  auto_end_imm_use_stmt_traverse
 
struct  ssa_op_iter
 

Macros

#define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR)
 
#define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR)
 
#define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER)
 
#define SSA_OP_USE   0x01 /* Real USE operands. @endverbatim */
 
#define SSA_OP_DEF   0x02 /* Real DEF operands. @endverbatim */
 
#define SSA_OP_VUSE   0x04 /* VUSE operands. @endverbatim */
 
#define SSA_OP_VDEF   0x08 /* VDEF operands. @endverbatim */
 
#define SSA_OP_VIRTUAL_USES   (SSA_OP_VUSE)
 
#define SSA_OP_VIRTUAL_DEFS   (SSA_OP_VDEF)
 
#define SSA_OP_ALL_VIRTUALS   (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS)
 
#define SSA_OP_ALL_USES   (SSA_OP_VIRTUAL_USES | SSA_OP_USE)
 
#define SSA_OP_ALL_DEFS   (SSA_OP_VIRTUAL_DEFS | SSA_OP_DEF)
 
#define SSA_OP_ALL_OPERANDS   (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)
 
#define FOR_EACH_SSA_TREE_OPERAND(TREEVAR, STMT, ITER, FLAGS)
 
#define FOR_EACH_SSA_USE_OPERAND(USEVAR, STMT, ITER, FLAGS)
 
#define FOR_EACH_SSA_DEF_OPERAND(DEFVAR, STMT, ITER, FLAGS)
 
#define FOR_EACH_PHI_ARG(USEVAR, STMT, ITER, FLAGS)
 
#define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS)
 
#define FOR_EACH_PHI_OR_STMT_DEF(DEFVAR, STMT, ITER, FLAGS)
 
#define SINGLE_SSA_TREE_OPERAND(STMT, FLAGS)
 
#define SINGLE_SSA_USE_OPERAND(STMT, FLAGS)
 
#define SINGLE_SSA_DEF_OPERAND(STMT, FLAGS)
 
#define ZERO_SSA_OPERANDS(STMT, FLAGS)
 
#define NUM_SSA_OPERANDS(STMT, FLAGS)
 

Enumerations

enum  ssa_op_iter_type { ssa_op_iter_none = 0 , ssa_op_iter_tree , ssa_op_iter_use , ssa_op_iter_def }
 

Functions

void end_imm_use_stmt_traverse (imm_use_iterator *)
 
bool single_imm_use_1 (const ssa_use_operand_t *head, use_operand_p *use_p, gimple **stmt)
 
void delink_imm_use (ssa_use_operand_t *linknode)
 
void link_imm_use_to_list (ssa_use_operand_t *linknode, ssa_use_operand_t *list)
 
void link_imm_use (ssa_use_operand_t *linknode, tree def)
 
void set_ssa_use_from_ptr (use_operand_p use, tree val)
 
void link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, gimple *stmt)
 
void relink_imm_use (ssa_use_operand_t *node, ssa_use_operand_t *old)
 
void relink_imm_use_stmt (ssa_use_operand_t *linknode, ssa_use_operand_t *old, gimple *stmt)
 
bool end_readonly_imm_use_p (const imm_use_iterator *imm)
 
use_operand_p first_readonly_imm_use (imm_use_iterator *imm, tree var)
 
use_operand_p next_readonly_imm_use (imm_use_iterator *imm)
 
bool has_zero_uses (const_tree var)
 
bool has_single_use (const_tree var)
 
bool single_imm_use (const_tree var, use_operand_p *use_p, gimple **stmt)
 
unsigned int num_imm_uses (const_tree var)
 
bool op_iter_done (const ssa_op_iter *ptr)
 
use_operand_p op_iter_next_use (ssa_op_iter *ptr)
 
def_operand_p op_iter_next_def (ssa_op_iter *ptr)
 
tree op_iter_next_tree (ssa_op_iter *ptr)
 
void clear_and_done_ssa_iter (ssa_op_iter *ptr)
 
void op_iter_init (ssa_op_iter *ptr, gimple *stmt, int flags)
 
use_operand_p op_iter_init_use (ssa_op_iter *ptr, gimple *stmt, int flags)
 
def_operand_p op_iter_init_def (ssa_op_iter *ptr, gimple *stmt, int flags)
 
tree op_iter_init_tree (ssa_op_iter *ptr, gimple *stmt, int flags)
 
tree single_ssa_tree_operand (gimple *stmt, int flags)
 
use_operand_p single_ssa_use_operand (gimple *stmt, int flags)
 
use_operand_p ssa_vuse_operand (gimple *stmt)
 
def_operand_p single_ssa_def_operand (gimple *stmt, int flags)
 
bool zero_ssa_operands (gimple *stmt, int flags)
 
int num_ssa_operands (gimple *stmt, int flags)
 
tree single_phi_def (gphi *stmt, int flags)
 
use_operand_p op_iter_init_phiuse (ssa_op_iter *ptr, gphi *phi, int flags)
 
def_operand_p op_iter_init_phidef (ssa_op_iter *ptr, gphi *phi, int flags)
 
bool end_imm_use_stmt_p (const imm_use_iterator *imm)
 
use_operand_p move_use_after_head (use_operand_p use_p, use_operand_p head, use_operand_p last_p)
 
void link_use_stmts_after (use_operand_p head, imm_use_iterator *imm)
 
gimplefirst_imm_use_stmt (imm_use_iterator *imm, tree var)
 
gimplenext_imm_use_stmt (imm_use_iterator *imm)
 
use_operand_p first_imm_use_on_stmt (imm_use_iterator *imm)
 
bool end_imm_use_on_stmt_p (const imm_use_iterator *imm)
 
use_operand_p next_imm_use_on_stmt (imm_use_iterator *imm)
 
void delink_stmt_imm_use (gimple *stmt)
 

Macro Definition Documentation

◆ FOR_EACH_IMM_USE_FAST

#define FOR_EACH_IMM_USE_FAST ( DEST,
ITER,
SSAVAR )
Value:
for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
!end_readonly_imm_use_p (&(ITER)); \
(void) ((DEST) = next_readonly_imm_use (&(ITER))))
#define SSAVAR(x)
Definition cfgexpand.cc:151
use_operand_p first_readonly_imm_use(imm_use_iterator *imm, tree var)
Definition ssa-iterators.h:352
use_operand_p next_readonly_imm_use(imm_use_iterator *imm)
Definition ssa-iterators.h:364
bool end_readonly_imm_use_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:345
Use this iterator when simply looking at stmts.  Adding, deleting or
modifying stmts will cause this iterator to malfunction.   

Referenced by add_ssa_edge(), all_immediate_uses_same_place(), all_uses_feed_or_dominated_by_stmt(), loop_cand::analyze_iloop_reduction_var(), loop_cand::analyze_oloop_reduction_var(), back_propagate_equivalences(), check_forbidden_calls(), check_loop_closed_ssa_def(), check_scan_store(), cleanup_empty_eh_merge_phis(), compute_added_num_insns(), convert_mult_to_fma(), create_rdg_edges_for_scalar(), do_warn_nonnull_compare(), dse_classify_store(), dump_immediate_uses_for(), execute_cse_reciprocals_1(), expand_gimple_basic_block(), crc_optimization::find_shift_after_xor(), find_uninit_use(), fully_replaceable(), get_reassociation_width(), gimple_lower_bitint(), ifcvt_local_dce(), insert_debug_temp_for_var_def(), is_cond_scalar_reduction(), is_factor_profitable(), is_feasible_trace(), ipa_param_body_adjustments::mark_clobbers_dead(), ipa_param_body_adjustments::mark_dead_statements(), mark_ssa_maybe_undefs(), match_arith_overflow(), match_uaddc_usubc(), maybe_duplicate_comparison(), maybe_optimize_arith_overflow(), maybe_optimize_mod_cmp(), maybe_push_to_hybrid_worklist(), maybe_set_vectorized_backedge_value(), maybe_warn_operand(), nearest_common_dominator_of_uses(), no_side_effect_bb(), optimize_mask_stores(), optimize_successive_divisions_p(), optimize_vector_load(), parloops_is_simple_reduction(), parloops_is_slp_reduction(), prepare_use_sites_for(), propagate_bias_p(), propagate_with_phi(), infer_range_manager::register_all_uses(), remove_unreachable::remove_and_update_globals(), set_var_live_on_entry(), pcom_worker::single_nonlooparound_use(), single_trailing_store_in_bb(), single_use_in_loop(), sink_common_stores_to_bb(), spaceship_replacement(), ssa_name_any_use_dominates_bb_p(), ssa_name_has_uses_outside_loop_p(), statement_sink_location(), stmt_local_def(), trivially_conflicts_p(), try_create_reduction_list(), unroll_jam_possible_p(), use_in_zero_equality(), used_outside_loop_p(), uses_in_bb(), var_is_used_for_virtual_call_p(), vect_build_slp_instance(), vect_create_epilog_for_reduction(), vect_determine_min_output_precision_1(), vect_is_simple_reduction(), vect_phi_first_order_recurrence_p(), vect_stmt_relevant_p(), vectorizable_induction(), vectorizable_scan_store(), and warn_uninit_phi_uses().

◆ FOR_EACH_IMM_USE_ON_STMT

#define FOR_EACH_IMM_USE_ON_STMT ( DEST,
ITER )
Value:
for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
!end_imm_use_on_stmt_p (&(ITER)); \
(void) ((DEST) = next_imm_use_on_stmt (&(ITER))))
use_operand_p first_imm_use_on_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:972
use_operand_p next_imm_use_on_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:989
bool end_imm_use_on_stmt_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:981
Use this iterator in combination with FOR_EACH_IMM_USE_STMT to
get access to each occurrence of ssavar on the stmt returned by
that iterator..  for instance:

  FOR_EACH_IMM_USE_STMT (stmt, iter, ssavar)
    {
      FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
        {
          SET_USE (use_p, blah);
        }
      update_stmt (stmt);
    }                                                     

Referenced by adjust_debug_stmts_now(), check_reduction_path(), clean_up_loop_closed_phi(), combine_blocks(), execute_cse_reciprocals_1(), expand_gimple_basic_block(), fold_loop_internal_call(), generate_reduction_builtin_1(), gimple_lower_bitint(), gimple_merge_blocks(), insert_backedge_copies(), insert_debug_temp_for_var_def(), insert_phi_nodes(), ipa_analyze_controlled_uses(), make_new_ssa_for_def(), tree_loop_interchange::map_inductions_to_loop(), mark_virtual_operand_for_renaming(), maybe_optimize_range_tests(), move_block_to_fn(), move_early_exit_stmts(), optimize_atomic_bit_test_and(), record_equivalences_from_phis(), remove_dead_phis(), remove_unused_ivs(), replace_uses_by(), replace_uses_in_bb_by(), ipa_param_body_adjustments::reset_debug_stmts(), shrink_wrap_one_built_in_call_with_conds(), simd_clone_adjust(), sink_clobbers(), sink_code_in_bb(), loop_cand::undo_simple_reduction(), unlink_stmt_vdef(), unsplit_eh(), value_replacement(), vect_create_epilog_for_reduction(), vectorizable_live_operation(), and verify_bb_vtables().

◆ FOR_EACH_IMM_USE_STMT

#define FOR_EACH_IMM_USE_STMT ( STMT,
ITER,
SSAVAR )
Value:
((((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR))), \
&(ITER))); \
!end_imm_use_stmt_p (&(ITER)); \
(void) ((STMT) = next_imm_use_stmt (&(ITER))))
gimple * first_imm_use_stmt(imm_use_iterator *imm, tree var)
Definition ssa-iterators.h:929
gimple * next_imm_use_stmt(imm_use_iterator *imm)
Definition ssa-iterators.h:954
bool end_imm_use_stmt_p(const imm_use_iterator *imm)
Definition ssa-iterators.h:842
Definition ssa-iterators.h:86
Use this iterator to visit each stmt which has a use of SSAVAR.  The
destructor of the auto_end_imm_use_stmt_traverse object deals with removing
ITER from SSAVAR's IMM_USE list even when leaving the scope early.   

Referenced by adjust_debug_stmts_now(), asan_expand_poison_ifn(), base_names_in_chain_on(), check_reduction_path(), check_retval_uses(), clean_up_loop_closed_phi(), combine_blocks(), compute_dependence_clique(), convert_mult_to_fma_1(), convert_to_divmod(), dse_optimize_call(), dse_optimize_redundant_stores(), eliminate_unnecessary_stmts(), execute_cse_conv_1(), execute_cse_reciprocals_1(), execute_cse_sincos_1(), expand_gimple_basic_block(), find_implicit_erroneous_behavior(), fold_loop_internal_call(), forward_propagate_addr_expr(), generate_reduction_builtin_1(), gimple_lower_bitint(), gimple_merge_blocks(), handle_return_addr_local_phi_arg(), insert_backedge_copies(), insert_clobber_before_stack_restore(), insert_debug_temp_for_var_def(), insert_phi_nodes(), ipa_analyze_controlled_uses(), crc_symbolic_execution::is_used_outside_the_loop(), make_new_ssa_for_def(), tree_loop_interchange::map_inductions_to_loop(), mark_virtual_operand_for_renaming(), match_arith_overflow(), maybe_optimize_arith_overflow(), maybe_optimize_range_tests(), move_block_to_fn(), move_early_exit_stmts(), neuter_worker_single(), note_simd_array_uses(), optimize_atomic_bit_test_and(), optimize_recip_sqrt(), optimize_vector_load(), phivn_valid_p(), predicate_rhs_code(), propagate_with_phi(), purge_all_uses(), record_equivalences_from_phis(), release_defs_bitset(), remove_dead_phis(), remove_unused_ivs(), replace_uses_by(), replace_uses_in_bb_by(), ipa_param_body_adjustments::reset_debug_stmts(), reset_debug_uses(), sese_reset_debug_liveouts(), shrink_wrap_one_built_in_call_with_conds(), simd_clone_adjust(), simple_dce_from_worklist(), simplify_builtin_call(), sink_clobbers(), sink_code_in_bb(), loop_cand::undo_simple_reduction(), unlink_stmt_vdef(), unsplit_eh(), uses_consumed_by_stmt(), value_replacement(), vec_slp_has_scalar_use(), vect_bb_slp_mark_live_stmts(), vect_bb_slp_scalar_cost(), vect_create_epilog_for_reduction(), vect_do_peeling(), vect_loop_kill_debug_uses(), vectorizable_live_operation(), and verify_bb_vtables().

◆ FOR_EACH_PHI_ARG

#define FOR_EACH_PHI_ARG ( USEVAR,
STMT,
ITER,
FLAGS )
Value:
for ((USEVAR) = op_iter_init_phiuse (&(ITER), STMT, FLAGS); \
!op_iter_done (&(ITER)); \
(USEVAR) = op_iter_next_use (&(ITER)))
use_operand_p op_iter_init_phiuse(ssa_op_iter *ptr, gphi *phi, int flags)
Definition ssa-iterators.h:782
use_operand_p op_iter_next_use(ssa_op_iter *ptr)
Definition ssa-iterators.h:487
bool op_iter_done(const ssa_op_iter *ptr)
Definition ssa-iterators.h:480
This macro will execute a loop over all the arguments of a PHI which
match FLAGS.   A use_operand_p is always returned via USEVAR.  FLAGS
can be either SSA_OP_USE or SSA_OP_VIRTUAL_USES or SSA_OP_ALL_USES.   

Referenced by add_scope_conflicts_1(), check_all_va_list_escapes(), determine_max_movement(), find_deriving_biv_for_expr(), find_ssa_names_to_propagate(), ifcombine_replace_cond(), last_fma_candidate_feeds_initial_phi(), link_use_stmts_after(), move_block_to_fn(), optimize_va_list_gpr_fpr_size(), propagate_with_phi(), remove_gimple_phi_args(), remove_unused_locals(), sese_build_liveouts_bb(), and vect_inner_phi_in_double_reduction_p().

◆ FOR_EACH_PHI_OR_STMT_DEF

#define FOR_EACH_PHI_OR_STMT_DEF ( DEFVAR,
STMT,
ITER,
FLAGS )
Value:
for ((DEFVAR) = (gimple_code (STMT) == GIMPLE_PHI \
? op_iter_init_phidef (&(ITER), \
as_a <gphi *> (STMT), \
FLAGS) \
: op_iter_init_def (&(ITER), STMT, FLAGS)); \
!op_iter_done (&(ITER)); \
(DEFVAR) = op_iter_next_def (&(ITER)))
gimple_code
Definition gimple.h:30
T as_a(U *p)
Definition is-a.h:253
def_operand_p op_iter_next_def(ssa_op_iter *ptr)
Definition ssa-iterators.h:507
def_operand_p op_iter_init_def(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:656
def_operand_p op_iter_init_phidef(ssa_op_iter *ptr, gphi *phi, int flags)
Definition ssa-iterators.h:812
This macro will execute a loop over a stmt, regardless of whether it is
a real stmt or a PHI node, looking at the DEF nodes matching FLAGS.   

Referenced by create_rdg_flow_edges(), insert_debug_temps_for_defs(), maybe_push_to_hybrid_worklist(), reset_debug_uses(), separate_decls_in_region_stmt(), vect_bb_slp_mark_live_stmts(), vect_bb_slp_scalar_cost(), vect_loop_kill_debug_uses(), and vect_stmt_relevant_p().

◆ FOR_EACH_PHI_OR_STMT_USE

#define FOR_EACH_PHI_OR_STMT_USE ( USEVAR,
STMT,
ITER,
FLAGS )
Value:
for ((USEVAR) = (gimple_code (STMT) == GIMPLE_PHI \
? op_iter_init_phiuse (&(ITER), \
as_a <gphi *> (STMT), \
FLAGS) \
: op_iter_init_use (&(ITER), STMT, FLAGS)); \
!op_iter_done (&(ITER)); \
(USEVAR) = op_iter_next_use (&(ITER)))
use_operand_p op_iter_init_use(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:644
This macro will execute a loop over a stmt, regardless of whether it is
a real stmt or a PHI node, looking at the USE nodes matching FLAGS.   

Referenced by compute_added_num_insns(), convert_mult_to_fma(), delink_stmt_imm_use(), find_interesting_uses_stmt(), find_invariants_stmt(), ifcvt_local_dce(), tree_loop_interchange::map_inductions_to_loop(), movement_possibility(), ipa_param_body_adjustments::prepare_debug_expressions(), separate_decls_in_region_debug(), separate_decls_in_region_stmt(), simple_dce_from_worklist(), update_debug_stmt(), and vect_mark_stmts_to_be_vectorized().

◆ FOR_EACH_SSA_DEF_OPERAND

#define FOR_EACH_SSA_DEF_OPERAND ( DEFVAR,
STMT,
ITER,
FLAGS )
Value:
for (DEFVAR = op_iter_init_def (&(ITER), STMT, FLAGS); \
!op_iter_done (&(ITER)); \
DEFVAR = op_iter_next_def (&(ITER)))
This macro executes a loop over the operands of STMT specified in FLAG,
returning each operand as a 'def_operand_p' in the variable DEFVAR.
ITER is an ssa_op_iter structure used to control the loop.   

Referenced by defs_to_varying(), gimple_duplicate_bb(), insert_phi_nodes(), ipa_param_body_adjustments::modify_cfun_body(), prepare_block_for_update_1(), release_defs_bitset(), rewrite_stmt(), rewrite_update_stmt(), stmt_has_scalar_dependences_outside_loop(), and vect_do_peeling().

◆ FOR_EACH_SSA_TREE_OPERAND

#define FOR_EACH_SSA_TREE_OPERAND ( TREEVAR,
STMT,
ITER,
FLAGS )
Value:
for (TREEVAR = op_iter_init_tree (&(ITER), STMT, FLAGS); \
!op_iter_done (&(ITER)); \
(void) (TREEVAR = op_iter_next_tree (&(ITER))))
tree op_iter_init_tree(ssa_op_iter *ptr, gimple *stmt, int flags)
Definition ssa-iterators.h:668
tree op_iter_next_tree(ssa_op_iter *ptr)
Definition ssa-iterators.h:542
This macro executes a loop over the operands of STMT specified in FLAG,
returning each operand as a 'tree' in the variable TREEVAR.  ITER is an
ssa_op_iter structure used to control the loop.   

Referenced by auto_flow_sensitive::auto_flow_sensitive(), bb_no_side_effects_p(), build_bitint_stmt_ssa_conflicts(), build_ssa_conflict_graph(), ccp_initialize(), check_all_va_list_escapes(), check_loop_closed_ssa_bb(), combine_blocks(), compute_avail(), determine_max_movement(), eliminate_dom_walker::eliminate_stmt(), empty_bb_or_one_feeding_into_p(), empty_bb_without_guard_p(), expand_gimple_basic_block(), expand_simple_operations(), find_loop_guard(), find_necessary_statements(), find_replaceable_in_bb(), find_unswitching_predicates_for_bb(), find_uses_to_rename_stmt(), fp_expression_p(), get_rank(), gimple_lower_bitint(), has_use_on_stmt(), hoist_defs_of_uses(), ifcombine_replace_cond(), init_copy_prop(), is_simple_and_all_uses_invariant(), simplify_using_ranges::legacy_fold_cond(), likely_value(), mark_def_sites(), back_threader::maybe_thread_block(), num_ssa_operands(), process_bb(), process_replaceable(), propagate_necessity(), release_defs(), reset_flow_sensitive_info_in_bb(), should_duplicate_loop_header_p(), split_function(), stmt_semi_invariant_p_1(), verify_ssa(), verify_ssaname_freelists(), visit_bb(), ccp_propagate::visit_stmt(), copy_prop::visit_stmt(), will_be_nonconstant_predicate(), and worker_single_simple().

◆ FOR_EACH_SSA_USE_OPERAND

◆ NUM_SSA_OPERANDS

#define NUM_SSA_OPERANDS ( STMT,
FLAGS )
Value:
num_ssa_operands (STMT, FLAGS)
int num_ssa_operands(gimple *stmt, int flags)
Definition ssa-iterators.h:754
This macro counts the number of operands in STMT matching FLAGS.   

Referenced by collect_dfa_stats(), and jt_state::register_equivs_stmt().

◆ SINGLE_SSA_DEF_OPERAND

#define SINGLE_SSA_DEF_OPERAND ( STMT,
FLAGS )
Value:
single_ssa_def_operand (STMT, FLAGS)
def_operand_p single_ssa_def_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:725
This macro returns an operand in STMT as a def_operand_p if it is the ONLY
operand matching FLAGS.  If there are 0 or more than 1 operand matching
FLAGS, then NULL_DEF_OPERAND_P is returned.   

Referenced by expand_gimple_basic_block(), and stmt_local_def().

◆ SINGLE_SSA_TREE_OPERAND

#define SINGLE_SSA_TREE_OPERAND ( STMT,
FLAGS )
Value:
tree single_ssa_tree_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:679
This macro returns an operand in STMT as a tree if it is the ONLY
operand matching FLAGS.  If there are 0 or more than 1 operand matching
FLAGS, then NULL_TREE is returned.   

Referenced by chain_of_csts_start(), expr_coherent_p(), minmax_replacement(), process_replaceable(), ssa_is_replaceable_p(), and ter_is_replaceable_p().

◆ SINGLE_SSA_USE_OPERAND

#define SINGLE_SSA_USE_OPERAND ( STMT,
FLAGS )
Value:
single_ssa_use_operand (STMT, FLAGS)
use_operand_p single_ssa_use_operand(gimple *stmt, int flags)
Definition ssa-iterators.h:697
This macro returns an operand in STMT as a use_operand_p if it is the ONLY
operand matching FLAGS.  If there are 0 or more than 1 operand matching
FLAGS, then NULL_USE_OPERAND_P is returned.   

Referenced by find_replaceable_in_bb().

◆ SSA_OP_ALL_DEFS

◆ SSA_OP_ALL_OPERANDS

#define SSA_OP_ALL_OPERANDS   (SSA_OP_ALL_USES | SSA_OP_ALL_DEFS)

◆ SSA_OP_ALL_USES

◆ SSA_OP_ALL_VIRTUALS

#define SSA_OP_ALL_VIRTUALS   (SSA_OP_VIRTUAL_USES | SSA_OP_VIRTUAL_DEFS)

◆ SSA_OP_DEF

◆ SSA_OP_USE

#define SSA_OP_USE   0x01 /* Real USE operands. @endverbatim */
NOTE: Keep these in sync with doc/tree-ssa.texi.   
These flags are used to determine which operands are returned during
execution of the loop.   

Referenced by add_scope_conflicts_1(), adjust_before_returns_twice_call(), avoid_deep_ter_for_debug(), bb_no_side_effects_p(), build_bitint_stmt_ssa_conflicts(), build_ssa_conflict_graph(), bump_vector_ptr(), chain_of_csts_start(), check_all_va_list_escapes(), check_reduction_path(), collect_dfa_stats(), compute_added_num_insns(), compute_avail(), convert_mult_to_fma(), cprop_into_stmt(), determine_max_movement(), eliminate_dom_walker::eliminate_stmt(), eliminate_unnecessary_stmts(), empty_bb_or_one_feeding_into_p(), estimate_threading_killed_stmts(), expand_gimple_basic_block(), expand_simple_operations(), expr_coherent_p(), find_deps_in_bb_for_stmt(), find_deriving_biv_for_expr(), find_interesting_uses_stmt(), find_invariants_stmt(), find_loop_guard(), find_necessary_statements(), find_replaceable_in_bb(), find_ssa_names_to_propagate(), find_unswitching_predicates_for_bb(), find_uses_to_rename_bb(), fp_expression_p(), get_rank(), gimple_lower_bitint(), has_use_on_stmt(), hoist_defs_of_uses(), ifcombine_replace_cond(), ifcvt_local_dce(), invariant_in_sese_p_rec(), is_simple_and_all_uses_invariant(), last_fma_candidate_feeds_initial_phi(), simplify_using_ranges::legacy_fold_cond(), likely_value(), link_use_stmts_after(), tree_loop_interchange::map_inductions_to_loop(), mark_def_sites(), mark_stmt_if_obviously_necessary(), back_threader::maybe_thread_block(), move_block_to_fn(), movement_possibility(), op_iter_init(), op_iter_init_phiuse(), op_iter_init_use(), optimize_va_list_gpr_fpr_size(), prepare_block_for_update_1(), ipa_param_body_adjustments::prepare_debug_expressions(), process_replaceable(), propagate_necessity(), propagate_with_phi(), remove_gimple_phi_args(), reorder_operands(), replace_abnormal_ssa_names(), substitute_and_fold_engine::replace_uses_in(), rewrite_debug_stmt_uses(), rewrite_update_stmt(), separate_decls_in_region_debug(), separate_decls_in_region_stmt(), sese_build_liveouts_bb(), should_duplicate_loop_header_p(), simple_dce_from_worklist(), ssa_propagation_engine::simulate_stmt(), split_function(), stmt_may_generate_copy(), stmt_references_abnormal_ssa_name(), stmt_semi_invariant_p_1(), stmt_update_dep_bb(), update_debug_stmt(), vect_inner_phi_in_double_reduction_p(), vect_loop_versioning(), vect_mark_stmts_to_be_vectorized(), vect_transform_slp_perm_load_1(), verify_ssa(), operands_scanner::verify_ssa_operands(), visit_bb(), warn_uninitialized_vars(), and will_be_nonconstant_predicate().

◆ SSA_OP_VDEF

#define SSA_OP_VDEF   0x08 /* VDEF operands. @endverbatim */

◆ SSA_OP_VIRTUAL_DEFS

#define SSA_OP_VIRTUAL_DEFS   (SSA_OP_VDEF)

◆ SSA_OP_VIRTUAL_USES

#define SSA_OP_VIRTUAL_USES   (SSA_OP_VUSE)
These are commonly grouped operand flags.   

Referenced by find_uses_to_rename_bb(), find_uses_to_rename_stmt(), link_use_stmts_after(), and op_iter_init_phiuse().

◆ SSA_OP_VUSE

#define SSA_OP_VUSE   0x04 /* VUSE operands. @endverbatim */

Referenced by op_iter_init(), and verify_ssa().

◆ ZERO_SSA_OPERANDS

#define ZERO_SSA_OPERANDS ( STMT,
FLAGS )
Value:
zero_ssa_operands (STMT, FLAGS)
bool zero_ssa_operands(gimple *stmt, int flags)
Definition ssa-iterators.h:743
This macro returns TRUE if there are no operands matching FLAGS in STMT.   

Referenced by gsi_advance_bw_nondebug_nonlocal().

Enumeration Type Documentation

◆ ssa_op_iter_type

Enumerator
ssa_op_iter_none 
ssa_op_iter_tree 
ssa_op_iter_use 
ssa_op_iter_def 

Function Documentation

◆ clear_and_done_ssa_iter()

void clear_and_done_ssa_iter ( ssa_op_iter * ptr)
inline
This functions clears the iterator PTR, and marks it done.  This is normally
used to prevent warnings in the compile about might be uninitialized
components.   

References ssa_op_iter::done, ssa_op_iter::flags, ssa_op_iter::i, ssa_op_iter::iter_type, NULL, ssa_op_iter::numops, ssa_op_iter_none, ssa_op_iter::stmt, and ssa_op_iter::uses.

Referenced by op_iter_init_phidef(), and op_iter_init_phiuse().

◆ delink_imm_use()

◆ delink_stmt_imm_use()

void delink_stmt_imm_use ( gimple * stmt)
inline

◆ end_imm_use_on_stmt_p()

bool end_imm_use_on_stmt_p ( const imm_use_iterator * imm)
inline
Return TRUE if the last use on the stmt IMM refers to has been visited.   

References imm_use_iterator::imm_use, and imm_use_iterator::iter_node.

Referenced by next_imm_use_on_stmt().

◆ end_imm_use_stmt_p()

bool end_imm_use_stmt_p ( const imm_use_iterator * imm)
inline
Return true is IMM has reached the end of the immediate use stmt list.   

References imm_use_iterator::end_p, and imm_use_iterator::imm_use.

Referenced by first_imm_use_stmt(), next_imm_use_stmt(), and vec_slp_has_scalar_use().

◆ end_imm_use_stmt_traverse()

void end_imm_use_stmt_traverse ( imm_use_iterator * imm)
inline
Forward declare for use in the class below.   
Finished the traverse of an immediate use stmt list IMM by removing the
placeholder node from the list.   

References delink_imm_use(), and imm_use_iterator::iter_node.

Referenced by auto_end_imm_use_stmt_traverse::~auto_end_imm_use_stmt_traverse().

◆ end_readonly_imm_use_p()

bool end_readonly_imm_use_p ( const imm_use_iterator * imm)
inline
Return true is IMM has reached the end of the immediate use list.   

References imm_use_iterator::end_p, and imm_use_iterator::imm_use.

Referenced by first_readonly_imm_use(), and next_readonly_imm_use().

◆ first_imm_use_on_stmt()

use_operand_p first_imm_use_on_stmt ( imm_use_iterator * imm)
inline
This routine will return the first use on the stmt IMM currently refers
to.   

References imm_use_iterator::imm_use, ssa_use_operand_t::next, and imm_use_iterator::next_imm_name.

◆ first_imm_use_stmt()

◆ first_readonly_imm_use()

use_operand_p first_readonly_imm_use ( imm_use_iterator * imm,
tree var )
inline

◆ has_single_use()

bool has_single_use ( const_tree var)
inline

◆ has_zero_uses()

◆ link_imm_use()

void link_imm_use ( ssa_use_operand_t * linknode,
tree def )
inline

◆ link_imm_use_stmt()

void link_imm_use_stmt ( ssa_use_operand_t * linknode,
tree def,
gimple * stmt )
inline
Link ssa_imm_use node LINKNODE into the chain for DEF, with use occurring
in STMT.   

References link_imm_use(), ssa_use_operand_t::loc, NULL, and ssa_use_operand_t::stmt.

Referenced by add_use_op(), and lower_emutls_phi_arg().

◆ link_imm_use_to_list()

void link_imm_use_to_list ( ssa_use_operand_t * linknode,
ssa_use_operand_t * list )
inline
Link ssa_imm_use node LINKNODE into the chain for LIST.   

References ssa_use_operand_t::next, and ssa_use_operand_t::prev.

Referenced by link_imm_use(), link_use_stmts_after(), and move_use_after_head().

◆ link_use_stmts_after()

void link_use_stmts_after ( use_operand_p head,
imm_use_iterator * imm )
inline

◆ move_use_after_head()

use_operand_p move_use_after_head ( use_operand_p use_p,
use_operand_p head,
use_operand_p last_p )
inline
Immediate use traversal of uses within a stmt require that all the
uses on a stmt be sequentially listed.  This routine is used to build up
this sequential list by adding USE_P to the end of the current list
currently delimited by HEAD and LAST_P.  The new LAST_P value is
returned.   

References delink_imm_use(), gcc_checking_assert, link_imm_use_to_list(), ssa_use_operand_t::next, and USE_FROM_PTR.

Referenced by link_use_stmts_after().

◆ next_imm_use_on_stmt()

use_operand_p next_imm_use_on_stmt ( imm_use_iterator * imm)
inline
Bump to the next use on the stmt IMM refers to, return NULL if done.   

References end_imm_use_on_stmt_p(), imm_use_iterator::imm_use, ssa_use_operand_t::next, imm_use_iterator::next_imm_name, and NULL_USE_OPERAND_P.

◆ next_imm_use_stmt()

◆ next_readonly_imm_use()

use_operand_p next_readonly_imm_use ( imm_use_iterator * imm)
inline

◆ num_imm_uses()

unsigned int num_imm_uses ( const_tree var)
inline

◆ num_ssa_operands()

int num_ssa_operands ( gimple * stmt,
int flags )
inline
Return the number of operands matching FLAGS in STMT.   

References FOR_EACH_SSA_TREE_OPERAND, and gcc_checking_assert.

◆ op_iter_done()

bool op_iter_done ( const ssa_op_iter * ptr)
inline
-----------------------------------------------------------------------   
The following set of routines are used to iterator over various type of
SSA operands.   
Return true if PTR is finished iterating.   

References ssa_op_iter::done.

Referenced by single_ssa_def_operand(), single_ssa_tree_operand(), single_ssa_use_operand(), and zero_ssa_operands().

◆ op_iter_init()

◆ op_iter_init_def()

def_operand_p op_iter_init_def ( ssa_op_iter * ptr,
gimple * stmt,
int flags )
inline
Initialize iterator PTR to the def operands in STMT based on FLAGS. Return
the first def.   

References gcc_checking_assert, ssa_op_iter::iter_type, op_iter_init(), op_iter_next_def(), SSA_OP_ALL_USES, SSA_OP_DEF, and ssa_op_iter_def.

Referenced by single_ssa_def_operand().

◆ op_iter_init_phidef()

◆ op_iter_init_phiuse()

use_operand_p op_iter_init_phiuse ( ssa_op_iter * ptr,
gphi * phi,
int flags )
inline

◆ op_iter_init_tree()

tree op_iter_init_tree ( ssa_op_iter * ptr,
gimple * stmt,
int flags )
inline
Initialize iterator PTR to the operands in STMT based on FLAGS. Return
the first operand as a tree.   

References ssa_op_iter::iter_type, op_iter_init(), op_iter_next_tree(), and ssa_op_iter_tree.

Referenced by single_ssa_tree_operand(), and zero_ssa_operands().

◆ op_iter_init_use()

use_operand_p op_iter_init_use ( ssa_op_iter * ptr,
gimple * stmt,
int flags )
inline
Initialize iterator PTR to the use operands in STMT based on FLAGS. Return
the first use.   

References gcc_checking_assert, ssa_op_iter::iter_type, op_iter_init(), op_iter_next_use(), SSA_OP_ALL_DEFS, ssa_op_iter_use, and SSA_OP_USE.

Referenced by check_reduction_path(), and single_ssa_use_operand().

◆ op_iter_next_def()

◆ op_iter_next_tree()

◆ op_iter_next_use()

◆ relink_imm_use()

void relink_imm_use ( ssa_use_operand_t * node,
ssa_use_operand_t * old )
inline
Relink a new node in place of an old node in the list.   

References gcc_checking_assert, ssa_use_operand_t::next, NULL, ssa_use_operand_t::prev, and ssa_use_operand_t::use.

Referenced by relink_imm_use_stmt(), and remove_phi_arg_num().

◆ relink_imm_use_stmt()

void relink_imm_use_stmt ( ssa_use_operand_t * linknode,
ssa_use_operand_t * old,
gimple * stmt )
inline
Relink ssa_imm_use node LINKNODE into the chain for OLD, with use occurring
in STMT.   

References link_imm_use(), ssa_use_operand_t::loc, NULL, relink_imm_use(), and ssa_use_operand_t::stmt.

Referenced by resize_phi_node().

◆ set_ssa_use_from_ptr()

void set_ssa_use_from_ptr ( use_operand_p use,
tree val )
inline
Set the value of a use pointed to by USE to VAL.   

References delink_imm_use(), and link_imm_use().

◆ single_imm_use()

bool single_imm_use ( const_tree var,
use_operand_p * use_p,
gimple ** stmt )
inline
If VAR has only a single immediate nondebug use, return true, and
set USE_P and STMT to the use pointer and stmt of occurrence.   

References is_gimple_debug(), ssa_use_operand_t::loc, ssa_use_operand_t::next, NULL, NULL_USE_OPERAND_P, return_false, single_imm_use_1(), SSA_NAME_IMM_USE_NODE, ssa_use_operand_t::stmt, and USE_STMT.

Referenced by all_uses_feed_or_dominated_by_stmt(), loop_cand::analyze_iloop_reduction_var(), loop_cand::analyze_oloop_reduction_var(), arith_overflow_check_p(), branch_fixup(), check_scan_store(), convert_atomic_bit_not(), convert_mult_to_fma(), convert_mult_to_fma_1(), create_call_for_reduction_1(), dse_classify_store(), empty_bb_or_one_feeding_into_p(), expand_call_inline(), expand_mul_overflow(), final_range_test_p(), find_foldable_builtin_expect(), find_uninit_use(), gather_scalar_reductions(), get_single_immediate_use(), gimple_lower_bitint(), vec_info::lookup_single_use(), match_arith_overflow(), maybe_optimize_range_tests(), oacc_entry_exit_ok_1(), ompdevlow_adjust_simt_enter(), optimize_atomic_bit_test_and(), optimize_atomic_op_fetch_cmp_0(), phi_rank(), propagate_op_to_single_use(), propagate_with_phi(), rewrite_bittest(), sanopt_optimize_walker(), simplify_using_ranges::simplify(), simplify_builtin_call(), spaceship_replacement(), ssa_is_replaceable_p(), ter_is_replaceable_p(), value_replacement(), vect_build_slp_instance(), vect_create_epilog_for_reduction(), vect_recog_bitfield_ref_pattern(), vect_slp_check_for_roots(), vect_slp_linearize_chain(), and vectorizable_reduction().

◆ single_imm_use_1()

bool single_imm_use_1 ( const ssa_use_operand_t * head,
use_operand_p * use_p,
gimple ** stmt )
extern
Return true if the var whose chain of uses starts at PTR has a
single nondebug use.  Set USE_P and STMT to that single nondebug
use, if so, or to NULL otherwise.   

References is_gimple_debug(), ssa_use_operand_t::next, NULL, single_use(), and USE_STMT.

Referenced by single_imm_use().

◆ single_phi_def()

tree single_phi_def ( gphi * stmt,
int flags )
inline
If there is a single DEF in the PHI node which matches FLAG, return it.
Otherwise return NULL_DEF_OPERAND_P.   

References gimple_phi_result(), is_gimple_reg(), NULL_TREE, SSA_OP_DEF, and SSA_OP_VIRTUAL_DEFS.

◆ single_ssa_def_operand()

def_operand_p single_ssa_def_operand ( gimple * stmt,
int flags )
inline
If there is a single operand in STMT matching FLAGS, return it.  Otherwise
return NULL.   

References NULL_DEF_OPERAND_P, op_iter_done(), op_iter_init_def(), and op_iter_next_def().

Referenced by hoist_defs_of_uses(), _slp_tree::push_vec_def(), simple_dce_from_worklist(), and statement_sink_location().

◆ single_ssa_tree_operand()

tree single_ssa_tree_operand ( gimple * stmt,
int flags )
inline
If there is a single operand in STMT matching FLAGS, return it.  Otherwise
return NULL.   

References NULL_TREE, op_iter_done(), op_iter_init_tree(), and op_iter_next_tree().

Referenced by stmt_may_generate_copy(), and vect_transform_slp_perm_load_1().

◆ single_ssa_use_operand()

use_operand_p single_ssa_use_operand ( gimple * stmt,
int flags )
inline
If there is a single operand in STMT matching FLAGS, return it.  Otherwise
return NULL.   

References NULL_USE_OPERAND_P, op_iter_done(), op_iter_init_use(), and op_iter_next_use().

◆ ssa_vuse_operand()

use_operand_p ssa_vuse_operand ( gimple * stmt)
inline
Return the single virtual use operand in STMT if present.  Otherwise
return NULL.   

References gimple_use_ops(), gimple_vuse(), NULL_USE_OPERAND_P, and USE_OP_PTR.

Referenced by combine_blocks().

◆ zero_ssa_operands()

bool zero_ssa_operands ( gimple * stmt,
int flags )
inline
Return true if there are zero operands in STMT matching the type
given in FLAGS.   

References op_iter_done(), and op_iter_init_tree().

Referenced by mark_stmt_if_obviously_necessary().