GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | edge_var_map |
Typedefs | |
typedef vec< edge_var_map, va_heap, vl_embed > | edge_var_map_vector |
typedef vec<edge_var_map, va_heap, vl_embed> edge_var_map_vector |
A vector of var maps.
Verify SSA invariants, if internal consistency checks are enabled.
References verify_ssa().
|
extern |
Deallocate memory associated with SSA data structures for FNDECL.
References gimple_df::decls_to_pointers, gimple_df::default_defs, hash_table< Descriptor, Lazy, Allocator >::empty(), gimple_df::escaped, gimple_df::escaped_return, fini_ssa_operands(), fini_ssanames(), function::gimple_df, NULL, pt_solution_reset(), redirect_edge_var_map_empty(), and ssa_operands_active().
Referenced by release_function_body(), and rest_of_clean_state().
|
extern |
Compute TREE_ADDRESSABLE and whether we have unhandled partial defs for local variables.
References as_a(), asan_mark_p(), bitmap_bit_p, bitmap_empty_p(), bitmap_set_bit, bitsizetype, build1(), build_clobber(), build_constructor(), build_vector_type(), cfun, DECL_ARGUMENTS, DECL_CHAIN, DECL_P, DECL_UID, fold_build1, fold_builtin_atomic_compare_exchange(), FOR_EACH_BB_FN, FOR_EACH_VEC_SAFE_ELT, g, gcc_assert, get_base_address(), gimple_asm_input_op(), gimple_asm_ninputs(), gimple_asm_noutputs(), gimple_asm_output_op(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs1_ptr(), gimple_assign_set_lhs(), gimple_assign_set_rhs_from_tree(), gimple_assign_set_rhs_with_ops(), gimple_assign_single_p(), gimple_build_assign(), gimple_build_call_internal(), gimple_call_arg(), gimple_call_arg_ptr(), gimple_call_internal_p(), gimple_call_num_args(), gimple_call_set_arg(), gimple_call_set_lhs(), gimple_clobber_p(), gimple_debug_bind_get_value_ptr(), gimple_debug_bind_has_value_p(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), gimple_get_lhs(), gimple_ior_addresses_taken(), gimple_location(), gimple_phi_num_args(), gimple_references_memory_p(), gimple_set_location(), gimple_set_vuse(), gimple_vuse(), walk_stmt_info::gsi, gsi_end_p(), gsi_for_stmt(), gsi_insert_before(), gsi_next(), gsi_replace(), GSI_SAME_STMT, gsi_start_bb(), gsi_start_phis(), gsi_stmt(), i, integer_zerop(), is_asan_mark_p(), is_gimple_debug(), known_ge, known_gt, LOOP_CLOSED_SSA, loops_state_satisfies_p(), make_ssa_name(), maybe_optimize_var(), maybe_rewrite_mem_ref_base(), mem_ref_offset(), non_rewritable_lvalue_p(), non_rewritable_mem_ref_base(), NULL, null_pointer_node, NULL_TREE, number_of_loops(), operand_equal_p(), optimize_atomic_compare_exchange_p(), PHI_ARG_DEF, poly_int_tree_p(), rewrite_into_loop_closed_ssa(), walk_stmt_info::stmt, suppress_warning(), timevar_pop(), timevar_push(), wi::to_poly_offset(), TODO_update_ssa, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, tree_to_uhwi(), TREE_TYPE, TREE_VALUE, TYPE_MODE, TYPE_SIZE, TYPE_SIZE_UNIT, types_compatible_p(), unlink_stmt_vdef(), update_ssa(), update_stmt(), useless_type_conversion_p(), valid_vector_subparts_p(), VAR_P, VECTOR_TYPE_P, and wide_int_to_tree().
Referenced by execute_function_todo().
Called via walk_tree, look for SSA_NAMEs that have already been released.
References IS_TYPE_OR_DECL_P, NULL_TREE, SSA_NAME_IN_FREE_LIST, and TREE_CODE.
Referenced by insert_debug_temp_for_var_def(), and verify_loop_structure().
|
extern |
Add PHI arguments queued in PENDING_STMT list on edge E to edge E->dest.
References add_phi_arg(), gsi_end_p(), gsi_next(), gsi_start_phis(), i, gphi_iterator::phi(), redirect_edge_var_map_clear(), redirect_edge_var_map_def(), redirect_edge_var_map_location(), and redirect_edge_var_map_vector().
Referenced by cleanup_empty_eh_merge_phis(), back_jt_path_registry::duplicate_thread_path(), fuse_loops(), gimple_duplicate_loop_body_to_header_edge(), gimple_duplicate_seme_region(), gimple_make_forwarder_block(), isolate_path(), slpeel_tree_duplicate_loop_to_edge_cfg(), ssa_redirect_edges(), transform_duplicate(), transform_to_exit_first_loop_alt(), and vect_loop_versioning().
Replace the LHS of STMT, an assignment, either a GIMPLE_ASSIGN or a GIMPLE_CALL, with NLHS, in preparation for modifying the RHS to an expression with a different value. This will update any annotations (say debug bind stmts) referring to the original LHS, so that they use the RHS instead. This is done even if NLHS and LHS are the same, for it is understood that the RHS will be modified afterwards, and NLHS will not be assigned an equivalent value. Adjusting any non-annotation uses of the LHS, if needed, is a responsibility of the caller. The effect of this call should be pretty much the same as that of inserting a copy of STMT before STMT, and then removing the original stmt, at which time gsi_remove() would have update annotations, but using this function saves all the inserting, copying and removing.
References gcc_assert, gimple_get_lhs(), gimple_set_lhs(), insert_debug_temp_for_var_def(), MAY_HAVE_DEBUG_BIND_STMTS, NULL, and SSA_NAME_DEF_STMT.
|
extern |
Initialize global DFA and SSA structures. If SIZE is non-zero allocated ssa names array of a given size.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), gimple_df::default_defs, gimple_df::escaped, gimple_df::escaped_return, ggc_cleared_alloc(), function::gimple_df, init_ssanames(), and pt_solution_reset().
Referenced by create_assumption_fn(), create_omp_child_function(), expand_omp_taskreg(), gimplify_body(), init_lowered_empty_function(), initialize_cfun(), and input_ssa_names().
|
extern |
Insert a DEBUG BIND stmt before the DEF of VAR if VAR is referenced by other DEBUG stmts, and replace uses of the DEF with the newly-created debug temp.
References as_a(), build_debug_expr_decl(), CDI_DOMINATORS, CONSTANT_CLASS_P, DECL_MODE, DECL_P, degenerate_phi_result(), dom_info_available_p(), error_mark_node, find_released_ssa_name(), fold_stmt_inplace(), FOR_EACH_IMM_USE_FAST, FOR_EACH_IMM_USE_ON_STMT, FOR_EACH_IMM_USE_STMT, gimple_assign_rhs_to_tree(), gimple_bb(), gimple_build_debug_bind(), gimple_clobber_p(), gimple_debug_bind_get_value(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), walk_stmt_info::gsi, gsi_for_stmt(), gsi_insert_before(), GSI_SAME_STMT, gsi_stmt(), is_gimple_assign(), is_gimple_reg(), MAY_HAVE_DEBUG_BIND_STMTS, name_registered_for_update_p(), NULL, SET_DECL_MODE, SET_USE, SSA_NAME_DEF_STMT, walk_stmt_info::stmt, TREE_CODE, TREE_TYPE, TYPE_MODE, unshare_expr(), update_stmt(), USE_STMT, walk_gimple_op(), and walk_tree.
Referenced by gimple_replace_ssa_lhs(), insert_debug_temps_for_defs(), and release_ssa_name_fn().
|
extern |
Insert a DEBUG BIND stmt before STMT for each DEF referenced by other DEBUG stmts, and replace uses of the DEF with the newly-created debug temp.
References DEF_FROM_PTR, FOR_EACH_PHI_OR_STMT_DEF, walk_stmt_info::gsi, gsi_stmt(), insert_debug_temp_for_var_def(), MAY_HAVE_DEBUG_BIND_STMTS, SSA_OP_DEF, walk_stmt_info::stmt, and TREE_CODE.
Referenced by gsi_remove(), and remove_phi_node().
|
extern |
Mark as maybe_undef any SSA_NAMEs that are unsuitable as ivopts candidates for potentially involving undefined behavior.
References as_a(), cfun, dump_file, dump_flags, FOR_EACH_IMM_USE_FAST, FOR_EACH_SSA_NAME, gimple_phi_arg_edge(), gimple_phi_result(), i, is_a(), phi_arg_index_from_use(), queue, ssa_name_any_use_dominates_bb_p(), SSA_NAME_IS_VIRTUAL_OPERAND, ssa_name_maybe_undef_p(), ssa_name_set_maybe_undef(), SSA_NAME_VERSION, ssa_undefined_value_p(), TDF_DETAILS, and USE_STMT.
Referenced by init_reassoc(), loop_invariant_motion_in_fun(), tree_ssa_iv_optimize(), and tree_ssa_unswitch_loops().
Add a mapping with PHI RESULT and PHI DEF associated with edge E.
References edge_var_map::def, edge_var_maps, edge_var_map::locus, NULL, and edge_var_map::result.
Referenced by cleanup_empty_eh_merge_phis(), and ssa_redirect_edge().
|
extern |
Clear the var mappings in edge E.
References edge_var_maps.
Referenced by cleanup_empty_eh_merge_phis(), expand_omp_for_static_chunk(), flush_pending_stmts(), make_forwarders_with_degenerate_phis(), remove_edge(), remove_forwarder_block_with_phi(), slpeel_tree_duplicate_loop_to_edge_cfg(), and ssa_redirect_edge().
|
inline |
Given an edge_var_map V, return the PHI arg definition.
References edge_var_map::def.
Referenced by expand_omp_for_static_chunk(), flush_pending_stmts(), remove_forwarder_block_with_phi(), and transform_to_exit_first_loop_alt().
Duplicate the redirected var mappings in OLDE in NEWE. This assumes a hash_map can have multiple edges mapping to the same var_map (many to one mapping), since we don't remove the previous mappings.
References edge_var_maps.
Referenced by redirect_edge_succ_nodup().
|
extern |
Clear the edge variable mappings.
References edge_var_maps.
Referenced by delete_tree_ssa(), execute_one_ipa_transform_pass(), execute_one_pass(), and set_function_decl().
|
inline |
Given an edge_var_map V, return the PHI arg location.
References edge_var_map::locus.
Referenced by expand_omp_for_static_chunk(), flush_pending_stmts(), and remove_forwarder_block_with_phi().
|
inline |
Given an edge_var_map V, return the PHI result.
References edge_var_map::result.
Referenced by expand_omp_for_static_chunk(), and remove_forwarder_block_with_phi().
|
extern |
Return the variable mappings for a given edge. If there is none, return NULL.
References edge_var_maps, and NULL.
Referenced by expand_omp_for_static_chunk(), flush_pending_stmts(), remove_forwarder_block_with_phi(), and transform_to_exit_first_loop_alt().
|
extern |
Delete SSA DEFs for SSA versions in the TOREMOVE bitmap, removing dominated stmts before their dominators, so that release_ssa_defs stands a chance of propagating DEFs into debug bind stmts.
References bitmap_bit_p, bitmap_clear_bit(), bitmap_count_bits(), bitmap_empty_p(), bitmap_list_view(), bitmap_tree_view(), DEF_FROM_PTR, EXECUTE_IF_SET_IN_BITMAP, FOR_EACH_IMM_USE_STMT, FOR_EACH_SSA_DEF_OPERAND, walk_stmt_info::gsi, gsi_for_stmt(), gsi_remove(), i, is_gimple_debug(), names, NULL_TREE, release_defs(), remove_phi_node(), ssa_name, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, SSA_OP_DEF, and walk_stmt_info::stmt.
Referenced by tree_ssa_iv_optimize().
|
extern |
Reset all debug stmts that use SSA_NAME(s) defined in STMT.
References DEF_FROM_PTR, FOR_EACH_IMM_USE_STMT, FOR_EACH_PHI_OR_STMT_DEF, gimple_debug_bind_p(), gimple_debug_bind_reset_value(), MAY_HAVE_DEBUG_BIND_STMTS, SSA_OP_DEF, walk_stmt_info::stmt, TREE_CODE, and update_stmt().
Referenced by generate_loops_for_partition(), tree_loop_interchange::interchange_loops(), tree_loop_interchange::move_code_to_inner_loop(), pcom_worker::remove_stmt(), and value_replacement().
Return true if T, as SSA_NAME, has an implicit default defined value.
References DECL_BY_REFERENCE, DECL_HARD_REGISTER, SSA_NAME_VAR, TREE_CODE, and VAR_P.
Referenced by get_constraint_for_ssa_var(), and ssa_undefined_value_p().
bool ssa_name_any_use_dominates_bb_p | ( | tree | var, |
basic_block | bb ) |
Return TRUE iff there are any non-PHI uses of VAR that dominate the end of BB. If we return TRUE and BB is a loop header, then VAR we be assumed to be defined within the loop, even if it is marked as maybe-undefined.
References CDI_DOMINATORS, dominated_by_p(), FOR_EACH_IMM_USE_FAST, gimple_bb(), is_a(), is_gimple_debug(), and USE_STMT.
Referenced by find_ssa_undef(), and mark_ssa_maybe_undefs().
Return TRUE iff VAR is marked as maybe-undefined. See mark_ssa_maybe_undefs.
References gcc_checking_assert, TREE_CODE, and TREE_VISITED.
Referenced by bb_no_side_effects_p(), can_reassociate_op_p(), empty_bb_or_one_feeding_into_p(), find_ssa_undef(), init_range_entry(), is_maybe_undefined(), mark_ssa_maybe_undefs(), match_simplify_replacement(), movement_possibility(), and value_replacement().
Set (or clear, depending on VALUE) VAR's maybe-undefined mark.
References gcc_checking_assert, TREE_CODE, and TREE_VISITED.
Referenced by mark_ssa_maybe_undefs().
|
extern |
Remove the corresponding arguments from the PHI nodes in E's destination block and redirect it to DEST. Return redirected edge. The list of removed arguments is stored in a vector accessed through edge_var_maps.
References gimple_phi_arg_def(), gimple_phi_arg_location(), gimple_phi_result(), gsi_end_p(), gsi_next(), gsi_start_phis(), NULL_TREE, gphi_iterator::phi(), redirect_edge_succ_nodup(), redirect_edge_var_map_add(), and redirect_edge_var_map_clear().
Referenced by gimple_redirect_edge_and_branch(), gimple_try_redirect_by_replacing_jump(), redirect_eh_edge(), and vect_loop_versioning().
Return true if T, an SSA_NAME, has an undefined value. PARTIAL is what should be returned if the value is only partially undefined.
References gcc_checking_assert, gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_call_internal_p(), gimple_nop_p(), is_gimple_assign(), ssa_defined_default_def_p(), SSA_NAME_DEF_STMT, ssa_undefined_value_p(), TREE_CODE, TREE_OPERAND, and virtual_operand_p().
Referenced by compute_avail(), get_undefined_value_partitions(), has_undefined_value_p(), init_dont_simulate_again(), mark_ssa_maybe_undefs(), set_ssa_val_to(), set_var_live_on_entry(), ssa_undefined_value_p(), verify_live_on_entry(), visit_phi(), vn_phi_insert(), and vn_phi_lookup().
Given a tree for an expression for which we might want to emit locations or values in debug information (generally a variable, but we might deal with other kinds of trees in the future), return the tree that should be used as the variable of a DEBUG_BIND STMT or VAR_LOCATION INSN or NOTE. Return NULL if VAR is not to be tracked.
References DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_VALUE_EXPR, is_gimple_reg_type(), MAY_HAVE_DEBUG_BIND_STMTS, NULL_TREE, SSA_NAME_VAR, target_for_debug_bind(), TREE_CODE, TREE_TYPE, VAR_DECL_IS_VIRTUAL_OPERAND, and VAR_P.
Referenced by dv_onepart_p(), expand_debug_expr(), expand_gimple_basic_block(), insert_init_debug_bind(), insert_phi_nodes_for(), maybe_register_def(), reset_debug_binding(), ipa_param_body_adjustments::reset_debug_stmts(), rewrite_stmt(), target_for_debug_bind(), use_type(), and vt_add_function_parameter().
Strip conversions from EXP according to tree_ssa_useless_type_conversion and return the resulting expression.
References exp(), TREE_OPERAND, and tree_ssa_useless_type_conversion().
Return true if EXPR is a useless type conversion, otherwise return false.
References CONVERT_EXPR_P, error_mark_node, TREE_CODE, TREE_OPERAND, TREE_TYPE, and useless_type_conversion_p().
Referenced by gimplify_addr_expr(), gimplify_conversion(), gimplify_modify_expr_rhs(), and tree_ssa_strip_useless_type_conversions().
Verify common invariants in the SSA web. TODO: verify the variable annotations.
References bitmap_clear(), bitmap_set_bit, calculate_dominance_info(), CDI_DOMINATORS, cfun, dom_info_state(), DOM_NONE, ENTRY_BLOCK_PTR_FOR_FN, error(), FOR_EACH_BB_FN, FOR_EACH_EDGE, FOR_EACH_SSA_NAME, FOR_EACH_SSA_TREE_OPERAND, FOR_EACH_SSA_USE_OPERAND, free(), free_dominance_info(), gcc_assert, hash_map< KeyId, Value, Traits >::get_or_insert(), gimple_bb(), gimple_debug_bind_has_value_p(), gimple_debug_bind_p(), gimple_modified_p(), gimple_nop_p(), gimple_phi_result(), gimple_vop(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), i, walk_stmt_info::info, INTEGRAL_TYPE_P, internal_error(), last_basic_block_for_fn, need_ssa_update_p(), NULL, num_ssa_names, POINTER_TYPE_P, basic_block_def::preds, print_generic_expr(), print_gimple_stmt(), set_dom_info_availability(), ssa_default_def(), SSA_NAME_DEF_STMT, SSA_NAME_PTR_INFO, SSA_NAME_RANGE_INFO, SSA_NAME_VERSION, SSA_OP_ALL_DEFS, SSA_OP_USE, SSA_OP_VUSE, walk_stmt_info::stmt, TDF_VOPS, timevar_pop(), timevar_push(), TREE_TYPE, TREE_VISITED, USE_FROM_PTR, verify_def(), verify_phi_args(), verify_ssa_name(), verify_ssa_operands(), verify_use(), verify_vssa(), virtual_operand_p(), and visited.
Referenced by checking_verify_ssa(), execute_function_todo(), rewrite_into_loop_closed_ssa_1(), and verify_loop_closed_ssa().