GCC Middle and Back End API Reference
ipa-fnsummary.h File Reference
#include "sreal.h"
#include "ipa-predicate.h"
Include dependency graph for ipa-fnsummary.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  agg_position_info
 
class  size_time_entry
 
class  ipa_size_summary
 
struct  ipa_freqcounting_predicate
 
class  ipa_fn_summary
 
class  ipa_fn_summary_t
 
class  ipa_size_summary_t
 
class  ipa_call_summary
 
class  ipa_call_summary_t
 
struct  ipa_call_estimates
 
class  ipa_call_context
 
class  ipa_cached_call_context
 

Typedefs

typedef int ipa_hints
 

Enumerations

enum  ipa_hints_vals {
  INLINE_HINT_indirect_call = 1 , INLINE_HINT_loop_iterations = 2 , INLINE_HINT_loop_stride = 4 , INLINE_HINT_same_scc = 8 ,
  INLINE_HINT_in_scc = 16 , INLINE_HINT_declared_inline = 32 , INLINE_HINT_cross_module = 64 , INLINE_HINT_known_hot = 128 ,
  INLINE_HINT_builtin_constant_p = 256
}
 

Functions

void ipa_debug_fn_summary (struct cgraph_node *)
 
void ipa_dump_fn_summaries (FILE *f)
 
void ipa_dump_fn_summary (FILE *f, struct cgraph_node *node)
 
void ipa_dump_hints (FILE *f, ipa_hints)
 
void ipa_free_fn_summary (void)
 
void ipa_free_size_summary (void)
 
void inline_analyze_function (struct cgraph_node *node)
 
void estimate_ipcp_clone_size_and_time (struct cgraph_node *node, ipa_auto_call_arg_values *avals, ipa_call_estimates *estimates)
 
void ipa_merge_fn_summary_after_inlining (struct cgraph_edge *edge)
 
void ipa_update_overall_fn_summary (struct cgraph_node *node, bool reset=true)
 
void compute_fn_summary (struct cgraph_node *, bool)
 
bool refs_local_or_readonly_memory_p (tree)
 
bool points_to_local_or_readonly_memory_p (tree)
 
void evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, clause_t *clause_ptr, clause_t *nonspec_clause_ptr, ipa_auto_call_arg_values *avals, bool compute_contexts)
 
void ipa_fnsummary_cc_finalize (void)
 
HOST_WIDE_INT ipa_get_stack_frame_offset (struct cgraph_node *node)
 
void ipa_remove_from_growth_caches (struct cgraph_edge *edge)
 
bool cross_module_call_p (struct cgraph_edge *edge)
 

Variables

fast_function_summary< ipa_fn_summary *, va_gc > * ipa_fn_summaries
 
fast_function_summary< ipa_size_summary *, va_heap > * ipa_size_summaries
 
fast_call_summary< ipa_call_summary *, va_heap > * ipa_call_summaries
 

Typedef Documentation

◆ ipa_hints

Enumeration Type Documentation

◆ ipa_hints_vals

IPA function body analysis.
   Copyright (C) 2003-2024 Free Software Foundation, Inc.
   Contributed by Jan Hubicka

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/>.   
Hints are reasons why IPA heuristics should prefer specializing given
function.  They are represented as bitmap of the following values.   
Enumerator
INLINE_HINT_indirect_call 
INLINE_HINT_loop_iterations 
INLINE_HINT_loop_stride 
INLINE_HINT_same_scc 
INLINE_HINT_in_scc 
INLINE_HINT_declared_inline 
INLINE_HINT_cross_module 
INLINE_HINT_known_hot 
INLINE_HINT_builtin_constant_p 

Function Documentation

◆ compute_fn_summary()

void compute_fn_summary ( struct cgraph_node * node,
bool early )

◆ cross_module_call_p()

bool cross_module_call_p ( struct cgraph_edge * edge)
inline
Return true if EDGE is a cross module call.   

References DECL_COMDAT.

Referenced by dump_ipa_call_summary(), inline_small_functions(), and simple_edge_hints().

◆ estimate_ipcp_clone_size_and_time()

void estimate_ipcp_clone_size_and_time ( struct cgraph_node * node,
ipa_auto_call_arg_values * avals,
ipa_call_estimates * estimates )
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_CONTEXTS are vectors of assumed known constant values
and types for parameters.   

References ipa_call_context::estimate_size_and_time(), evaluate_conditions_for_known_args(), ggc_alloc(), NULL, and vNULL.

Referenced by estimate_local_effects(), and perform_estimation_of_a_value().

◆ evaluate_properties_for_edge()

void evaluate_properties_for_edge ( struct cgraph_edge * e,
bool inline_p,
clause_t * clause_ptr,
clause_t * nonspec_clause_ptr,
ipa_auto_call_arg_values * avals,
bool compute_contexts )
Work out what conditions might be true at invocation of E.
Compute costs for inlined edge if INLINE_P is true.

Return in CLAUSE_PTR the evaluated conditions and in NONSPEC_CLAUSE_PTR
(if non-NULL) conditions evaluated for nonspecialized clone called
in a given context.

Vectors in AVALS will be populated with useful known information about
argument values - information not known to have any uses will be omitted -
except for m_known_contexts which will only be calculated if
COMPUTE_CONTEXTS is true.   

References cgraph_edge::call_stmt, cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::caller, ipa_fn_summary::conds, count, error_mark_node, evaluate_conditions_for_known_args(), fre_will_run_p(), gcc_assert, gcc_checking_assert, ggc_alloc(), gimple_call_arg(), gimple_call_num_args(), i, cgraph_node::inlined_to, ipa_call_summaries, ipa_context_from_jfunc(), ipa_edge_args_sum, ipa_fn_summaries, ipa_get_cs_argument_count(), ipa_get_ith_jump_func(), ipa_get_param_count(), ipa_get_type(), ipa_is_param_used_by_indirect_call(), ipa_is_param_used_by_ipa_predicates(), ipa_is_param_used_by_polymorphic_call(), ipa_node_params_sum, ipa_push_agg_values_from_jfunc(), ipa_value_from_jfunc(), ipa_value_range_from_jfunc(), is_gimple_min_invariant(), MIN, ipa_predicate::not_inlined_condition, NULL, cgraph_node::thunk, TREE_CODE, cgraph_node::ultimate_alias_target(), Value_Range::undefined_p(), ipa_polymorphic_call_context::useless_p(), Value_Range::varying_p(), void_type_node, and vrp_will_run_p().

Referenced by do_estimate_edge_hints(), do_estimate_edge_size(), do_estimate_edge_time(), and ipa_merge_fn_summary_after_inlining().

◆ inline_analyze_function()

◆ ipa_debug_fn_summary()

void ipa_debug_fn_summary ( struct cgraph_node * node)
In ipa-fnsummary.cc   

References ggc_alloc(), and ipa_dump_fn_summary().

◆ ipa_dump_fn_summaries()

void ipa_dump_fn_summaries ( FILE * f)

◆ ipa_dump_fn_summary()

◆ ipa_dump_hints()

◆ ipa_fnsummary_cc_finalize()

void ipa_fnsummary_cc_finalize ( void )
Reset all state within ipa-fnsummary.cc so that we can rerun the compiler
within the same process.  For use by toplev::finalize.   

References ipa_free_fn_summary(), and ipa_free_size_summary().

Referenced by toplev::finalize().

◆ ipa_free_fn_summary()

◆ ipa_free_size_summary()

void ipa_free_size_summary ( void )
Release function summary.   

References ipa_size_summaries, and NULL.

Referenced by ipa_fnsummary_cc_finalize(), and symbol_table::process_new_functions().

◆ ipa_get_stack_frame_offset()

HOST_WIDE_INT ipa_get_stack_frame_offset ( struct cgraph_node * node)
Return stack frame offset where frame of NODE is supposed to start inside
of the function it is inlined to.
Return 0 for functions that are not inlined.   

References cgraph_edge::caller, cgraph_node::callers, ggc_alloc(), cgraph_node::inlined_to, ipa_size_summaries, and offset.

Referenced by caller_growth_limits(), dump_ipa_call_summary(), and ipa_merge_fn_summary_after_inlining().

◆ ipa_merge_fn_summary_after_inlining()

◆ ipa_remove_from_growth_caches()

void ipa_remove_from_growth_caches ( struct cgraph_edge * edge)
Remove EDGE from caches once it was inlined.   

References edge_growth_cache, and node_context_cache.

Referenced by ipa_merge_fn_summary_after_inlining().

◆ ipa_update_overall_fn_summary()

◆ points_to_local_or_readonly_memory_p()

bool points_to_local_or_readonly_memory_p ( tree t)
Return true if T is a pointer pointing to memory location that is local
for the function (that means, dead after return) or read-only.   

References cfun, current_function_decl, DECL_BY_REFERENCE, DECL_RESULT, ggc_alloc(), integer_zerop(), ptr_deref_may_alias_global_p(), refs_local_or_readonly_memory_p(), ssa_default_def(), TREE_CODE, and TREE_OPERAND.

Referenced by analyze_function_body(), refs_local_or_readonly_memory_p(), and remap_edge_params().

◆ refs_local_or_readonly_memory_p()

bool refs_local_or_readonly_memory_p ( tree t)
Return true if T references memory location that is local
for the function (that means, dead after return) or read-only.   

References auto_var_in_fn_p(), current_function_decl, DECL_P, get_base_address(), ggc_alloc(), points_to_local_or_readonly_memory_p(), TREE_CODE, TREE_OPERAND, and TREE_READONLY.

Referenced by check_op(), and points_to_local_or_readonly_memory_p().

Variable Documentation

◆ ipa_call_summaries

◆ ipa_fn_summaries

◆ ipa_size_summaries