GCC Middle and Back End API Reference
tree-inline.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "cfghooks.h"
#include "tree-pass.h"
#include "ssa.h"
#include "cgraph.h"
#include "tree-pretty-print.h"
#include "diagnostic-core.h"
#include "gimple-predict.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "calls.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "cfganal.h"
#include "tree-iterator.h"
#include "intl.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "except.h"
#include "debug.h"
#include "value-prof.h"
#include "cfgloop.h"
#include "builtins.h"
#include "stringpool.h"
#include "attribs.h"
#include "sreal.h"
#include "tree-cfgcleanup.h"
#include "tree-ssa-live.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "symtab-thunks.h"
#include "symtab-clones.h"
Include dependency graph for tree-inline.cc:




static tree declare_return_variable (copy_body_data *, tree, tree, basic_block)
static void remap_block (tree *, copy_body_data *)
static void copy_bind_expr (tree *, int *, copy_body_data *)
static void declare_inline_vars (tree, tree)
static void remap_save_expr (tree *, hash_map< tree, tree > *, int *)
static void prepend_lexical_block (tree current_block, tree new_block)
static tree copy_result_decl_to_var (tree, copy_body_data *)
static tree copy_decl_maybe_to_var (tree, copy_body_data *)
static gimple_seq remap_gimple_stmt (gimple *, copy_body_data *)
static void insert_init_stmt (copy_body_data *, basic_block, gimple *)
void insert_decl_map (copy_body_data *id, tree key, tree value)
static tree remap_ssa_name (tree name, copy_body_data *id)
tree remap_decl (tree decl, copy_body_data *id)
static tree remap_type_1 (tree type, copy_body_data *id)
static tree remap_type_3 (tree *tp, int *walk_subtrees, void *data)
static bool remap_type_2 (tree type, copy_body_data *id)
tree remap_type (tree type, copy_body_data *id)
static bool can_be_nonlocal (tree decl, copy_body_data *id)
static tree remap_decls (tree decls, vec< tree, va_gc > **nonlocalized_list, copy_body_data *id)
static tree remap_blocks (tree block, copy_body_data *id)
static void remap_blocks_to_null (tree block, copy_body_data *id)
static location_t remap_location (location_t locus, copy_body_data *id)
static void copy_statement_list (tree *tp)
static gimple_seq remap_gimple_seq (gimple_seq body, copy_body_data *id)
static gimplecopy_gimple_bind (gbind *stmt, copy_body_data *id)
static bool is_parm (tree decl)
static unsigned short remap_dependence_clique (copy_body_data *id, unsigned short clique)
static tree remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
tree copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
static int remap_eh_region_nr (int old_nr, copy_body_data *id)
static tree remap_eh_region_tree_nr (tree old_t_nr, copy_body_data *id)
static basic_block copy_bb (copy_body_data *id, basic_block bb, profile_count num, profile_count den)
static void update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb, bool can_throw, bool nonlocal_goto)
static void add_clobbers_to_eh_landing_pad (copy_body_data *id)
static bool copy_edges_for_bb (basic_block bb, profile_count num, profile_count den, basic_block ret_bb, basic_block abnormal_goto_dest, copy_body_data *id)
static void copy_phis_for_bb (basic_block bb, copy_body_data *id)
static tree remap_decl_1 (tree decl, void *data)
static void initialize_cfun (tree new_fndecl, tree callee_fndecl, profile_count count)
static void maybe_move_debug_stmts_to_successors (copy_body_data *id, basic_block new_bb)
static void copy_loops (copy_body_data *id, class loop *dest_parent, class loop *src_parent)
void redirect_all_calls (copy_body_data *id, basic_block bb)
static tree copy_cfg_body (copy_body_data *id, basic_block entry_block_map, basic_block exit_block_map, basic_block new_entry)
static void copy_debug_stmt (gdebug *stmt, copy_body_data *id)
static void copy_debug_stmts (copy_body_data *id)
static tree copy_tree_body (copy_body_data *id)
static tree copy_body (copy_body_data *id, basic_block entry_block_map, basic_block exit_block_map, basic_block new_entry)
static bool self_inlining_addr_expr (tree value, tree fn)
static gimpleinsert_init_debug_bind (copy_body_data *id, basic_block bb, tree var, tree value, gimple *base_stmt)
tree force_value_to_type (tree type, tree value)
static gimplesetup_one_parameter (copy_body_data *id, tree p, tree value, tree fn, basic_block bb, tree *vars)
static void initialize_inlined_parameters (copy_body_data *id, gimple *stmt, tree fn, basic_block bb)
const charcopy_forbidden (struct function *fun)
static tree inline_forbidden_p_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, struct walk_stmt_info *wip)
static bool inline_forbidden_p (tree fndecl)
static bool function_attribute_inlinable_p (const_tree fndecl)
bool tree_inlinable_function_p (tree fn)
int estimate_move_cost (tree type, bool ARG_UNUSED(speed_p))
static int estimate_operator_cost (enum tree_code code, eni_weights *weights, tree op1, tree op2)
int estimate_num_insns_seq (gimple_seq stmts, eni_weights *weights)
int estimate_num_insns (gimple *stmt, eni_weights *weights)
int estimate_num_insns_fn (tree fndecl, eni_weights *weights)
void init_inline_once (void)
static void add_local_variables (struct function *callee, struct function *caller, copy_body_data *id)
static void reset_debug_binding (copy_body_data *id, tree srcvar, gimple_seq *bindings)
static void reset_debug_bindings (copy_body_data *id, gimple_stmt_iterator gsi)
static bool expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id, bitmap to_purge)
static bool gimple_expand_calls_inline (basic_block bb, copy_body_data *id, bitmap to_purge)
static void fold_marked_statements (int first, hash_set< gimple * > *statements)
unsigned int optimize_inline_calls (tree fn)
tree copy_tree_r (tree *tp, int *walk_subtrees, void *data)
static tree mark_local_labels_stmt (gimple_stmt_iterator *gsip, bool *handled_ops_p, struct walk_stmt_info *wi)
static gimple_seq duplicate_remap_omp_clause_seq (gimple_seq seq, struct walk_stmt_info *wi)
static tree replace_locals_op (tree *tp, int *walk_subtrees, void *data)
static tree replace_locals_stmt (gimple_stmt_iterator *gsip, bool *handled_ops_p, struct walk_stmt_info *wi)
gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq)
static tree debug_find_tree_1 (tree *tp, int *walk_subtrees, void *data)
DEBUG_FUNCTION bool debug_find_tree (tree top, tree search)
tree copy_decl_for_dup_finish (copy_body_data *id, tree decl, tree copy)
tree copy_decl_to_var (tree decl, copy_body_data *id)
tree copy_decl_no_change (tree decl, copy_body_data *id)
static tree copy_arguments_nochange (tree orig_parm, copy_body_data *id)
static tree copy_static_chain (tree static_chain, copy_body_data *id)
bool tree_versionable_function_p (tree fndecl)
static void update_clone_info (copy_body_data *id)
void tree_function_versioning (tree old_decl, tree new_decl, vec< ipa_replace_map *, va_gc > *tree_map, ipa_param_adjustments *param_adjustments, bool update_clones, bitmap blocks_to_copy, basic_block new_entry)
tree maybe_inline_call_in_expr (tree exp)
tree build_duplicate_type (tree type)
tree copy_fn (tree fn, tree &parms, tree &result)


eni_weights eni_size_weights
eni_weights eni_time_weights
static int processing_debug_stmt = 0
static const charinline_forbidden_reason

Macro Definition Documentation


do \
{ \
tree _t = (T); \
if (_t) \
{ \
if (DECL_P (_t) && remap_decl (_t, id) != _t) \
return true; \
&& walk_tree (&_t, remap_type_3, id, NULL)) \
return true; \
} \
} \
while (0)
union tree_node * tree
Definition coretypes.h:97
static struct token T
Definition gengtype-parse.cc:45
Definition ggc.h:184
Definition gengtype.h:252
#define NULL
Definition system.h:50
static tree remap_type_3(tree *tp, int *walk_subtrees, void *data)
Definition tree-inline.cc:605
tree remap_decl(tree decl, copy_body_data *id)
Definition tree-inline.cc:336
Definition tree.h:941
#define walk_tree(a, b, c, d)
Definition tree.h:5718
#define DECL_P(NODE)
Definition tree.h:231

Function Documentation

◆ add_clobbers_to_eh_landing_pad()

◆ add_local_variables()

◆ build_duplicate_type()

tree build_duplicate_type ( tree type)

◆ can_be_nonlocal()

static bool can_be_nonlocal ( tree decl,
copy_body_data * id )
Decide if DECL can be put into BLOCK_NONLOCAL_VARs.   

References auto_var_in_fn_p(), ggc_alloc(), TREE_CODE, and VAR_P.

Referenced by add_local_variables(), remap_decls(), and replace_locals_stmt().

◆ copy_arguments_nochange()

static tree copy_arguments_nochange ( tree orig_parm,
copy_body_data * id )
Return a copy of the function's argument tree without any modifications.   

References DECL_CHAIN, lang_hooks::dup_lang_specific_decl, ggc_alloc(), NULL, remap_decl(), and TREE_CODE.

Referenced by tree_function_versioning().

◆ copy_bb()

static basic_block copy_bb ( copy_body_data * id,
basic_block bb,
profile_count num,
profile_count den )
Copy basic block, scale profile accordingly.  Edges will be taken care of

References symtab_node::address_taken, profile_count::adjust_for_ipa_scaling(), profile_count::apply_scale(), basic_block_def::aux, build_int_cst(), cgraph_edge::call_stmt, CB_CGE_DUPLICATE, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, cfun, cgraph_edge::clone(), basic_block_def::count, cgraph_edge::count, count, create_basic_block(), create_tmp_reg_or_ssa_name(), DECL_ARGUMENTS, DECL_CHAIN, symtab_node::definition, dump_file, symtab_node::dump_name(), fndecl_built_in_p(), gcc_assert, gcc_checking_assert, gcc_unreachable, cgraph_node::get_create(), ggc_alloc(), gimple_build_assign(), gimple_build_call_vec(), gimple_call_arg_ptr(), gimple_call_copy_flags(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_set_fntype(), gimple_call_set_lhs(), gimple_call_set_va_arg_pack(), gimple_call_va_arg_pack_p(), gimple_duplicate_stmt_histograms(), gimple_location(), gimple_nop_p(), gimple_regimplify_operands(), gimple_seq_empty_p(), gimple_set_location(), gimple_uid(), walk_stmt_info::gsi, gsi_end_p(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_remove(), gsi_replace(), gsi_start(), gsi_start_bb(), gsi_stmt(), integer_type_node, maybe_duplicate_eh_stmt_fn(), notice_special_calls(), NULL, cgraph_edge::num_speculative_call_targets_p(), basic_block_def::prev_bb, profile_count::probability_in(), remap_gimple_stmt(), cgraph_edge::set_call_stmt(), walk_stmt_info::stmt, and profile_count::zero().

Referenced by copy_cfg_body().

◆ copy_bind_expr()

static void copy_bind_expr ( tree * tp,
int * walk_subtrees,
copy_body_data * id )

◆ copy_body()

static tree copy_body ( copy_body_data * id,
basic_block entry_block_map,
basic_block exit_block_map,
basic_block new_entry )
Make a copy of the body of FN so that it can be inserted inline in
another function.   

References copy_cfg_body(), copy_debug_stmts(), DECL_STRUCT_FUNCTION, ENTRY_BLOCK_PTR_FOR_FN, gcc_assert, ggc_alloc(), ipa_release_ssas_in_hash(), and NULL.

Referenced by expand_call_inline(), and tree_function_versioning().

◆ copy_cfg_body()

◆ copy_debug_stmt()

◆ copy_debug_stmts()

static void copy_debug_stmts ( copy_body_data * id)
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

References copy_debug_stmt(), and walk_stmt_info::stmt.

Referenced by copy_body().

◆ copy_decl_for_dup_finish()

tree copy_decl_for_dup_finish ( copy_body_data * id,
tree decl,
tree copy )
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.   


Referenced by assumption_copy_decl(), copy_decl_no_change(), copy_decl_to_var(), copy_result_decl_to_var(), and create_asan_shadow_var().

◆ copy_decl_maybe_to_var()

static tree copy_decl_maybe_to_var ( tree decl,
copy_body_data * id )

◆ copy_decl_no_change()

◆ copy_decl_to_var()

tree copy_decl_to_var ( tree decl,
copy_body_data * id )
Create a new VAR_DECL that is indentical in all respect to DECL except that
DECL can be either a VAR_DECL, a PARM_DECL or RESULT_DECL.  The original
DECL must come from ID->src_fn and the copy will be part of ID->dst_fn.   


Referenced by ipa_param_body_adjustments::common_initialization(), copy_decl_maybe_to_var(), and setup_one_parameter().

◆ copy_edges_for_bb()

◆ copy_fn()

tree copy_fn ( tree fn,
tree & parms,
tree & result )
Unshare the entire DECL_SAVED_TREE of FN and return the remapped
parameters and RESULT_DECL in PARMS and RESULT.  Used by C++ constexpr

References CB_CGE_DUPLICATE, copy_decl_no_change(), copy_tree_body(), current_function_decl, DECL_ARGUMENTS, DECL_CHAIN, copy_body_data::decl_map, DECL_RESULT, DECL_STRUCT_FUNCTION, ggc_alloc(), NULL_TREE, remap_decl(), and TREE_CODE.

Referenced by expand_assign_tm(), gimple_build_omp_task(), and gimple_omp_task_set_copy_fn().

◆ copy_forbidden()

const char * copy_forbidden ( struct function * fun)
Determine if the function can be copied.  If so return NULL.  If
not return a string describng the reason for failure.   

References function::cannot_be_copied_reason, function::cannot_be_copied_set, G_, ggc_alloc(), function::has_forced_label_in_static, and function::has_nonlocal_label.

Referenced by expand_target_clones(), inline_forbidden_p(), and tree_versionable_function_p().

◆ copy_gimple_bind()

static gimple * copy_gimple_bind ( gbind * stmt,
copy_body_data * id )
Copy a GIMPLE_BIND statement STMT, remapping all the symbols in its
block using the mapping information in ID.   

References ggc_alloc(), gimple_bind_block(), gimple_bind_body(), gimple_bind_vars(), gimple_build_bind(), NULL, remap_block(), remap_decls(), and remap_gimple_seq().

Referenced by remap_gimple_stmt().

◆ copy_gimple_seq_and_replace_locals()

◆ copy_loops()

static void copy_loops ( copy_body_data * id,
class loop * dest_parent,
class loop * src_parent )
Make a copy of the sub-loops of SRC_PARENT and place them
as siblings of DEST_PARENT.   

References alloc_loop(), bitmap_bit_p, cfun, copy_loop_info(), copy_loops(), flow_loop_tree_node_add(), ggc_alloc(), NULL, place_new_loop(), remap_decl(), and remap_dependence_clique().

Referenced by copy_cfg_body(), and copy_loops().

◆ copy_phis_for_bb()

static void copy_phis_for_bb ( basic_block bb,
copy_body_data * id )
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(), EDGE_COUNT, find_edge(), FOR_EACH_EDGE, force_gimple_operand(), gcc_assert, ggc_alloc(), gimple_build_nop(), gimple_phi_arg_location_from_edge(), gsi_commit_one_edge_insert(), gsi_end_p(), gsi_insert_seq_on_edge(), gsi_next(), gsi_start_phis(), input_location, inserted, is_gimple_val(), NULL, PHI_ARG_DEF_FROM_EDGE, PHI_RESULT, basic_block_def::preds, remap_location(), si, SSA_NAME_DEF_STMT, TREE_CODE, virtual_operand_p(), and walk_tree.

Referenced by copy_cfg_body().

◆ copy_result_decl_to_var()

static tree copy_result_decl_to_var ( tree decl,
copy_body_data * id )

◆ copy_statement_list()

◆ copy_static_chain()

static tree copy_static_chain ( tree static_chain,
copy_body_data * id )
Return a copy of the function's static chain.   

References DECL_CHAIN, lang_hooks::dup_lang_specific_decl, ggc_alloc(), and remap_decl().

Referenced by tree_function_versioning().

◆ copy_tree_body()

static tree copy_tree_body ( copy_body_data * id)
Make a copy of the body of SRC_FN so that it can be inserted inline in
another function.   

References copy_tree_body_r(), DECL_SAVED_TREE, NULL, and walk_tree.

Referenced by copy_fn(), and maybe_inline_call_in_expr().

◆ copy_tree_body_r()

◆ copy_tree_r()

◆ debug_find_tree()

DEBUG_FUNCTION bool debug_find_tree ( tree top,
tree search )

◆ debug_find_tree_1()

static tree debug_find_tree_1 ( tree * tp,
int * walk_subtrees,
void * data )
Allow someone to determine if SEARCH is a child of TOP from gdb.   

References NULL.

Referenced by debug_find_tree().

◆ declare_inline_vars()

static void declare_inline_vars ( tree block,
tree vars )
Declare the variables created by the inliner.  Add all the variables in

References add_local_decl(), BLOCK_VARS, cfun, chainon(), DECL_CHAIN, DECL_SEEN_IN_BIND_EXPR_P, gcc_assert, TREE_ASM_WRITTEN, and TREE_STATIC.

Referenced by declare_return_variable(), initialize_inlined_parameters(), and tree_function_versioning().

◆ declare_return_variable()

static tree declare_return_variable ( copy_body_data * id,
tree return_slot,
tree modify_dest,
basic_block entry_bb )
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 build1(), build_fold_addr_expr, build_int_cst(), copy_result_decl_to_var(), create_tmp_var, DECL_BY_REFERENCE, DECL_NOT_GIMPLE_REG_P, DECL_P, DECL_RESULT, DECL_SEEN_IN_BIND_EXPR_P, declare_inline_vars(), fold_build2, fold_convert, fold_convertible_p(), gcc_assert, get_base_address(), ggc_alloc(), gimple_build_assign(), 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(), mark_addressable(), NULL, NULL_TREE, poly_int_tree_p(), ptr_type_node, ssa_default_def(), STRIP_USELESS_TYPE_CONVERSION, suppress_warning(), TREE_ADDRESSABLE, TREE_CODE, TREE_TYPE, TYPE_SIZE_UNIT, useless_type_conversion_p(), and VOID_TYPE_P.

Referenced by expand_call_inline().

◆ duplicate_remap_omp_clause_seq()

static gimple_seq duplicate_remap_omp_clause_seq ( gimple_seq seq,
struct walk_stmt_info * wi )
Create a copy of SEQ and remap all decls in it.   

References gimple_seq_copy(), mark_local_labels_stmt(), NULL, replace_locals_op(), replace_locals_stmt(), and walk_gimple_seq().

Referenced by replace_locals_op().

◆ estimate_move_cost()

int estimate_move_cost ( tree type,
bool ARG_UNUSEDspeed_p )
Estimate the cost of a memory move of type TYPE.  Use machine dependent
word size and take possible memcpy call into account and return
cost based on whether optimizing for size or speed according to SPEED_P.   

References estimated_poly_value(), gcc_assert, GET_MODE_SIZE(), ggc_alloc(), int_size_in_bytes(), MOVE_MAX_PIECES, SCALAR_TYPE_MODE, targetm, TREE_TYPE, TYPE_MODE, VECTOR_TYPE_P, and VOID_TYPE_P.

Referenced by consider_split(), estimate_local_effects(), estimate_num_insns(), gather_context_independent_values(), and ipa_populate_param_decls().

◆ estimate_num_insns()

int estimate_num_insns ( gimple * stmt,
eni_weights * weights )
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, count, dconst2, DECL_FUNCTION_CODE(), symtab_node::definition, estimate_move_cost(), estimate_num_insns_seq(), estimate_operator_cost(), floor_log2(), fndecl_built_in_p(), gcc_unreachable, cgraph_node::get(), get_gimple_rhs_class(), ggc_alloc(), gimple_asm_inline_p(), 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_builtin_p(), gimple_call_fndecl(), gimple_call_internal_p(), 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(), i, is_inexpensive_builtin(), is_simple_builtin(), MAX, MIN, NULL, real_equal(), walk_stmt_info::stmt, TREE_CODE, TREE_REAL_CST, and TREE_TYPE.

Referenced by analyze_bb(), analyze_function_body(), back_threader_profitability::back_threader_profitability(), compute_added_num_insns(), early_inliner(), estimate_num_insns_fn(), estimate_num_insns_seq(), execute_split_functions(), gimple_account_profile_record(), init_loop_unswitch_info(), ipa_profile_generate_summary(), back_threader_profitability::possibly_profitable_path_p(), record_temporary_equivalences(), reorder_operands(), should_duplicate_loop_header_p(), tree_estimate_loop_size(), tree_num_loop_insns(), and value_replacement().

◆ estimate_num_insns_fn()

int estimate_num_insns_fn ( tree fndecl,
eni_weights * weights )
Estimate number of instructions that will be created by expanding
function FNDECL.  WEIGHTS contains weights attributed to various

References DECL_STRUCT_FUNCTION, estimate_num_insns(), FOR_EACH_BB_FN, gcc_assert, ggc_alloc(), gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().

◆ estimate_num_insns_seq()

int estimate_num_insns_seq ( gimple_seq stmts,
eni_weights * weights )
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(), ggc_alloc(), walk_stmt_info::gsi, gsi_end_p(), gsi_next(), gsi_start(), and gsi_stmt().

Referenced by compute_added_num_insns(), decide_copy_try_finally(), estimate_num_insns(), and value_replacement().

◆ estimate_operator_cost()

static int estimate_operator_cost ( enum tree_code code,
eni_weights * weights,
tree op1,
tree op2 )
Returns cost of operation CODE, according to WEIGHTS   

References CASE_CONVERT, gcc_assert, get_gimple_rhs_class(), ggc_alloc(), GIMPLE_SINGLE_RHS, and TREE_CODE.

Referenced by estimate_num_insns().

◆ expand_call_inline()

static bool expand_call_inline ( basic_block bb,
gimple * stmt,
copy_body_data * id,
bitmap to_purge )
If STMT is a GIMPLE_CALL, replace it with its inline expansion.   

References _, add_local_variables(), bitmap_set_bit, BLOCK_ABSTRACT_ORIGIN, BLOCK_CHAIN, BLOCK_SOURCE_LOCATION, BLOCK_SUBBLOCKS, BLOCK_VARS, build1(), build_clobber(), build_pointer_type(), BUILTINS_LOCATION, cgraph_edge::call_stmt, cfun, cgraph_inline_failed_string(), cgraph_inline_failed_type(), CIF_FINAL_ERROR, CLOBBER_STORAGE_END, CONVERT_EXPR_CODE_P, copy_body(), count, create_tmp_reg_fn(), debug_hooks, DECL_ABSTRACT_ORIGIN, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_CHAIN, DECL_DECLARED_INLINE_P, DECL_FUNCTION_PERSONALITY, DECL_IGNORED_P, DECL_IN_SYSTEM_HEADER, DECL_INITIAL, DECL_IS_OPERATOR_NEW_P, DECL_NO_INLINE_WARNING_P, DECL_ORIGIN, DECL_P, DECL_SOURCE_LOCATION, DECL_STRUCT_FUNCTION, declare_return_variable(), dump_enabled_p(), dump_file, dump_flags, dump_printf_loc(), error(), expand_call_inline(), thunk_info::fixed_offset, g, gcc_assert, gcc_checking_assert, thunk_info::get(), ggc_alloc(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_assign_single_p(), gimple_block(), gimple_build_assign(), gimple_build_call_internal_vec(), gimple_build_debug_inline_entry(), gimple_build_nop(), gimple_build_predict(), gimple_call_arg(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_return_slot_opt_p(), gimple_call_set_arg(), gimple_call_set_fndecl(), gimple_call_set_lhs(), gimple_has_body_p(), gimple_location(), gimple_set_location(), gimple_uid(), gimple_vdef(), symbol_table::global_info_ready, gsi_end_p(), gsi_for_stmt(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_prev(), gsi_remove(), gsi_replace(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), i, thunk_info::indirect_offset, inform(), initialize_inlined_parameters(), inlined_function_outer_scope_p(), input_location, is_gimple_assign(), is_gimple_call(), is_gimple_reg(), last_basic_block_for_fn, LOCATION_LOCUS, lookup_attribute(), lookup_stmt_eh_lp(), basic_block_def::loop_father, make_node(), maybe_clean_or_replace_eh_stmt(), maybe_remove_unused_call_args(), MSG_NOTE, MSG_PRIORITY_INTERNALS, NOT_TAKEN, NULL, NULL_TREE, profile_count::one(), opt_for_fn, gcc_debug_hooks::outlining_inline_function, prepend_lexical_block(), PROFILE_ABSENT, profile_status_for_fn, PROP_gimple_lomp_dev, PROP_gimple_lva, pt_solution_reset(), release_ssa_name(), remap_blocks(), remap_blocks_to_null(), cgraph_edge::remove(), remove_edge(), reset_debug_bindings(), set_ssa_default_def(), SET_SSA_NAME_VAR_OR_IDENTIFIER, si, loop::simduid, single_imm_use(), size_int, split_block(), SR_NONE, ssa_default_def(), SSA_NAME_DEF_STMT, SSA_NAME_VAR, stmt_ends_bb_p(), suppress_warning(), symtab, TDF_DETAILS, thunk_info::this_adjusting, thunk_adjust(), to_purge, TREE_CHAIN, TREE_CODE, TREE_THIS_VOLATILE, TREE_TYPE, TREE_USED, UNKNOWN_LOCATION, unlink_stmt_vdef(), update_stmt(), VAR_P, vec_alloc(), vec_free(), thunk_info::virtual_offset_p, thunk_info::virtual_value, and warning().

Referenced by expand_call_inline(), and gimple_expand_calls_inline().

◆ fold_marked_statements()

◆ force_value_to_type()

tree force_value_to_type ( tree type,
tree value )
Deal with mismatched formal/actual parameters, in a rather brute-force way
if need be (which should only be necessary for invalid programs).  Attempt
to convert VAL to TYPE and return the result if it is possible, just return
a zero constant of the given type if it fails.   

References build_zero_cst(), error_mark_node, fold_build1, fold_convert, fold_convertible_p(), ggc_alloc(), is_gimple_reg_type(), TREE_CODE, TREE_TYPE, and TYPE_SIZE.

Referenced by initialize_inlined_parameters(), ipa_param_adjustments::modify_call(), and setup_one_parameter().

◆ function_attribute_inlinable_p()

static bool function_attribute_inlinable_p ( const_tree fndecl)
Return false if the function FNDECL cannot be inlined on account of its
attributes, true otherwise.   

References a, scoped_attributes::attributes, DECL_ATTRIBUTES, get_attribute_name(), ggc_alloc(), is_attribute_p(), targetm, and TREE_CHAIN.

Referenced by tree_inlinable_function_p().

◆ gimple_expand_calls_inline()

static bool gimple_expand_calls_inline ( basic_block bb,
copy_body_data * id,
bitmap to_purge )
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(), ggc_alloc(), gimple_call_internal_p(), gsi_end_p(), gsi_last_bb(), gsi_prev(), gsi_stmt(), is_gimple_call(), and to_purge.

Referenced by optimize_inline_calls().

◆ init_inline_once()

◆ initialize_cfun()

◆ initialize_inlined_parameters()

◆ inline_forbidden_p()

static bool inline_forbidden_p ( tree fndecl)

◆ inline_forbidden_p_stmt()

static tree inline_forbidden_p_stmt ( gimple_stmt_iterator * gsi,
bool * handled_ops_p,
struct walk_stmt_info * wip )

◆ insert_decl_map()

◆ insert_init_debug_bind()

static gimple * insert_init_debug_bind ( copy_body_data * id,
basic_block bb,
tree var,
tree value,
gimple * base_stmt )
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 error_mark_node, ggc_alloc(), gimple_build_debug_bind(), 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(), NULL, NULL_TREE, opt_for_fn, target_for_debug_bind(), and unshare_expr().

Referenced by insert_init_stmt(), and setup_one_parameter().

◆ insert_init_stmt()

◆ is_parm()

static bool is_parm ( tree decl)
Return true if DECL is a parameter or a SSA_NAME for a parameter.   

References ggc_alloc(), SSA_NAME_VAR, and TREE_CODE.

Referenced by copy_tree_body_r(), and remap_gimple_op_r().

◆ mark_local_labels_stmt()

static tree mark_local_labels_stmt ( gimple_stmt_iterator * gsip,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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 ggc_alloc(), gimple_label_label(), gsi_stmt(), insert_decl_map(), and NULL_TREE.

Referenced by copy_gimple_seq_and_replace_locals(), and duplicate_remap_omp_clause_seq().

◆ maybe_inline_call_in_expr()

tree maybe_inline_call_in_expr ( tree exp)

◆ maybe_move_debug_stmts_to_successors()

◆ optimize_inline_calls()

◆ prepend_lexical_block()

static void prepend_lexical_block ( tree current_block,
tree new_block )
Install new lexical TREE_BLOCK underneath 'current_block'.   


Referenced by expand_call_inline(), and remap_blocks().

◆ redirect_all_calls()

◆ remap_block()

static void remap_block ( tree * block,
copy_body_data * id )
Copy the BLOCK to contain remapped versions of the variables
therein.  And hook the new block into the block-tree.   

References BLOCK_ABSTRACT_ORIGIN, BLOCK_NONLOCALIZED_VARS, BLOCK_ORIGIN, BLOCK_SOURCE_LOCATION, BLOCK_VARS, ggc_alloc(), insert_decl_map(), make_node(), remap_decls(), TREE_USED, and vec_safe_copy().

Referenced by copy_bind_expr(), copy_gimple_bind(), copy_tree_body_r(), remap_blocks(), and replace_locals_stmt().

◆ remap_blocks()

static tree remap_blocks ( tree block,
copy_body_data * id )

◆ remap_blocks_to_null()

static void remap_blocks_to_null ( tree block,
copy_body_data * id )
Remap the block tree rooted at BLOCK to nothing.   

References BLOCK_CHAIN, BLOCK_SUBBLOCKS, insert_decl_map(), NULL_TREE, and remap_blocks_to_null().

Referenced by expand_call_inline(), and remap_blocks_to_null().

◆ remap_decl()

◆ remap_decl_1()

static tree remap_decl_1 ( tree decl,
void * data )
Wrapper for remap_decl so it can be used as a callback.   

References remap_decl().

Referenced by copy_cfg_body().

◆ remap_decls()

◆ remap_dependence_clique()

static unsigned short remap_dependence_clique ( copy_body_data * id,
unsigned short clique )
Remap the dependence CLIQUE from the source to the destination function
as specified in ID.   

References cfun, get_new_clique(), ggc_alloc(), and processing_debug_stmt.

Referenced by copy_loops(), copy_tree_body_r(), and remap_gimple_op_r().

◆ remap_eh_region_nr()

static int remap_eh_region_nr ( int old_nr,
copy_body_data * id )
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 get_eh_region_from_number_fn(), and ggc_alloc().

Referenced by remap_eh_region_tree_nr(), and remap_gimple_stmt().

◆ remap_eh_region_tree_nr()

static tree remap_eh_region_tree_nr ( tree old_t_nr,
copy_body_data * id )
Similar, but operate on INTEGER_CSTs.   

References build_int_cst(), ggc_alloc(), integer_type_node, remap_eh_region_nr(), and tree_to_shwi().

Referenced by remap_gimple_stmt().

◆ remap_gimple_op_r()

◆ remap_gimple_seq()

static gimple_seq remap_gimple_seq ( gimple_seq body,
copy_body_data * id )
Create a new gimple_seq by remapping all the statements in BODY
using the inlining information in ID.   

References ggc_alloc(), gimple_seq_add_seq(), gsi_end_p(), gsi_next(), gsi_start(), gsi_stmt(), NULL, remap_gimple_stmt(), and si.

Referenced by copy_gimple_bind(), and remap_gimple_stmt().

◆ remap_gimple_stmt()

static gimple_seq remap_gimple_stmt ( gimple * stmt,
copy_body_data * id )
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, boolean_false_node, boolean_type_node, BUILT_IN_NORMAL, cfun, copy_gimple_bind(), DECL_FUNCTION_CODE(), DECL_P, DECL_STRUCT_FUNCTION, fndecl_built_in_p(), gcc_assert, gcc_checking_assert, gcc_unreachable, ggc_alloc(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_assume_body(), gimple_assume_guard(), gimple_bb(), gimple_block(), gimple_build_assign(), gimple_build_assume(), gimple_build_catch(), gimple_build_debug_bind(), gimple_build_debug_source_bind(), gimple_build_eh_filter(), gimple_build_omp_critical(), gimple_build_omp_for(), gimple_build_omp_masked(), gimple_build_omp_master(), gimple_build_omp_ordered(), gimple_build_omp_parallel(), gimple_build_omp_scan(), gimple_build_omp_scope(), gimple_build_omp_section(), gimple_build_omp_sections(), gimple_build_omp_single(), gimple_build_omp_structured_block(), gimple_build_omp_target(), gimple_build_omp_task(), gimple_build_omp_taskgroup(), gimple_build_omp_teams(), gimple_build_transaction(), gimple_build_try(), gimple_build_wce(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_from_thunk_p(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_reset_alias_info(), gimple_call_set_arg(), gimple_call_set_from_thunk(), gimple_call_set_tail(), gimple_call_tail_p(), gimple_catch_handler(), gimple_catch_types(), gimple_clobber_p(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_set_code(), gimple_cond_set_lhs(), gimple_cond_set_rhs(), gimple_copy(), gimple_could_trap_p(), gimple_debug_bind_get_value(), gimple_debug_bind_get_var(), gimple_debug_bind_p(), gimple_debug_nonbind_marker_p(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), 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_clauses(), 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_masked_clauses(), gimple_omp_ordered_clauses(), gimple_omp_parallel_child_fn(), gimple_omp_parallel_clauses(), gimple_omp_parallel_data_arg(), gimple_omp_scan_clauses(), gimple_omp_scope_clauses(), gimple_omp_sections_clauses(), gimple_omp_single_clauses(), gimple_omp_target_clauses(), gimple_omp_target_kind(), 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_omp_taskgroup_clauses(), gimple_omp_teams_clauses(), gimple_op_ptr(), gimple_resx_region(), gimple_resx_set_region(), gimple_return_retval(), gimple_seq_add_seq_without_update(), gimple_seq_add_stmt_without_update(), gimple_seq_empty_p(), gimple_set_block(), gimple_set_location(), gimple_set_vdef(), gimple_set_vuse(), gimple_transaction_body(), gimple_transaction_label_norm(), gimple_transaction_label_over(), gimple_transaction_label_uninst(), gimple_transaction_set_label_norm(), gimple_transaction_set_label_over(), gimple_transaction_set_label_uninst(), gimple_transaction_set_subcode(), gimple_transaction_subcode(), gimple_try_cleanup(), gimple_try_eval(), gimple_try_kind(), gimple_wce_cleanup(), gsi_end_p(), gsi_next(), gsi_start(), gsi_stmt(), i, input_location, is_gimple_assign(), is_gimple_debug(), make_ssa_name(), NULL, NULL_TREE, opt_for_fn, r, remap_decl(), remap_eh_region_nr(), remap_eh_region_tree_nr(), remap_gimple_op_r(), remap_gimple_seq(), SSA_NAME_DEF_STMT, SSA_NAME_VAR, walk_stmt_info::stmt, STRIP_TYPE_NOPS, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_READONLY, unshare_expr(), unshare_expr_without_location(), walk_gimple_op(), and walk_tree.

Referenced by copy_bb(), and remap_gimple_seq().

◆ remap_location()

static location_t remap_location ( location_t locus,
copy_body_data * id )
Remap the location info pointed to by LOCUS.   

References gcc_assert, LOCATION_BLOCK, LOCATION_LOCUS, set_block(), and UNKNOWN_LOCATION.

Referenced by copy_edges_for_bb(), and copy_phis_for_bb().

◆ remap_save_expr()

static void remap_save_expr ( tree * tp,
hash_map< tree, tree > * st,
int * walk_subtrees )
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(), and ggc_alloc().

Referenced by copy_tree_body_r().

◆ remap_ssa_name()

◆ remap_type()

◆ remap_type_1()

◆ remap_type_2()

static bool remap_type_2 ( tree type,
copy_body_data * id )
Return true if TYPE needs to be remapped because remap_decl on any
needed embedded decl returns something other than that decl.   


Referenced by remap_type(), and remap_type_2().

◆ remap_type_3()

static tree remap_type_3 ( tree * tp,
int * walk_subtrees,
void * data )
Helper function for remap_type_2, called through walk_tree.   

References DECL_P, ggc_alloc(), NULL_TREE, remap_decl(), and TYPE_P.

◆ replace_locals_op()

static tree replace_locals_op ( tree * tp,
int * walk_subtrees,
void * data )
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


Referenced by copy_gimple_seq_and_replace_locals(), and duplicate_remap_omp_clause_seq().

◆ replace_locals_stmt()

static tree replace_locals_stmt ( gimple_stmt_iterator * gsip,
bool * handled_ops_p,
struct walk_stmt_info * wi )
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

References can_be_nonlocal(), DECL_CHAIN, decls, gcc_checking_assert, ggc_alloc(), gimple_bind_block(), gimple_bind_set_block(), gimple_bind_set_vars(), gimple_bind_vars(), gsi_stmt(), NULL, NULL_TREE, remap_block(), remap_decl(), remap_decls(), walk_stmt_info::stmt, TREE_TYPE, and variably_modified_type_p().

Referenced by copy_gimple_seq_and_replace_locals(), and duplicate_remap_omp_clause_seq().

◆ reset_debug_binding()

static void reset_debug_binding ( copy_body_data * id,
tree srcvar,
gimple_seq * bindings )
Add to BINDINGS a debug stmt resetting SRCVAR if inlining might
have brought in or introduced any debug stmts for SRCVAR.   

References ggc_alloc(), gimple_build_debug_bind(), gimple_seq_add_stmt(), NULL_TREE, target_for_debug_bind(), and VAR_P.

Referenced by reset_debug_bindings().

◆ reset_debug_bindings()

static void reset_debug_bindings ( copy_body_data * id,
gimple_stmt_iterator gsi )
For each inlined variable for which we may have debug bind stmts,
add before GSI a final debug stmt resetting it, marking the end of
its life, so that var-tracking knows it doesn't have to compute
further locations for it.   

References DECL_ARGUMENTS, DECL_CHAIN, FOR_EACH_LOCAL_DECL, ggc_alloc(), gimple_in_ssa_p(), gsi_insert_seq_before_without_update(), GSI_SAME_STMT, NULL, opt_for_fn, and reset_debug_binding().

Referenced by expand_call_inline().

◆ self_inlining_addr_expr()

static bool self_inlining_addr_expr ( tree value,
tree fn )
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(), get_base_address(), ggc_alloc(), TREE_CODE, and TREE_OPERAND.

Referenced by setup_one_parameter().

◆ setup_one_parameter()

◆ tree_function_versioning()

void tree_function_versioning ( tree old_decl,
tree new_decl,
vec< ipa_replace_map *, va_gc > * tree_map,
ipa_param_adjustments * param_adjustments,
bool update_clones,
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 PARAM_ADJUSTMENTS determines how function prototype (i.e. the
  function parameters and return value) should be modified).
  If non-NULL BLOCKS_TO_COPY determine what basic blocks to copy.
  If non_NULL NEW_ENTRY determine new entry BB of the clone.

References add_local_variables(), ipa_param_body_adjustments::append_init_stmts(), AVOID_CFG_MODIFICATIONS, BLOCK_SUPERCONTEXT, build_debug_expr_decl(), build_decl(), build_fold_addr_expr, calculate_dominance_info(), cgraph_edge::call_stmt, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, copy_arguments_nochange(), copy_body(), copy_decl_no_change(), copy_result_decl_to_var(), copy_static_chain(), basic_block_def::count, cgraph_edge::count, debug_hooks, DECL_ABSTRACT_ORIGIN, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_BY_REFERENCE, DECL_CHAIN, DECL_CONTEXT, decl_debug_args_insert(), decl_debug_args_lookup(), DECL_FUNCTION_PERSONALITY, DECL_HAS_DEBUG_ARGS_P, DECL_INITIAL, DECL_IS_MALLOC, DECL_MODE, DECL_ORIGIN, DECL_POSSIBLY_INLINED, DECL_RESULT, DECL_SOURCE_LOCATION, DECL_STRUCT_FUNCTION, declare_inline_vars(), delete_unreachable_blocks_update_callgraph(), lang_hooks::dup_lang_specific_decl, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, fix_loop_structure(), fold_marked_statements(), free_dominance_info(), gcc_assert, gcc_checking_assert, clone_info::get(), hash_map< KeyId, Value, Traits >::get(), cgraph_node::get(), ipa_param_body_adjustments::get_new_param_chain(), ggc_alloc(), gimple_bb(), gimple_build_debug_bind(), gimple_build_debug_source_bind(), gimple_build_nop(), gimple_in_ssa_p(), gsi_after_labels(), gsi_insert_before(), GSI_NEW_STMT, i, initialize_cfun(), input_location, insert_decl_map(), insert_init_stmt(), is_gimple_reg(), loop_optimizer_init(), loops_for_fn(), LOOPS_NEED_FIXUP, loops_state_satisfies_p(), ipa_param_body_adjustments::m_dead_ssa_debug_equiv, ipa_param_body_adjustments::m_reset_debug_decls, ipa_param_adjustments::m_skip_return, make_ssa_name(), MAY_HAVE_DEBUG_BIND_STMTS, cgraph_edge::next_callee, NULL, NULL_TREE, number_blocks(), gcc_debug_hooks::outlining_inline_function, clone_info::param_adjustments, pop_cfun(), PROP_loops, rebuild_frequencies(), cgraph_edge::rebuild_references(), remap_blocks(), remap_decl(), remap_gimple_op_r(), SET_DECL_MODE, set_ssa_default_def(), setup_one_parameter(), single_succ(), single_succ_edge(), split_edge(), ssa_default_def(), SSA_NAME_DEF_STMT, TODO_update_ssa, TREE_CHAIN, TREE_CODE, TREE_TYPE, UNKNOWN_LOCATION, update_clone_info(), update_max_bb_count(), update_ssa(), vec_safe_copy(), vec_safe_is_empty(), vec_safe_length(), vec_safe_push(), void_type_node, VOID_TYPE_P, and walk_tree.

Referenced by cgraph_node::create_version_clone_with_body(), ipa_tm_create_version(), cgraph_node::materialize_clone(), and save_inline_function_body().

◆ tree_inlinable_function_p()

bool tree_inlinable_function_p ( tree fn)

◆ tree_versionable_function_p()

bool tree_versionable_function_p ( tree fndecl)
Return true if the function is allowed to be versioned.
This is a guard for the versioning functionality.   

References copy_forbidden(), DECL_ATTRIBUTES, DECL_STRUCT_FUNCTION, lookup_attribute(), and NULL.

Referenced by can_strub_internally_p(), cgraph_node::create_version_clone_with_body(), execute_split_functions(), expand_target_clones(), ipa_fn_summary_generate(), and ipa_tm_execute().

◆ update_clone_info()

static void update_clone_info ( copy_body_data * id)

◆ update_ssa_across_abnormal_edges()

static void update_ssa_across_abnormal_edges ( basic_block bb,
basic_block ret_bb,
bool can_throw,
bool nonlocal_goto )
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 ENTRY_BLOCK, find_edge(), FOR_EACH_EDGE, gcc_assert, gcc_checking_assert, ggc_alloc(), gsi_end_p(), gsi_next(), gsi_start_phis(), PHI_ARG_DEF_PTR_FROM_EDGE, PHI_RESULT, SET_USE, si, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, basic_block_def::succs, and USE_FROM_PTR.

Referenced by copy_edges_for_bb().

Variable Documentation

◆ eni_size_weights

eni_weights eni_size_weights
Tree inlining.
   Copyright (C) 2001-2024 Free Software Foundation, Inc.
   Contributed by Alexandre Oliva <aoliva@redhat.com>

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
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
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
Weights that estimate_num_insns uses to estimate the size of the
produced code.   

Referenced by analyze_bb(), analyze_function_body(), back_threader_profitability::back_threader_profitability(), can_unroll_loop_p(), compute_added_num_insns(), compute_fn_summary(), consider_split(), decide_copy_try_finally(), ipa_call_summary_t::duplicate(), early_inliner(), estimate_edge_devirt_benefit(), execute_split_functions(), gimple_account_profile_record(), init_inline_once(), init_loop_unswitch_info(), ipa_make_edge_direct_to_target(), ipa_profile_generate_summary(), loop_prefetch_arrays(), back_threader_profitability::possibly_profitable_path_p(), record_temporary_equivalences(), reorder_operands(), should_duplicate_loop_header_p(), and tree_estimate_loop_size().

◆ eni_time_weights

◆ inline_forbidden_reason

const char* inline_forbidden_reason

◆ processing_debug_stmt

int processing_debug_stmt = 0
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

Referenced by copy_debug_stmt(), remap_decl(), remap_dependence_clique(), and remap_ssa_name().