GCC Middle and Back End API Reference
|
#include "gimple.h"
Variables | |
eni_weights | eni_size_weights |
eni_weights | eni_time_weights |
static int | processing_debug_stmt = 0 |
static const char * | inline_forbidden_reason |
|
inlinestatic |
Add local variables from CALLEE to CALLER.
References add_local_decl(), can_be_nonlocal(), copy_tree_body_r(), and remap_decl().
Referenced by expand_call_inline(), and tree_function_versioning().
tree build_duplicate_type | ( | ) |
Duplicate a type, fields and all.
References cfun, copy_decl_no_change(), current_function_decl, copy_body_data::debug_map, copy_body_data::decl_map, memset(), pointer_map_create(), pointer_map_destroy(), remap_type_1(), and type().
|
static |
Decide if DECL can be put into BLOCK_NONLOCAL_VARs.
References auto_var_in_fn_p(), and copy_body_data::src_fn.
Referenced by add_local_variables(), and remap_decls().
|
static |
Return a copy of the function's argument tree.
References bitmap_bit_p(), copy_decl_to_var(), copy_body_data::decl_map, lang_hooks::dup_lang_specific_decl, insert_decl_map(), pointer_map_contains(), and remap_decl().
Referenced by tree_function_versioning().
|
static |
Copy basic block, scale profile accordingly. Edges will be taken care of later
References symtab_node_base::address_taken, apply_scale(), basic_block_def::aux, build_int_cst(), BUILT_IN_NORMAL, function::calls_alloca, function::calls_setjmp, CB_CGE_DUPLICATE, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, cfun, cgraph_clone_edge(), cgraph_create_edge(), cgraph_create_edge_including_clones(), cgraph_edge(), cgraph_get_node(), cgraph_node_name(), cgraph_set_call_stmt(), cgraph_set_call_stmt_including_clones(), cgraph_speculative_call_info(), compute_call_stmt_bb_frequency(), count, basic_block_def::count, create_basic_block(), symtab_node_base::decl, symtab_node_base::definition, copy_body_data::dst_node, dump_file, copy_body_data::eh_lp_nr, copy_body_data::eh_map, force_gimple_operand_gsi(), frequency, basic_block_def::frequency, cgraph_edge::frequency, gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_set_rhs1(), gimple_block(), gimple_build_call_vec(), copy_body_data::gimple_call, gimple_call_arg_ptr(), gimple_call_copy_flags(), gimple_call_flags(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_set_lhs(), gimple_call_set_va_arg_pack(), gimple_call_va_arg_pack_p(), gimple_duplicate_stmt_histograms(), gimple_in_ssa_p(), gimple_location(), gimple_nop_p(), gimple_regimplify_operands(), gimple_set_block(), gimple_set_location(), gimple_uid(), walk_stmt_info::gsi, GSI_CONTINUE_LINKING, gsi_end_p(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_replace(), gsi_start_bb(), gsi_stmt(), basic_block_def::index, cgraph_edge::indirect_inlining_edge, cgraph_edge::indirect_unknown_callee, cgraph_edge::inline_failed, ipa_clone_ref(), is_gimple_assign(), is_gimple_call(), is_gimple_debug(), is_gimple_val(), maybe_duplicate_eh_stmt_fn(), memcpy(), pointer_set_insert(), basic_block_def::prev_bb, PROFILE_ABSENT, copy_body_data::regimplify, remap_gimple_stmt(), cgraph_edge::speculative, copy_body_data::src_cfun, copy_body_data::src_fn, copy_body_data::src_node, copy_body_data::statements_to_fold, cgraph_node::symbol, and copy_body_data::transform_call_graph_edges.
Referenced by copy_cfg_body().
|
static |
Referenced by copy_tree_body_r().
|
static |
References copy_tree_r(), remap_block(), and remap_decls().
|
static |
Make a copy of the body of FN so that it can be inserted inline in another function.
References copy_cfg_body(), and copy_debug_stmts().
Referenced by expand_call_inline(), and tree_function_versioning().
|
static |
Make a copy of the body of FN so that it can be inserted inline in another function. Walks FN via CFG, returns new fndecl.
References apply_scale(), basic_block_def::aux, bitmap_bit_p(), CB_CGE_DUPLICATE, cfun, copy_bb(), copy_edges_for_bb(), copy_loops(), copy_phis_for_bb(), edge_def::count, duplicate_eh_regions(), function::eh, copy_body_data::eh_lp_nr, copy_body_data::eh_map, get_loop(), copy_body_data::gimple_call, gimple_in_ssa_p(), gimple_register_cfg_hooks(), function::has_force_vect_loops, function::has_simduid_loops, basic_block_def::index, last, basic_block_def::loop_father, loops_for_fn(), LOOPS_NEED_FIXUP, loops_state_set(), make_edge(), maybe_move_debug_stmts_to_successors(), pointer_map_destroy(), basic_block_def::preds, edge_def::probability, redirect_all_calls(), remap_decl_1(), edge_def::src, stmt_can_make_abnormal_goto(), and copy_body_data::transform_call_graph_edges.
Referenced by copy_body().
|
static |
Copy the debug STMT using ID. We deal with these statements in a special way: if any variable in their VALUE expression wasn't remapped yet, we won't remap it, because that would get decl uids out of sync, causing codegen differences between -g and -g0. If this arises, we drop the VALUE expression altogether.
References copy_body_data::block, copy_body_data::debug_map, decl_debug_args_lookup(), copy_body_data::decl_map, gimple_block(), copy_body_data::gimple_call, GIMPLE_DEBUG_BIND, gimple_debug_bind_get_value_ptr(), gimple_debug_bind_get_var(), gimple_debug_bind_has_value_p(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), gimple_debug_bind_set_value(), gimple_debug_bind_set_var(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_value_ptr(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), gimple_debug_source_bind_set_var(), gimple_set_block(), walk_stmt_info::info, is_global_var(), memset(), pointer_map_contains(), processing_debug_stmt, remap_gimple_op_r(), copy_body_data::src_fn, gimple_statement_base::subcode, update_stmt(), and vec_safe_length().
Referenced by copy_debug_stmts().
|
static |
Process deferred debug stmts. In order to give values better odds of being successfully remapped, we delay the processing of debug stmts until all other stmts that might require remapping are processed.
References copy_debug_stmt(), and copy_body_data::debug_stmts.
Referenced by copy_body().
|
static |
Copy NODE (which must be a DECL). The DECL originally was in the FROM_FN, but now it will be in the TO_FN. PARM_TO_VAR means enable PARM_DECL to VAR_DECL translation.
References copy(), and copy_body_data::src_fn.
Referenced by copy_decl_no_change(), copy_decl_to_var(), and copy_result_decl_to_var().
|
static |
Referenced by optimize_inline_calls().
|
static |
References copy_decl_no_change(), and copy_decl_to_var().
tree copy_decl_no_change | ( | ) |
|
static |
Referenced by copy_arguments_for_versioning(), copy_decl_maybe_to_var(), and setup_one_parameter().
|
static |
References copy(), copy_decl_for_dup_finish(), copy_body_data::dst_fn, and type().
|
static |
Copy edges from BB into its copy constructed earlier, scale profile accordingly. Edges will be taken care of later. Assume aux pointers to point to the copies of each BB. Return true if any debug stmts are left after a statement that must end the basic block.
References apply_scale(), basic_block_def::aux, cfun, edge_def::count, edge_def::dest, edge_def::flags, gimple_in_ssa_p(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), basic_block_def::index, is_gimple_debug(), make_abnormal_goto_edges(), make_edge(), make_eh_dispatch_edges(), make_eh_edges(), edge_def::probability, si, split_block(), edge_def::src, stmt_can_make_abnormal_goto(), stmt_can_throw_internal(), basic_block_def::succs, update_ssa_across_abnormal_edges(), and update_stmt().
Referenced by copy_cfg_body().
|
static |
Determine if the function can be copied. If so return NULL. If not return a string describng the reason for failure.
References has_label_address_in_static_1().
Referenced by inline_forbidden_p(), and tree_versionable_function_p().
|
static |
Copy a GIMPLE_BIND statement STMT, remapping all the symbols in its block using the mapping information in ID.
References gimple_bind_block(), gimple_bind_body(), gimple_bind_vars(), gimple_build_bind(), remap_block(), remap_decls(), and remap_gimple_seq().
Referenced by remap_gimple_stmt().
gimple_seq copy_gimple_seq_and_replace_locals | ( | ) |
Copies everything in SEQ and replaces variables and labels local to current_function_decl.
References CB_CGE_DUPLICATE, copy(), copy_decl_no_change(), current_function_decl, gimple_seq_copy(), walk_stmt_info::info, mark_local_labels_stmt(), memset(), pointer_map_create(), pointer_map_destroy(), pointer_set_create(), pointer_set_destroy(), walk_stmt_info::pset, replace_locals_op(), replace_locals_stmt(), visited, and walk_gimple_seq().
Referenced by lower_try_finally_dup_block(), and optimize_double_finally().
|
static |
Make a copy of the sub-loops of SRC_PARENT and place them as siblings of DEST_PARENT.
References alloc_loop(), basic_block_def::aux, bitmap_bit_p(), cfun, copy_loop_info(), flow_loop_tree_node_add(), loop::header, basic_block_def::index, loop::inner, loop::latch, basic_block_def::loop_father, loop::next, and place_new_loop().
Referenced by copy_cfg_body().
|
static |
Copy the PHIs. All blocks and edges are copied, some blocks was possibly split and new outgoing EH edges inserted. BB points to the block of original function and AUX pointers links the original and newly copied blocks.
References add_phi_arg(), basic_block_def::aux, copy_tree_body_r(), create_phi_node(), copy_body_data::decl_map, find_edge(), force_gimple_operand(), gimple_phi_arg_location_from_edge(), gsi_commit_one_edge_insert(), gsi_end_p(), gsi_insert_seq_on_edge(), gsi_next(), gsi_start_phis(), gsi_stmt(), inserted, is_gimple_val(), line_table, pointer_map_contains(), basic_block_def::preds, si, edge_def::src, and virtual_operand_p().
Referenced by copy_cfg_body().
|
static |
Referenced by declare_return_variable().
|
static |
Like copy_decl_to_var, but create a return slot object instead of a pointer variable for return by invisible reference.
References copy(), copy_decl_for_dup_finish(), copy_body_data::dst_fn, and type().
|
static |
References alloc_stmt_list(), TSI_CONTINUE_LINKING, tsi_end_p(), tsi_link_after(), tsi_next(), tsi_start(), and tsi_stmt().
Referenced by copy_tree_body_r(), and copy_tree_r().
|
static |
Return a copy of the function's static chain.
References lang_hooks::dup_lang_specific_decl, and remap_decl().
Referenced by tree_function_versioning().
|
static |
Make a copy of the body of SRC_FN so that it can be inserted inline in another function.
References copy_tree_body_r().
Referenced by maybe_inline_call_in_expr().
tree copy_tree_body_r | ( | ) |
Called from copy_body_id via walk_tree. DATA is really a `copy_body_data *'.
References auto_var_in_fn_p(), build_empty_stmt(), build_int_cst_wide(), copy_bind_expr(), copy_node(), copy_statement_list(), copy_tree_r(), decl_function_context(), copy_body_data::decl_map, copy_body_data::do_not_unshare, fold_indirect_ref_1(), gimple_fold_indirect_ref(), is_gimple_min_invariant(), pointer_map_contains(), recompute_tree_invariant_for_addr_expr(), remap_decl(), remap_save_expr(), remap_ssa_name(), remap_type(), copy_body_data::src_fn, and unshare_expr().
Referenced by add_local_variables(), copy_phis_for_bb(), copy_tree_body(), fixup_child_record_type(), fixup_remapped_decl(), remap_decl(), remap_decls(), remap_type_1(), remap_vla_decls(), task_copyfn_remap_type(), and update_clone_info().
tree copy_tree_r | ( | ) |
Passed to walk_tree. Copies the node pointed to, if appropriate.
References copy_node(), copy_statement_list(), mf_mark(), mf_marked_p(), tcc_constant, tcc_declaration, tcc_type, and vec_safe_copy().
Referenced by copy_bind_expr(), copy_self_referential_tree_r(), copy_tree_body_r(), mostly_copy_tree_r(), and remap_gimple_op_r().
int count_insns_seq | ( | ) |
Estimate the number of instructions in a gimple_seq.
References estimate_num_insns(), gsi_end_p(), gsi_next(), and gsi_stmt().
Referenced by decide_copy_try_finally().
DEBUG_FUNCTION bool debug_find_tree | ( | ) |
References debug_find_tree_1().
|
static |
Allow someone to determine if SEARCH is a child of TOP from gdb.
Referenced by debug_find_tree().
Referenced by declare_return_variable(), initialize_inlined_parameters(), and tree_function_versioning().
|
static |
Declare the variables created by the inliner. Add all the variables in VARS to BIND_EXPR.
References add_local_decl(), cfun, and chainon().
|
static |
Prototypes.
Declare a return variable to replace the RESULT_DECL for the function we are calling. An appropriate DECL_STMT is returned. The USE_STMT is filled to contain a use of the declaration to indicate the return value of the function. RETURN_SLOT, if non-null is place where to store the result. It is set only for CALL_EXPR_RETURN_SLOT_OPT. MODIFY_DEST, if non-null, was the LHS of the MODIFY_EXPR to which this call is the RHS. The return value is a (possibly null) value that holds the result as seen by the caller.
References copy_body_data::block, build_int_cst(), copy_result_decl_to_var(), create_tmp_var(), declare_inline_vars(), fold_convertible_p(), get_base_address(), gimple_in_ssa_p(), insert_decl_map(), insert_init_stmt(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), is_global_var(), make_ssa_name(), copy_body_data::src_cfun, ssa_default_def(), and useless_type_conversion_p().
Referenced by expand_call_inline().
|
static |
Referenced by optimize_inline_calls(), and tree_function_versioning().
|
static |
Delete all unreachable basic blocks and update callgraph. Doing so is somewhat nontrivial because we need to update all clones and remove inline function that become unreachable.
References cgraph_edge::callee, CB_CGE_MOVE_CLONES, cgraph_remove_edge(), cgraph_remove_node_and_inline_clones(), changed, cgraph_node::clones, delete_basic_block(), copy_body_data::dst_node, find_unreachable_blocks(), basic_block_def::flags, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), cgraph_edge::inline_failed, ipa_remove_stmt_references(), basic_block_def::next_bb, cgraph_node::next_sibling_clone, and copy_body_data::transform_call_graph_edges.
int estimate_move_cost | ( | ) |
Estimate the cost of a memory move. Use machine dependent word size and take possible memcpy call into account.
References HOST_WIDE_INT, int_size_in_bytes(), and targetm.
Referenced by consider_split(), estimate_local_effects(), estimate_num_insns(), gather_context_independent_values(), and ipa_populate_param_decls().
int estimate_num_insns | ( | ) |
Estimate number of instructions that will be created by expanding STMT. WEIGHTS contains weights attributed to various constructs.
References asm_str_count(), BUILT_IN_NORMAL, eni_weights_d::call_cost, cgraph_get_node(), dconst2, symtab_node_base::definition, estimate_move_cost(), estimate_num_insns_seq(), estimate_operator_cost(), floor_log2(), get_gimple_rhs_class(), gimple_asm_string(), gimple_assign_lhs(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_bind_body(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_num_args(), gimple_catch_handler(), gimple_clobber_p(), gimple_cond_code(), gimple_eh_filter_failure(), gimple_omp_body(), gimple_omp_for_pre_body(), gimple_op(), gimple_store_p(), gimple_switch_num_labels(), gimple_transaction_body(), gimple_try_cleanup(), gimple_try_eval(), eni_weights_d::indirect_call_cost, is_inexpensive_builtin(), is_simple_builtin(), eni_weights_d::omp_cost, eni_weights_d::return_cost, cgraph_node::symbol, eni_weights_d::target_builtin_call_cost, eni_weights_d::time_based, and eni_weights_d::tm_cost.
Referenced by count_insns(), count_insns_seq(), early_inliner(), estimate_function_body_sizes(), estimate_num_insns_fn(), estimate_num_insns_seq(), execute_split_functions(), gimple_account_profile_record(), ipa_profile_generate_summary(), should_duplicate_loop_header_p(), tree_estimate_loop_size(), and tree_num_loop_insns().
int estimate_num_insns_fn | ( | ) |
Estimate number of instructions that will be created by expanding function FNDECL. WEIGHTS contains weights attributed to various constructs.
References function::cfg, estimate_num_insns(), gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().
|
static |
Estimate number of instructions that will be created by expanding the statements in the statement sequence STMTS. WEIGHTS contains weights attributed to various constructs.
References estimate_num_insns(), gsi_end_p(), gsi_next(), and gsi_stmt().
Referenced by estimate_num_insns().
|
static |
Returns cost of operation CODE, according to WEIGHTS
References eni_weights_d::div_mod_cost, get_gimple_rhs_class(), and GIMPLE_SINGLE_RHS.
Referenced by estimate_num_insns().
|
static |
If STMT is a GIMPLE_CALL, replace it with its inline expansion.
References add_local_variables(), function::after_inlining, copy_body_data::block, cgraph_edge::callee, cgraph_edge::caller, cfun, cgraph_edge(), cgraph_edge_recursive_p(), cgraph_get_body(), cgraph_global_info_ready, cgraph_inline_failed_string(), cgraph_remove_node(), copy_body(), basic_block_def::count, debug_hooks, copy_body_data::debug_map, symtab_node_base::decl, copy_body_data::decl_map, declare_return_variable(), edge_def::dest, copy_body_data::dst_fn, copy_body_data::dst_node, dump_file, dump_flags, error(), gimple_df::escaped, cgraph_edge::frequency, gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_block(), gimple_build_nop(), gimple_build_predict(), gimple_call_lhs(), gimple_call_return_slot_opt_p(), function::gimple_df, gimple_has_body_p(), gimple_location(), gimple_purge_dead_abnormal_call_edges(), gimple_purge_dead_eh_edges(), gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_remove(), gsi_replace(), gsi_start_bb(), cgraph_edge::indirect_inlining_edge, cgraph_edge::indirect_unknown_callee, initialize_inlined_parameters(), cgraph_edge::inline_failed, input_location, is_gimple_assign(), cgraph_node::local, lookup_attribute(), lookup_stmt_eh_lp(), maybe_clean_or_replace_eh_stmt(), NOT_TAKEN, gcc_debug_hooks::outlining_inline_function, pointer_map_create(), pointer_map_destroy(), prepend_lexical_block(), print_generic_expr(), pt_solution_reset(), cgraph_local_info::redefined_extern_inline, remap_blocks(), remap_blocks_to_null(), remove_edge(), set_ssa_default_def(), si, split_block(), edge_def::src, copy_body_data::src_cfun, copy_body_data::src_fn, ssa_default_def(), cgraph_node::symbol, unlink_stmt_vdef(), verify_cgraph_node(), and warning().
Referenced by gimple_expand_calls_inline().
|
static |
Walk all basic blocks created after FIRST and try to fold every statement in the STATEMENTS pointer set.
References cgraph_update_edges_for_call_stmt(), fold_stmt(), gimple_call_fndecl(), gimple_purge_dead_eh_edges(), gsi_end_p(), gsi_next(), gsi_prev(), gsi_start_bb(), gsi_stmt(), i2, is_gimple_call(), maybe_clean_or_replace_eh_stmt(), pointer_set_contains(), and update_stmt().
Referenced by optimize_inline_calls(), and tree_function_versioning().
|
static |
Return false if the function FNDECL cannot be inlined on account of its attributes, true otherwise.
References is_attribute_p(), and targetm.
Referenced by tree_inlinable_function_p().
|
static |
Expand call statements reachable from STMT_P. We can only have CALL_EXPRs as the "toplevel" tree code or nested in a MODIFY_EXPR.
References expand_call_inline(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), and is_gimple_call().
Referenced by optimize_inline_calls().
|
inlinestatic |
Return true if BB has at least one abnormal outgoing edge.
References edge_def::flags, and basic_block_def::succs.
|
static |
Callback through walk_tree. Determine if a DECL_INITIAL makes reference to a local label.
Referenced by copy_forbidden().
void init_inline_once | ( | void | ) |
Initializes weights used by estimate_num_insns.
References eni_weights_d::call_cost, eni_weights_d::div_mod_cost, eni_weights_d::indirect_call_cost, eni_weights_d::omp_cost, eni_weights_d::return_cost, eni_weights_d::target_builtin_call_cost, eni_weights_d::time_based, and eni_weights_d::tm_cost.
Referenced by backend_init().
|
static |
Build struct function and associated datastructures for the new clone NEW_FNDECL to be build. CALLEE_FNDECL is the original. Function changes the cfun to the function of new_fndecl (and current_function_decl too).
References function::after_inlining, function::can_delete_dead_exceptions, function::can_throw_non_call_exceptions, function::cfg, cfun, function::curr_properties, function::decl, function::eh, function::function_end_locus, function::gimple_df, gimple_register_cfg_hooks(), function::has_nonlocal_label, gimple_df::in_ssa_p, init_eh_for_function(), init_empty_tree_cfg(), init_ssa_operands(), init_tree_ssa(), function::last_verified, function::local_decls, function::nonlocal_goto_save_area, push_struct_function(), function::returns_pcc_struct, function::returns_struct, function::static_chain_decl, function::stdarg, function::va_list_fpr_size, and function::va_list_gpr_size.
Referenced by tree_function_versioning().
|
static |
Generate code to initialize the parameters of the function at the top of the stack in ID from the GIMPLE_CALL STMT.
References copy_body_data::block, cfun, current_function_decl, copy_body_data::decl_map, declare_inline_vars(), gimple_call_arg(), gimple_call_chain(), gimple_call_num_args(), gimple_in_ssa_p(), is_gimple_reg(), pointer_map_contains(), remap_type(), setup_one_parameter(), copy_body_data::src_cfun, and ssa_default_def().
Referenced by expand_call_inline().
|
static |
Return true if FNDECL is a function that cannot be inlined into another one.
References bb_seq(), copy_forbidden(), walk_stmt_info::info, inline_forbidden_p_stmt(), inline_forbidden_reason, memset(), pointer_set_create(), pointer_set_destroy(), walk_stmt_info::pset, visited_nodes, and walk_gimple_seq().
Referenced by tree_inlinable_function_p().
|
static |
A callback for walk_gimple_seq to handle statements. Returns non-null iff a function can not be inlined. Also sets the reason why.
References BUILT_IN_NORMAL, gimple_alloca_call_p(), gimple_call_alloca_for_var_p(), gimple_call_fndecl(), gimple_goto_dest(), gsi_stmt(), walk_stmt_info::info, inline_forbidden_reason, lookup_attribute(), and setjmp_call_p().
Referenced by inline_forbidden_p().
|
static |
Insert a tree->tree mapping for ID. This is only used for variables.
References copy_body_data::debug_map, gimple_in_ssa_p(), pointer_map_create(), pointer_map_insert(), copy_body_data::src_cfun, and target_for_debug_bind().
Referenced by setup_one_parameter().
void insert_decl_map | ( | ) |
Insert a tree->tree mapping for ID. Despite the name suggests that the trees should be variables, it is used for more than that.
References copy_body_data::decl_map, and pointer_map_insert().
Referenced by copy_arguments_for_versioning(), declare_return_variable(), install_var_local(), mark_local_labels_stmt(), omp_copy_decl(), remap_block(), remap_blocks_to_null(), remap_decl(), remap_ssa_name(), remap_type(), remap_type_1(), scan_omp_1_stmt(), setup_one_parameter(), and tree_function_versioning().
|
static |
Append to BB a debug annotation that binds VAR to VALUE, inheriting lexical block and line number information from base_stmt, if given, or from the last stmt of the block otherwise.
References gimple_in_ssa_p(), walk_stmt_info::gsi, gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_SAME_STMT, gsi_stmt(), copy_body_data::src_cfun, and target_for_debug_bind().
Referenced by insert_init_stmt(), and setup_one_parameter().
|
static |
References force_gimple_operand_gsi(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_class(), gimple_assign_rhs_code(), gimple_assign_set_rhs1(), gimple_assign_set_rhs_code(), gimple_expr_type(), gimple_regimplify_operands(), GIMPLE_UNARY_RHS, gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, insert_init_debug_bind(), is_gimple_debug(), is_gimple_reg(), is_gimple_reg_type(), and si.
Referenced by declare_return_variable(), setup_one_parameter(), and tree_function_versioning().
|
static |
Called via walk_gimple_seq. If *GSIP points to a GIMPLE_LABEL for a local label, copies the declaration and enters it in the splay_tree in DATA (which is really a 'copy_body_data *'.
References copy_body_data::copy_decl, gimple_label_label(), gsi_stmt(), walk_stmt_info::info, and insert_decl_map().
Referenced by copy_gimple_seq_and_replace_locals().
tree maybe_inline_call_in_expr | ( | ) |
EXP is CALL_EXPR present in a GENERIC expression tree. Try to integrate the callee and return the inlined body on success.
References CB_CGE_DUPLICATE, copy_decl_no_change(), copy_tree_body(), current_function_decl, first_call_expr_arg(), get_callee_fndecl(), memset(), next_call_expr_arg(), pointer_map_create(), pointer_map_destroy(), and pointer_map_insert().
Referenced by substitute_in_expr().
|
static |
Helper function for copy_cfg_body. Move debug stmts from the end of NEW_BB to the beginning of successor basic blocks when needed. If the successor has multiple predecessors, reset them, otherwise keep their value.
References edge_def::dest, ei_one_before_end_p(), gimple_debug_bind_get_value(), gimple_debug_bind_get_var(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), gsi_after_labels(), gsi_end_p(), gsi_insert_before(), gsi_last_bb(), gsi_last_nondebug_bb(), gsi_one_before_end_p(), gsi_prev(), gsi_remove(), GSI_SAME_STMT, gsi_stmt(), is_gimple_debug(), si, single_pred_p(), stmt_can_make_abnormal_goto(), stmt_can_throw_internal(), basic_block_def::succs, and unshare_expr().
Referenced by copy_cfg_body().
unsigned int optimize_inline_calls | ( | ) |
Expand calls to inline functions in the body of FN.
References CB_CGE_DUPLICATE, CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, cgraph_get_node(), copy_decl_maybe_to_var(), current_function_decl, delete_unreachable_blocks_update_callgraph(), fold_marked_statements(), free_dominance_info(), gimple_expand_calls_inline(), gimple_in_ssa_p(), gimple_register_cfg_hooks(), cgraph_edge::inline_failed, last, memset(), cgraph_edge::next_callee, number_blocks(), pointer_set_create(), pointer_set_destroy(), pop_gimplify_context(), PROFILE_ABSENT, push_gimplify_context(), and verify_cgraph_node().
Referenced by early_inliner(), and inline_transform().
Referenced by expand_call_inline(), and remap_blocks().
|
static |
Install new lexical TREE_BLOCK underneath 'current_block'.
References current_block.
void redirect_all_calls | ( | ) |
Call cgraph_redirect_edge_call_stmt_to_callee on all calls in BB
References cgraph_edge(), cgraph_redirect_edge_call_stmt_to_callee(), copy_body_data::dst_node, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), and si.
Referenced by copy_cfg_body().
|
static |
Referenced by copy_bind_expr(), copy_gimple_bind(), remap_blocks(), and replace_locals_stmt().
|
static |
Copy the BLOCK to contain remapped versions of the variables therein. And hook the new block into the block-tree.
References insert_decl_map(), remap_decls(), copy_body_data::transform_lang_insert_block, and vec_safe_copy().
|
static |
Copy the whole block tree and root it in id->block.
References blocks_nreverse(), prepend_lexical_block(), and remap_block().
Referenced by expand_call_inline(), and tree_function_versioning().
|
static |
Remap the block tree rooted at BLOCK to nothing.
References insert_decl_map().
Referenced by expand_call_inline().
tree remap_decl | ( | ) |
Remap DECL during the copying of the BLOCK tree for the function.
References copy_tree_body_r(), copy_body_data::decl_map, copy_body_data::do_not_unshare, insert_decl_map(), pointer_map_contains(), processing_debug_stmt, remap_type(), and unshare_expr().
Referenced by add_local_variables(), copy_arguments_for_versioning(), copy_static_chain(), copy_tree_body_r(), finalize_nesting_tree_1(), fixup_remapped_decl(), remap_decl_1(), remap_decls(), remap_gimple_op_r(), remap_ssa_name(), remap_type_1(), remap_vla_decls(), scan_omp_1_op(), and tree_function_versioning().
|
static |
Wrapper for remap_decl so it can be used as a callback.
References remap_decl().
Referenced by copy_cfg_body().
|
static |
References add_local_decl(), can_be_nonlocal(), cfun, copy_tree_body_r(), DINFO_LEVEL_TERSE, nreverse(), remap_decl(), copy_body_data::retvar, and vec_safe_push().
Referenced by copy_bind_expr(), copy_gimple_bind(), remap_block(), and replace_locals_stmt().
|
static |
Helper for remap_gimple_stmt. Given an EH region number for the source function, map that to the duplicate EH region number in the destination function.
References copy_body_data::eh_map, get_eh_region_from_number_fn(), eh_region_d::index, pointer_map_contains(), and copy_body_data::src_cfun.
Referenced by remap_eh_region_tree_nr(), and remap_gimple_stmt().
|
static |
Similar, but operate on INTEGER_CSTs.
References build_int_cst(), remap_eh_region_nr(), and tree_low_cst().
Referenced by remap_gimple_stmt().
|
static |
Remap the GIMPLE operand pointed to by *TP. DATA is really a 'struct walk_stmt_info *'. DATA->INFO is a 'copy_body_data *'. WALK_SUBTREES is used to indicate walk_gimple_op whether to keep recursing into the children nodes of *TP.
References auto_var_in_fn_p(), build_int_cst_wide(), copy_node(), copy_tree_r(), decl_function_context(), copy_body_data::decl_map, walk_stmt_info::info, is_gimple_min_invariant(), pointer_map_contains(), recompute_tree_invariant_for_addr_expr(), remap_decl(), remap_ssa_name(), remap_type(), copy_body_data::src_fn, and useless_type_conversion_p().
Referenced by copy_debug_stmt(), remap_gimple_stmt(), and tree_function_versioning().
|
static |
Create a new gimple_seq by remapping all the statements in BODY using the inlining information in ID.
References gimple_seq_add_stmt(), gsi_end_p(), gsi_next(), gsi_stmt(), remap_gimple_stmt(), and si.
Referenced by copy_gimple_bind(), and remap_gimple_stmt().
|
static |
Referenced by copy_bb(), and remap_gimple_seq().
|
static |
Helper for copy_bb. Remap statement STMT using the inlining information in ID. Return the new statement copy.
References auto_var_in_fn_p(), bitmap_bit_p(), copy_body_data::blocks_to_copy, BUILT_IN_NORMAL, copy(), copy_gimple_bind(), copy_body_data::decl_map, copy_body_data::eh_map, gimple_assign_copy_p(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_block(), gimple_build_catch(), gimple_build_eh_filter(), gimple_build_nop(), gimple_build_omp_critical(), gimple_build_omp_for(), gimple_build_omp_master(), gimple_build_omp_ordered(), gimple_build_omp_parallel(), gimple_build_omp_section(), gimple_build_omp_sections(), gimple_build_omp_single(), gimple_build_omp_task(), gimple_build_transaction(), gimple_build_try(), gimple_build_wce(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_reset_alias_info(), gimple_call_set_arg(), gimple_catch_handler(), gimple_catch_types(), gimple_clobber_p(), gimple_copy(), gimple_debug_bind_get_value(), gimple_debug_bind_get_var(), gimple_debug_bind_p(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), function::gimple_df, gimple_eh_dispatch_region(), gimple_eh_dispatch_set_region(), gimple_eh_filter_failure(), gimple_eh_filter_types(), gimple_has_mem_ops(), gimple_has_substatements(), gimple_omp_body(), gimple_omp_critical_name(), gimple_omp_for_clauses(), gimple_omp_for_collapse(), gimple_omp_for_cond(), gimple_omp_for_final(), gimple_omp_for_incr(), gimple_omp_for_index(), gimple_omp_for_initial(), gimple_omp_for_kind(), gimple_omp_for_pre_body(), gimple_omp_for_set_cond(), gimple_omp_for_set_final(), gimple_omp_for_set_incr(), gimple_omp_for_set_index(), gimple_omp_for_set_initial(), gimple_omp_parallel_child_fn(), gimple_omp_parallel_clauses(), gimple_omp_parallel_data_arg(), gimple_omp_sections_clauses(), gimple_omp_single_clauses(), gimple_omp_task_arg_align(), gimple_omp_task_arg_size(), gimple_omp_task_child_fn(), gimple_omp_task_clauses(), gimple_omp_task_copy_fn(), gimple_omp_task_data_arg(), gimple_op_ptr(), gimple_resx_region(), gimple_resx_set_region(), gimple_return_retval(), gimple_set_block(), gimple_set_vdef(), gimple_set_vuse(), gimple_transaction_body(), gimple_transaction_label(), gimple_transaction_set_subcode(), gimple_transaction_subcode(), gimple_try_cleanup(), gimple_try_eval(), gimple_try_kind(), gimple_wce_cleanup(), walk_stmt_info::info, gimple_df::ipa_pta, memset(), pointer_map_contains(), remap_eh_region_nr(), remap_eh_region_tree_nr(), remap_gimple_op_r(), remap_gimple_seq(), copy_body_data::retvar, copy_body_data::src_cfun, copy_body_data::src_fn, copy_body_data::transform_return_to_modify, and walk_gimple_op().
|
static |
Referenced by copy_tree_body_r().
|
static |
The SAVE_EXPR pointed to by TP is being copied. If ST contains information indicating to what new SAVE_EXPR this one should be mapped, use that one. Otherwise, create a new node and enter it in ST. FN is the function into which the copy will be placed.
References copy_node(), pointer_map_contains(), and pointer_map_insert().
|
static |
Construct new SSA name for old NAME. ID is the inline context.
References pt_solution::anything, build_zero_cst(), cfun, copy_body_data::decl_map, copy_body_data::entry_bb, get_ptr_info(), gimple_build_nop(), function::gimple_df, gsi_after_labels(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, GSI_SAME_STMT, insert_decl_map(), gimple_df::ipa_pta, make_ssa_name(), pointer_map_contains(), basic_block_def::preds, processing_debug_stmt, ptr_info_def::pt, remap_decl(), remap_type(), set_ssa_default_def(), single_succ(), single_succ_p(), copy_body_data::src_cfun, copy_body_data::transform_return_to_modify, and unshare_expr().
Referenced by copy_tree_body_r(), remap_gimple_op_r(), and setup_one_parameter().
tree remap_type | ( | ) |
References copy_body_data::decl_map, insert_decl_map(), pointer_map_contains(), remap_type_1(), copy_body_data::src_fn, type(), and variably_modified_type_p().
Referenced by copy_tree_body_r(), finalize_nesting_tree_1(), fixup_child_record_type(), fixup_remapped_decl(), initialize_inlined_parameters(), nesting_copy_decl(), remap_decl(), remap_gimple_op_r(), remap_ssa_name(), remap_type_1(), remap_vla_decls(), scan_omp_1_op(), and task_copyfn_remap_type().
|
static |
References build_pointer_type_for_mode(), build_reference_type_for_mode(), build_type_attribute_qual_variant(), copy_node(), copy_tree_body_r(), insert_decl_map(), nreverse(), remap_decl(), and remap_type().
Referenced by build_duplicate_type(), and remap_type().
|
static |
Called via walk_gimple_seq by copy_gimple_seq_and_replace_local. Using the splay_tree pointed to by ST (which is really a `splay_tree'), remaps all local declarations to appropriate replacements in gimple operands.
References copy_body_data::decl_map, walk_stmt_info::info, and pointer_map_contains().
Referenced by copy_gimple_seq_and_replace_locals().
|
static |
Called via walk_gimple_seq by copy_gimple_seq_and_replace_local. Using the splay_tree pointed to by ST (which is really a `splay_tree'), remaps all local declarations to appropriate replacements in gimple statements.
References gimple_bind_block(), gimple_bind_set_block(), gimple_bind_set_vars(), gimple_bind_vars(), gsi_stmt(), walk_stmt_info::info, remap_block(), and remap_decls().
Referenced by copy_gimple_seq_and_replace_locals().
|
static |
Return true if VALUE is an ADDR_EXPR of an automatic variable defined in function FN, or of a data member thereof.
References auto_var_in_fn_p(), and get_base_address().
Referenced by setup_one_parameter().
|
static |
Initialize parameter P with VALUE. If needed, produce init statement at the end of BB. When BB is NULL, we return init statement to be output later.
References build_zero_cst(), cfun, copy_decl_to_var(), fold_convertible_p(), gimple_in_ssa_p(), insert_debug_decl_map(), insert_decl_map(), insert_init_debug_bind(), insert_init_stmt(), is_gimple_min_invariant(), is_gimple_reg(), is_gimple_reg_type(), make_ssa_name(), remap_ssa_name(), self_inlining_addr_expr(), set_ssa_default_def(), copy_body_data::src_cfun, ssa_default_def(), and useless_type_conversion_p().
Referenced by initialize_inlined_parameters(), and tree_function_versioning().
void tree_function_versioning | ( | tree | old_decl, |
tree | new_decl, | ||
vec< ipa_replace_map_p, va_gc > * | tree_map, | ||
bool | update_clones, | ||
bitmap | args_to_skip, | ||
bool | skip_return, | ||
bitmap | blocks_to_copy, | ||
basic_block | new_entry | ||
) |
Create a copy of a function's tree. OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes of the original function and the new copied function respectively. In case we want to replace a DECL tree with another tree while duplicating the function's body, TREE_MAP represents the mapping between these trees. If UPDATE_CLONES is set, the call_stmt fields of edges of clones of the function will be updated. If non-NULL ARGS_TO_SKIP determine function parameters to remove from new version. If SKIP_RETURN is true, the new version will return void. If non-NULL BLOCK_TO_COPY determine what basic blocks to copy. If non_NULL NEW_ENTRY determine new entry BB of the clone.
References add_local_variables(), cgraph_edge::call_stmt, cgraph_node::callees, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, cgraph_get_node(), cgraph_rebuild_references(), compute_call_stmt_bb_frequency(), copy_arguments_for_versioning(), copy_body(), copy_decl_no_change(), copy_static_chain(), basic_block_def::count, cgraph_node::count, cgraph_edge::count, function::curr_properties, current_function_decl, debug_hooks, decl_debug_args_insert(), decl_debug_args_lookup(), declare_inline_vars(), delete_unreachable_blocks_update_callgraph(), dump_file, lang_hooks::dup_lang_specific_decl, fold_cond_expr_cond(), fold_convertible_p(), fold_marked_statements(), free_dominance_info(), cgraph_edge::frequency, gimple_bb(), gimple_build_nop(), gimple_in_ssa_p(), cgraph_node::indirect_calls, walk_stmt_info::info, initialize_cfun(), insert_decl_map(), insert_init_stmt(), loop_optimizer_init(), loops_for_fn(), make_ssa_name(), memset(), ipa_replace_map::new_tree, cgraph_edge::next_callee, function::nonlocal_goto_save_area, number_blocks(), ipa_replace_map::old_tree, gcc_debug_hooks::outlining_inline_function, ipa_replace_map::parm_num, pointer_map_create(), pointer_map_destroy(), pointer_set_create(), pointer_set_destroy(), pop_cfun(), print_generic_expr(), rebuild_frequencies(), remap_blocks(), remap_decl(), remap_gimple_op_r(), ipa_replace_map::replace_p, function::returns_pcc_struct, function::returns_struct, set_ssa_default_def(), setup_one_parameter(), single_succ_edge(), split_edge(), ssa_default_def(), update_clone_info(), update_ssa(), cgraph_node::used_as_abstract_origin, useless_type_conversion_p(), vec_safe_copy(), and vec_safe_is_empty().
Referenced by cgraph_function_versioning(), cgraph_materialize_clone(), ipa_tm_create_version(), and save_inline_function_body().
bool tree_inlinable_function_p | ( | ) |
Returns nonzero if FN is a function that does not have any fundamental inline blocking properties.
References error(), function_attribute_inlinable_p(), inline_forbidden_p(), inline_forbidden_reason, lookup_attribute(), and warning().
Referenced by compute_inline_parameters().
bool tree_versionable_function_p | ( | ) |
Return true if the function is allowed to be versioned. This is a guard for the versioning functionality.
References copy_forbidden(), and lookup_attribute().
Referenced by cgraph_create_virtual_clone(), cgraph_function_versioning(), execute_split_functions(), ipa_sra_preliminary_function_checks(), ipa_tm_execute(), and ipcp_generate_summary().
|
static |
Update clone info after duplication.
References cgraph_node::clone, cgraph_node::clone_of, cgraph_node::clones, copy_tree_body_r(), copy_body_data::dst_node, ipa_replace_map::new_tree, cgraph_node::next_sibling_clone, ipa_replace_map::old_tree, cgraph_clone_info::tree_map, and vec_safe_length().
Referenced by tree_function_versioning().
|
static |
Inserting Single Entry Multiple Exit region in SSA form into code in SSA form is quite easy, since dominator relationship for old basic blocks does not change. There is however exception where inlining might change dominator relation across EH edges from basic block within inlined functions destinating to landing pads in function we inline into. The function fills in PHI_RESULTs of such PHI nodes if they refer to gimple regs. Otherwise, the function mark PHI_RESULT of such PHI nodes for renaming. For non-gimple regs, renaming is safe: the EH edges are abnormal and SSA_NAME_OCCURS_IN_ABNORMAL_PHI must be set, and this means that there will be no overlapping live ranges for the underlying symbol. This might change in future if we allow redirecting of EH edges and we might want to change way build CFG pre-inlining to include all the possible edges then.
References basic_block_def::aux, edge_def::dest, find_edge(), edge_def::flags, gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), si, and basic_block_def::succs.
Referenced by copy_edges_for_bb().
eni_weights eni_size_weights |
@verbatim Tree inlining.
Copyright (C) 2001-2013 Free Software Foundation, Inc. Contributed by Alexandre Oliva aoliv a@re dhat. 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/.
I'm not real happy about this, but we need to handle gimple and non-gimple trees.
Inlining, Cloning, Versioning, Parallelization Inlining: a function body is duplicated, but the PARM_DECLs are remapped into VAR_DECLs, and non-void RETURN_EXPRs become MODIFY_EXPRs that store to a dedicated returned-value variable. The duplicated eh_region info of the copy will later be appended to the info for the caller; the eh_region info in copied throwing statements and RESX statements are adjusted accordingly. Cloning: (only in C++) We have one body for a con/de/structor, and multiple function decls, each with a unique parameter list. Duplicate the body, using the given splay tree; some parameters will become constants (like 0 or 1). Versioning: a function body is duplicated and the result is a new function rather than into blocks of an existing function as with inlining. Some parameters will become constants. Parallelization: a region of a function is duplicated resulting in a new function. Variables may be replaced with complex expressions to enable shared variable semantics. All of these will simultaneously lookup any callgraph edges. If we're going to inline the duplicated function body, and the given function has some cloned callgraph nodes (one for each place this function will be inlined) those callgraph edges will be duplicated. If we're cloning the body, those callgraph edges will be updated to point into the new body. (Note that the original callgraph node and edge list will not be altered.) See the CALL_EXPR handling case in copy_tree_body_r ().
To Do: o In order to make inlining-on-trees work, we pessimized function-local static constants. In particular, they are now always output, even when not addressed. Fix this by treating function-local static constants just like global static constants; the back-end already knows not to output them if they are not needed. o Provide heuristics to clamp inlining of recursive template calls?
Weights that estimate_num_insns uses to estimate the size of the produced code.
Referenced by can_unroll_loop_p(), consider_split(), count_insns(), decide_copy_try_finally(), early_inliner(), estimate_edge_devirt_benefit(), estimate_function_body_sizes(), execute_split_functions(), gimple_account_profile_record(), ipa_make_edge_direct_to_target(), ipa_profile_generate_summary(), loop_prefetch_arrays(), should_duplicate_loop_header_p(), tree_estimate_loop_size(), and tree_ssa_unswitch_loops().
eni_weights eni_time_weights |
Weights that estimate_num_insns uses to estimate the time necessary to execute the produced code.
Referenced by early_inliner(), estimate_edge_devirt_benefit(), estimate_function_body_sizes(), execute_split_functions(), gimple_account_profile_record(), ipa_make_edge_direct_to_target(), ipa_profile_generate_summary(), and loop_prefetch_arrays().
|
static |
Referenced by inline_forbidden_p(), inline_forbidden_p_stmt(), and tree_inlinable_function_p().
|
static |
If nonzero, we're remapping the contents of inlined debug statements. If negative, an error has occurred, such as a reference to a variable that isn't available in the inlined context.
Referenced by copy_debug_stmt(), remap_decl(), and remap_ssa_name().