GCC Middle and Back End API Reference
ipa-inline-analysis.c File Reference

Data Structures

struct  agg_position_info
struct  record_modified_bb_info
struct  growth_data

Typedefs

typedef struct predicate predicate_t

Enumerations

enum  predicate_conditions { predicate_false_condition = 0, predicate_not_inlined_condition = 1, predicate_first_dynamic_condition = 2 }

Functions

static void inline_node_removal_hook (struct cgraph_node *, void *)
static void inline_node_duplication_hook (struct cgraph_node *, struct cgraph_node *, void *)
static void inline_edge_removal_hook (struct cgraph_edge *, void *)
static void inline_edge_duplication_hook (struct cgraph_edge *, struct cgraph_edge *, void *)
static struct predicate true_predicate ()
static struct predicate single_cond_predicate ()
static struct predicate false_predicate ()
static bool true_predicate_p ()
static bool false_predicate_p ()
static struct predicate not_inlined_predicate ()
static struct predicate add_condition (struct inline_summary *summary, int operand_num, struct agg_position_info *aggpos, enum tree_code code, tree val)
static void add_clause ()
static struct predicate and_predicates (conditions conditions, struct predicate *p, struct predicate *p2)
static bool predicates_equal_p ()
static struct predicate or_predicates (conditions conditions, struct predicate *p, struct predicate *p2)
static bool evaluate_predicate ()
static int predicate_probability (conditions conds, struct predicate *p, clause_t possible_truths, vec< inline_param_summary_t > inline_param_summary)
static void dump_condition ()
static void dump_clause ()
static void dump_predicate ()
void dump_inline_hints ()
static void account_size_time (struct inline_summary *summary, int size, int time, struct predicate *pred)
static void edge_set_predicate ()
static void set_hint_predicate ()
static clause_t evaluate_conditions_for_known_args (struct cgraph_node *node, bool inline_p, vec< tree > known_vals, vec< ipa_agg_jump_function_p > known_aggs)
static void evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, clause_t *clause_ptr, vec< tree > *known_vals_ptr, vec< tree > *known_binfos_ptr, vec< ipa_agg_jump_function_p > *known_aggs_ptr)
static void inline_summary_alloc ()
static void reset_inline_edge_summary ()
static void reset_inline_summary ()
static struct predicate remap_predicate_after_duplication (struct predicate *p, clause_t possible_truths, struct inline_summary *info)
static void remap_hint_predicate_after_duplication (struct predicate **p, clause_t possible_truths, struct inline_summary *info)
void initialize_growth_caches ()
void free_growth_caches ()
static void dump_inline_edge_summary (FILE *f, int indent, struct cgraph_node *node, struct inline_summary *info)
void dump_inline_summary ()
DEBUG_FUNCTION void debug_inline_summary ()
void dump_inline_summaries ()
void initialize_inline_failed ()
static bool mark_modified (ao_ref *ao, tree vdef, void *data)
static tree unmodified_parm_1 ()
static tree unmodified_parm ()
static bool unmodified_parm_or_parm_agg_item (struct ipa_node_params *info, gimple stmt, tree op, int *index_p, struct agg_position_info *aggpos)
static int eliminated_by_inlining_prob ()
static void set_cond_stmt_execution_predicate (struct ipa_node_params *info, struct inline_summary *summary, basic_block bb)
static void set_switch_stmt_execution_predicate (struct ipa_node_params *info, struct inline_summary *summary, basic_block bb)
static void compute_bb_predicates (struct cgraph_node *node, struct ipa_node_params *parms_info, struct inline_summary *summary)
static struct predicate will_be_nonconstant_expr_predicate (struct ipa_node_params *info, struct inline_summary *summary, tree expr, vec< predicate_t > nonconstant_names)
static struct predicate will_be_nonconstant_predicate (struct ipa_node_params *info, struct inline_summary *summary, gimple stmt, vec< predicate_t > nonconstant_names)
static bool record_modified ()
static int param_change_prob ()
static bool phi_result_unknown_predicate (struct ipa_node_params *info, struct inline_summary *summary, basic_block bb, struct predicate *p, vec< predicate_t > nonconstant_names)
static void predicate_for_phi_result (struct inline_summary *summary, gimple phi, struct predicate *p, vec< predicate_t > nonconstant_names)
static struct predicate array_index_predicate (struct inline_summary *info, vec< predicate_t > nonconstant_names, tree op)
static void estimate_function_body_sizes ()
void compute_inline_parameters ()
static unsigned int compute_inline_parameters_for_current ()
gimple_opt_passmake_pass_inline_parameters ()
static bool estimate_edge_devirt_benefit (struct cgraph_edge *ie, int *size, int *time, vec< tree > known_vals, vec< tree > known_binfos, vec< ipa_agg_jump_function_p > known_aggs)
static void estimate_edge_size_and_time (struct cgraph_edge *e, int *size, int *time, int prob, vec< tree > known_vals, vec< tree > known_binfos, vec< ipa_agg_jump_function_p > known_aggs, inline_hints *hints)
static void estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time, inline_hints *hints, clause_t possible_truths, vec< tree > known_vals, vec< tree > known_binfos, vec< ipa_agg_jump_function_p > known_aggs)
static void estimate_node_size_and_time (struct cgraph_node *node, clause_t possible_truths, vec< tree > known_vals, vec< tree > known_binfos, vec< ipa_agg_jump_function_p > known_aggs, int *ret_size, int *ret_time, inline_hints *ret_hints, vec< inline_param_summary_t > inline_param_summary)
void estimate_ipcp_clone_size_and_time (struct cgraph_node *node, vec< tree > known_vals, vec< tree > known_binfos, vec< ipa_agg_jump_function_p > known_aggs, int *ret_size, int *ret_time, inline_hints *hints)
static struct predicate remap_predicate (struct inline_summary *info, struct inline_summary *callee_info, struct predicate *p, vec< int > operand_map, vec< int > offset_map, clause_t possible_truths, struct predicate *toplev_predicate)
static void inline_update_callee_summaries ()
static void remap_edge_change_prob (struct cgraph_edge *inlined_edge, struct cgraph_edge *edge)
static void remap_edge_summaries (struct cgraph_edge *inlined_edge, struct cgraph_node *node, struct inline_summary *info, struct inline_summary *callee_info, vec< int > operand_map, vec< int > offset_map, clause_t possible_truths, struct predicate *toplev_predicate)
static void remap_hint_predicate (struct inline_summary *info, struct inline_summary *callee_info, struct predicate **hint, vec< int > operand_map, vec< int > offset_map, clause_t possible_truths, struct predicate *toplev_predicate)
void inline_merge_summary ()
void inline_update_overall_summary ()
int simple_edge_hints ()
int do_estimate_edge_time ()
int do_estimate_edge_size ()
inline_hints do_estimate_edge_hints ()
int estimate_time_after_inlining (struct cgraph_node *node, struct cgraph_edge *edge)
int estimate_size_after_inlining (struct cgraph_node *node, struct cgraph_edge *edge)
static bool do_estimate_growth_1 ()
int do_estimate_growth ()
static void inline_indirect_intraprocedural_analysis ()
static void inline_analyze_function ()
static void add_new_function ()
void inline_generate_summary ()
static struct predicate read_predicate ()
static void read_inline_edge_summary ()
static void inline_read_section (struct lto_file_decl_data *file_data, const char *data, size_t len)
void inline_read_summary ()
static void write_predicate ()
static void write_inline_edge_summary ()
void inline_write_summary ()
void inline_free_summary ()

Variables

static struct
cgraph_node_hook_list
function_insertion_hook_holder
static struct
cgraph_node_hook_list
node_removal_hook_holder
static struct
cgraph_2node_hook_list
node_duplication_hook_holder
static struct
cgraph_2edge_hook_list
edge_duplication_hook_holder
static struct
cgraph_edge_hook_list
edge_removal_hook_holder
vec< inline_summary_t, va_gc > * inline_summary_vec
vec< inline_edge_summary_tinline_edge_summary_vec
vec< int > node_growth_cache
vec< edge_growth_cache_entryedge_growth_cache
static alloc_pool edge_predicate_pool

Typedef Documentation

typedef struct predicate predicate_t
We keep info about constantness of SSA names.   

Enumeration Type Documentation

Enumerator:
predicate_false_condition 
predicate_not_inlined_condition 
predicate_first_dynamic_condition 

Function Documentation

static struct predicate add_condition ( struct inline_summary summary,
int  operand_num,
struct agg_position_info aggpos,
enum tree_code  code,
tree  val 
)
staticread
static void add_new_function ( )
static
Called when new function is inserted to callgraph late.   

References inline_analyze_function().

Referenced by inline_generate_summary(), and inline_read_summary().

static struct predicate and_predicates ( conditions  conditions,
struct predicate p,
struct predicate p2 
)
staticread
static struct predicate array_index_predicate ( struct inline_summary info,
vec< predicate_t nonconstant_names,
tree  op 
)
staticread
Return predicate specifying when array index in access OP becomes non-constant.   

References false_predicate(), handled_component_p(), and or_predicates().

Referenced by estimate_function_body_sizes().

static unsigned int compute_inline_parameters_for_current ( )
static
Compute parameters of functions used by inliner using
   current_function_decl.   

References cgraph_get_node(), compute_inline_parameters(), and current_function_decl.

DEBUG_FUNCTION void debug_inline_summary ( )

References dump_inline_summary().

inline_hints do_estimate_edge_hints ( )
Estimate the growth of the caller when inlining EDGE.
   Only to be called via estimate_edge_size.   

References cgraph_edge::callee, cgraph_function_or_thunk_node(), do_estimate_edge_time(), estimate_node_size_and_time(), evaluate_properties_for_edge(), cgraph_edge::inline_failed, simple_edge_hints(), cgraph_edge::uid, and vNULL.

Referenced by estimate_edge_hints().

int do_estimate_edge_size ( )
Return estimated callee growth after inlining EDGE.
   Only to be called via estimate_edge_size.   

References cgraph_edge::callee, cgraph_function_or_thunk_node(), do_estimate_edge_time(), estimate_node_size_and_time(), evaluate_properties_for_edge(), cgraph_edge::inline_failed, cgraph_edge::uid, and vNULL.

Referenced by estimate_edge_size().

int do_estimate_edge_time ( )
Estimate the time cost for the caller when inlining EDGE.
   Only to be called via estimate_edge_time, that handles the
   caching mechanism.

   When caching, also update the cache entry.  Compute both time and
   size, since we always need both metrics eventually.   

References cgraph_edge::callee, cgraph_edge_max_uid, cgraph_function_or_thunk_node(), estimate_node_size_and_time(), evaluate_properties_for_edge(), inline_edge_summary(), cgraph_edge::inline_failed, inline_edge_summary::param, simple_edge_hints(), and cgraph_edge::uid.

Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), and estimate_edge_time().

static bool do_estimate_growth_1 ( )
static
static void dump_clause ( )
static
Dump clause CLAUSE.   

References dump_condition().

Referenced by dump_predicate().

void dump_inline_summaries ( )
static void dump_predicate ( )
static
static int eliminated_by_inlining_prob ( )
static
See if statement might disappear after inlining.
   0 - means not eliminated
   1 - half of statements goes away
   2 - for sure it is eliminated.
   We are not terribly sophisticated, basically looking for simple abstraction
   penalty wrappers.   

References get_base_address(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs_class(), gimple_assign_rhs_code(), gimple_num_ops(), GIMPLE_SINGLE_RHS, is_gimple_min_invariant(), is_gimple_reg(), and unmodified_parm().

Referenced by estimate_function_body_sizes().

static void estimate_calls_size_and_time ( struct cgraph_node node,
int *  size,
int *  time,
inline_hints hints,
clause_t  possible_truths,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs 
)
static
Increase SIZE and TIME for size and time needed to handle all calls in NODE.
   POSSIBLE_TRUTHS, KNOWN_VALS and KNOWN_BINFOS describe context of the call
   site.   

References cgraph_edge::callee, cgraph_node::callees, estimate_edge_size_and_time(), evaluate_predicate(), cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, cgraph_edge::next_callee, and inline_edge_summary::predicate.

Referenced by inline_update_overall_summary().

static bool estimate_edge_devirt_benefit ( struct cgraph_edge ie,
int *  size,
int *  time,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs 
)
static
static void estimate_edge_size_and_time ( struct cgraph_edge e,
int *  size,
int *  time,
int  prob,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs,
inline_hints hints 
)
inlinestatic
static void estimate_function_body_sizes ( )
static
Compute function body size parameters for NODE.
   When EARLY is true, we compute only simple summaries without
   non-trivial predicates to drive the early inliner.   

References account_size_time(), and_predicates(), array_index_predicate(), edge_def::aux, basic_block_def::aux, bb_loop_depth(), calculate_dominance_info(), inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, CDI_DOMINATORS, function::cfg, cfun, cgraph_edge(), cgraph_node_name(), compute_bb_predicates(), compute_call_stmt_bb_frequency(), inline_summary::conds, count, symtab_node_base::decl, dump_file, dump_flags, dump_inline_summary(), dump_predicate(), edge_set_predicate(), eliminated_by_inlining_prob(), eni_size_weights, eni_time_weights, inline_summary::entry, estimate_num_insns(), loop::exits, false_predicate(), false_predicate_p(), flow_loops_dump(), free(), free_dominance_info(), get_loop_body(), get_loop_exit_edges(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_call_builtin_p(), gimple_call_lhs(), gimple_call_num_args(), gimple_get_lhs(), gimple_store_p(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), loop::header, basic_block_def::index, inline_edge_summary(), inline_summary(), ipa_node_params_vector, is_gimple_call(), is_gimple_min_invariant(), loop_containing_stmt(), inline_edge_summary::loop_depth, loop_optimizer_finalize(), loop_optimizer_init(), LOOPS_HAVE_RECORDED_EXITS, tree_niter_desc::niter, not_inlined_predicate(), loop::num_nodes, number_of_iterations_exit(), order, inline_edge_summary::param, param_change_prob(), phi_result_unknown_predicate(), pool_free(), pre_and_rev_post_order_compute(), predicate_for_phi_result(), print_gimple_stmt(), prob, scev_finalize(), scev_initialize(), inline_summary::self_size, inline_summary::self_time, set_hint_predicate(), simple_iv(), affine_iv::step, basic_block_def::succs, cgraph_node::symbol, true_predicate(), true_predicate_p(), vNULL, will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().

Referenced by compute_inline_parameters().

void estimate_ipcp_clone_size_and_time ( struct cgraph_node node,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs,
int *  ret_size,
int *  ret_time,
inline_hints hints 
)
Estimate size and time needed to execute callee of EDGE assuming that
   parameters known to be constant at caller of EDGE are propagated.
   KNOWN_VALS and KNOWN_BINFOS are vectors of assumed known constant values
   and types for parameters.   

References estimate_node_size_and_time(), evaluate_conditions_for_known_args(), and vNULL.

Referenced by estimate_local_effects().

static void estimate_node_size_and_time ( struct cgraph_node node,
clause_t  possible_truths,
vec< tree known_vals,
vec< tree known_binfos,
vec< ipa_agg_jump_function_p known_aggs,
int *  ret_size,
int *  ret_time,
inline_hints ret_hints,
vec< inline_param_summary_t inline_param_summary 
)
static
int estimate_size_after_inlining ( struct cgraph_node node,
struct cgraph_edge edge 
)
Estimate the size of NODE after inlining EDGE which should be an
   edge to either NODE or a call inlined into NODE.   

References estimate_edge_growth(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::size.

Referenced by caller_growth_limits(), and recursive_inlining().

int estimate_time_after_inlining ( struct cgraph_node node,
struct cgraph_edge edge 
)
Estimate self time of the function NODE after inlining EDGE.   

References estimate_edge_time(), false_predicate_p(), inline_edge_summary(), inline_summary(), inline_edge_summary::predicate, and inline_summary::time.

static clause_t evaluate_conditions_for_known_args ( struct cgraph_node node,
bool  inline_p,
vec< tree known_vals,
vec< ipa_agg_jump_function_p known_aggs 
)
static
KNOWN_VALS is partial mapping of parameters of NODE to constant values.
   KNOWN_AGGS is a vector of aggreggate jump functions for each parameter.
   Return clause of possible truths. When INLINE_P is true, assume that we are
   inlining.

   ERROR_MARK means compile time invariant.   

References condition::agg_contents, condition::by_ref, predicate::clause, inline_summary::conds, fold_binary_to_constant(), inline_summary(), integer_zerop(), ipa_find_agg_cst_for_param(), condition::offset, condition::operand_num, predicate_first_dynamic_condition, predicate_not_inlined_condition, condition::val, and vec_safe_iterate().

Referenced by estimate_ipcp_clone_size_and_time(), evaluate_properties_for_edge(), and inline_node_duplication_hook().

static bool evaluate_predicate ( )
static
Having partial truth assignment in POSSIBLE_TRUTHS, return false
   if predicate P is known to be false.   

References predicate::clause, predicate_false_condition, and true_predicate_p().

Referenced by estimate_calls_size_and_time(), and estimate_node_size_and_time().

void free_growth_caches ( void  )
Free growth caches.   

Referenced by inline_small_functions().

void initialize_growth_caches ( void  )
Initialize growth caches.   

References cgraph_edge_max_uid, and cgraph_max_uid.

Referenced by inline_small_functions().

void initialize_inline_failed ( )
static void inline_edge_duplication_hook ( struct cgraph_edge src,
struct cgraph_edge dst,
void *  data 
)
static
Hook that is called by cgraph.c when a node is duplicated.   

References edge_set_predicate(), inline_edge_summary(), inline_summary_alloc(), memcpy(), inline_edge_summary::param, and inline_edge_summary::predicate.

Referenced by inline_summary_alloc().

static void inline_edge_removal_hook ( struct cgraph_edge edge,
void *  data 
)
static
Keep edge cache consistent across edge removal.   

References reset_edge_growth_cache(), and reset_inline_edge_summary().

Referenced by inline_summary_alloc().

static void inline_indirect_intraprocedural_analysis ( )
static
This function performs intraprocedural analysis in NODE that is required to
   inline indirect calls.   

References dump_file, dump_flags, ipa_analyze_node(), ipa_print_node_jump_functions(), and ipa_print_node_params().

Referenced by inline_analyze_function().

static void inline_node_removal_hook ( struct cgraph_node node,
void *  data 
)
static
Hook that is called by cgraph.c when a node is removed.   

References inline_summary(), memset(), reset_inline_summary(), cgraph_node::uid, and vec_safe_length().

Referenced by inline_summary_alloc().

void inline_read_summary ( void  )
Read inline summary.  Jump functions are shared among ipa-cp
   and inliner, so when ipa-cp is active, we don't need to write them
   twice.   

References add_new_function(), cgraph_add_function_insertion_hook(), fatal_error(), inline_read_section(), inline_summary_alloc(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), len, lto_get_file_decl_data(), lto_get_section_data(), and LTO_section_inline_summary.

gimple_opt_pass* make_pass_inline_parameters ( )
static bool mark_modified ( ao_ref ao,
tree  vdef,
void *  data 
)
static
Callback of walk_aliased_vdefs.  Flags that it has been invoked to the
   boolean variable pointed to by DATA.   

Referenced by unmodified_parm_1().

static struct predicate not_inlined_predicate ( )
staticread
Return predicate that is set true when function is not inlined.   

References predicate_not_inlined_condition, and single_cond_predicate().

Referenced by estimate_function_body_sizes().

static int param_change_prob ( )
static
Return probability (based on REG_BR_PROB_BASE) that I-th parameter of STMT
   will change since last invocation of STMT. 

   Value 0 is reserved for compile time invariants.
   For common parameters it is REG_BR_PROB_BASE.  For loop invariants it
   ought to be REG_BR_PROB_BASE / estimated_iters.   

References ao_ref_init(), record_modified_bb_info::bb_set, bitmap_bit_p(), ctor_for_folding(), frequency, basic_block_def::frequency, get_base_address(), gimple_bb(), gimple_call_arg(), gimple_vuse(), basic_block_def::index, is_gimple_min_invariant(), record_modified(), record_modified_bb_info::stmt, and walk_aliased_vdefs().

Referenced by estimate_function_body_sizes().

static bool phi_result_unknown_predicate ( struct ipa_node_params info,
struct inline_summary summary,
basic_block  bb,
struct predicate p,
vec< predicate_t nonconstant_names 
)
static
Find whether a basic block BB is the final block of a (half) diamond CFG
   sub-graph and if the predicate the condition depends on is known.  If so,
   return true and store the pointer the predicate in *P.   

References false_predicate(), gimple_cond_lhs(), gimple_cond_rhs(), is_gimple_ip_invariant(), last_stmt(), basic_block_def::preds, single_pred(), single_pred_p(), single_succ_p(), edge_def::src, record_modified_bb_info::stmt, true_predicate_p(), and will_be_nonconstant_expr_predicate().

Referenced by estimate_function_body_sizes().

static void predicate_for_phi_result ( struct inline_summary summary,
gimple  phi,
struct predicate p,
vec< predicate_t nonconstant_names 
)
static
Given a PHI statement in a function described by inline properties SUMMARY
   and *P being the predicate describing whether the selected PHI argument is
   known, store a predicate for the result of the PHI statement into
   NONCONSTANT_NAMES, if possible.   

References inline_summary::conds, phi_arg_d::def, dump_file, dump_flags, dump_predicate(), gimple_phi_arg(), gimple_phi_num_args(), gimple_phi_result(), is_gimple_min_invariant(), or_predicates(), and true_predicate_p().

Referenced by estimate_function_body_sizes().

static int predicate_probability ( conditions  conds,
struct predicate p,
clause_t  possible_truths,
vec< inline_param_summary_t inline_param_summary 
)
static
Return the probability in range 0...REG_BR_PROB_BASE that the predicated
   instruction will be recomputed per invocation of the inlined call.   

References predicate::clause, false_predicate_p(), i2, condition::operand_num, predicate_false_condition, predicate_first_dynamic_condition, and true_predicate_p().

Referenced by estimate_node_size_and_time(), and inline_merge_summary().

static bool predicates_equal_p ( )
inlinestatic
Return true if predicates are obviously equal.   

References predicate::clause.

Referenced by account_size_time(), compute_bb_predicates(), and or_predicates().

static struct predicate read_predicate ( )
staticread
Read predicate from IB.   

References predicate::clause, and streamer_read_uhwi().

Referenced by inline_read_section(), and read_inline_edge_summary().

static bool record_modified ( )
static
Callback of walk_aliased_vdefs.  Records basic blocks where the value may be
   set except for info->stmt.   

References record_modified_bb_info::bb_set, bitmap_set_bit(), and record_modified_bb_info::stmt.

Referenced by param_change_prob().

static void remap_edge_change_prob ( struct cgraph_edge inlined_edge,
struct cgraph_edge edge 
)
static
Update change_prob of EDGE after INLINED_EDGE has been inlined.
   When functoin A is inlined in B and A calls C with parameter that
   changes with probability PROB1 and C is known to be passthroug
   of argument if B that change with probability PROB2, the probability
   of change is now PROB1*PROB2.   

References combine_probabilities(), inline_edge_summary(), ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_jf_pass_through_formal_id(), IPA_JF_PASS_THROUGH, ipa_node_params_vector, inline_edge_summary::param, prob, and ipa_jump_func::type.

Referenced by remap_edge_summaries().

static void remap_edge_summaries ( struct cgraph_edge inlined_edge,
struct cgraph_node node,
struct inline_summary info,
struct inline_summary callee_info,
vec< int >  operand_map,
vec< int >  offset_map,
clause_t  possible_truths,
struct predicate toplev_predicate 
)
static
Update edge summaries of NODE after INLINED_EDGE has been inlined.

   Remap predicates of callees of NODE.  Rest of arguments match
   remap_predicate.

   Also update change probabilities.   

References cgraph_edge::callee, cgraph_node::callees, cgraph_edge::count, edge_set_predicate(), false_predicate_p(), cgraph_edge::frequency, cgraph_node::indirect_calls, inline_edge_summary(), cgraph_edge::inline_failed, cgraph_edge::next_callee, inline_edge_summary::predicate, remap_edge_change_prob(), and remap_predicate().

Referenced by inline_merge_summary().

static void remap_hint_predicate ( struct inline_summary info,
struct inline_summary callee_info,
struct predicate **  hint,
vec< int >  operand_map,
vec< int >  offset_map,
clause_t  possible_truths,
struct predicate toplev_predicate 
)
static
Same as remap_predicate, but set result into hint *HINT.   

References and_predicates(), inline_summary::conds, false_predicate_p(), remap_predicate(), set_hint_predicate(), and true_predicate_p().

Referenced by inline_merge_summary().

static void remap_hint_predicate_after_duplication ( struct predicate **  p,
clause_t  possible_truths,
struct inline_summary info 
)
static
Same as remap_predicate_after_duplication but handle hint predicate *P.
   Additionally care about allocating new memory slot for updated predicate
   and set it to NULL when it becomes true or false (and thus uninteresting).

References remap_predicate_after_duplication(), and set_hint_predicate().

Referenced by inline_node_duplication_hook().

static struct predicate remap_predicate ( struct inline_summary info,
struct inline_summary callee_info,
struct predicate p,
vec< int >  operand_map,
vec< int >  offset_map,
clause_t  possible_truths,
struct predicate toplev_predicate 
)
staticread
Translate all conditions from callee representation into caller
   representation and symbolically evaluate predicate P into new predicate.

   INFO is inline_summary of function we are adding predicate into, CALLEE_INFO
   is summary of function predicate P is from. OPERAND_MAP is array giving
   callee formal IDs the caller formal IDs. POSSSIBLE_TRUTHS is clausule of all
   callee conditions that may be true in caller context.  TOPLEV_PREDICATE is
   predicate under which callee is executed.  OFFSET_MAP is an array of of
   offsets that need to be added to conditions, negative offset means that
   conditions relying on values passed by reference have to be discarded
   because they might not be preserved (and should be considered offset zero
   for other purposes).   

References add_condition(), condition::agg_contents, agg_position_info::agg_contents, and_predicates(), condition::by_ref, agg_position_info::by_ref, predicate::clause, inline_summary::conds, false_predicate(), HOST_WIDE_INT, condition::offset, agg_position_info::offset, condition::operand_num, or_predicates(), predicate_first_dynamic_condition, true_predicate(), true_predicate_p(), and condition::val.

Referenced by inline_merge_summary(), remap_edge_summaries(), and remap_hint_predicate().

static struct predicate remap_predicate_after_duplication ( struct predicate p,
clause_t  possible_truths,
struct inline_summary info 
)
staticread
Remap predicate P of former function to be predicate of duplicated functoin.
   POSSIBLE_TRUTHS is clause of possible truths in the duplicated node,
   INFO is inline summary of the duplicated node.   

References add_clause(), predicate::clause, false_predicate(), and true_predicate().

Referenced by inline_node_duplication_hook(), and remap_hint_predicate_after_duplication().

static void reset_inline_edge_summary ( )
static
We are called multiple time for given function; clear
   data from previous run so they are not cumulated.   

References inline_edge_summary::call_stmt_size, inline_edge_summary::call_stmt_time, inline_edge_summary(), inline_edge_summary::param, pool_free(), inline_edge_summary::predicate, and cgraph_edge::uid.

Referenced by inline_edge_removal_hook(), and reset_inline_summary().

static void set_cond_stmt_execution_predicate ( struct ipa_node_params info,
struct inline_summary summary,
basic_block  bb 
)
static
static void set_switch_stmt_execution_predicate ( struct ipa_node_params info,
struct inline_summary summary,
basic_block  bb 
)
static
static struct predicate single_cond_predicate ( )
staticread
Return predicate testing single condition number COND.   

References predicate::clause.

Referenced by add_condition(), false_predicate(), and not_inlined_predicate().

static tree unmodified_parm ( )
static
If OP refers to value of function parameter, return the corresponding
   parameter.  Also traverse chains of SSA register assignments.   

References gimple_assign_rhs1(), gimple_assign_single_p(), and unmodified_parm_1().

Referenced by eliminated_by_inlining_prob(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().

static tree unmodified_parm_1 ( )
static
If OP refers to value of function parameter, return the corresponding
   parameter.   

References ao_ref_init(), gimple_vuse(), mark_modified(), and walk_aliased_vdefs().

Referenced by unmodified_parm(), and unmodified_parm_or_parm_agg_item().

static bool unmodified_parm_or_parm_agg_item ( struct ipa_node_params info,
gimple  stmt,
tree  op,
int *  index_p,
struct agg_position_info aggpos 
)
static
If OP refers to a value of a function parameter or value loaded from an
   aggregate passed to a parameter (either by value or reference), return TRUE
   and store the number of the parameter to *INDEX_P and information whether
   and how it has been loaded from an aggregate into *AGGPOS.  INFO describes
   the function parameters, STMT is the statement in which OP is used or
   loaded.   

References agg_position_info::agg_contents, agg_position_info::by_ref, gimple_assign_rhs1(), gimple_assign_single_p(), ipa_get_param_decl_index(), ipa_load_from_parm_agg(), agg_position_info::offset, and unmodified_parm_1().

Referenced by set_cond_stmt_execution_predicate(), set_switch_stmt_execution_predicate(), and will_be_nonconstant_predicate().

static struct predicate will_be_nonconstant_expr_predicate ( struct ipa_node_params info,
struct inline_summary summary,
tree  expr,
vec< predicate_t nonconstant_names 
)
staticread
Return predicate specifying when the STMT might have result that is not
   a compile time constant.   

References add_condition(), inline_summary::conds, debug_tree(), false_predicate(), ipa_get_param_decl_index(), is_gimple_min_invariant(), or_predicates(), true_predicate_p(), and unmodified_parm().

Referenced by estimate_function_body_sizes(), and phi_result_unknown_predicate().

static struct predicate will_be_nonconstant_predicate ( struct ipa_node_params info,
struct inline_summary summary,
gimple  stmt,
vec< predicate_t nonconstant_names 
)
staticread
static void write_predicate ( )
static
Write predicate P to OB.   

References predicate::clause, and streamer_write_uhwi().

Referenced by inline_write_summary(), and write_inline_edge_summary().


Variable Documentation

struct cgraph_2edge_hook_list* edge_duplication_hook_holder
static

Referenced by ipcp_driver().

alloc_pool edge_predicate_pool
static
Edge predicates goes here.   
struct cgraph_edge_hook_list* edge_removal_hook_holder
static

Referenced by inline_small_functions().

struct cgraph_node_hook_list* function_insertion_hook_holder
static
Holders of ipa cgraph hooks:  
vec<inline_summary_t, va_gc>* inline_summary_vec
VECtor holding inline summaries.  
   In GGC memory because conditions might point to constant trees.   

Referenced by cgraph_process_new_functions().

struct cgraph_2node_hook_list* node_duplication_hook_holder
static
vec<int> node_growth_cache
Cached node/edge growths.   

Referenced by estimate_growth(), and reset_node_growth_cache().

struct cgraph_node_hook_list* node_removal_hook_holder
static