GCC Middle and Back End API Reference
ipa-prop.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipa_constant_data
 
struct  ipa_pass_through_data
 
struct  ipa_load_agg_data
 
struct  ipa_ancestor_jf_data
 
struct  ipa_agg_jf_item
 
union  ipa_agg_jf_item::jump_func_agg_value
 
struct  ipa_agg_jump_function
 
struct  ipa_argagg_value
 
class  ipa_argagg_value_list
 
class  ipa_vr
 
struct  ipa_jump_func
 
union  ipa_jump_func::jump_func_value
 
class  ipa_auto_call_arg_values
 
class  ipa_call_arg_values
 
struct  ipa_param_descriptor
 
class  ipa_node_params
 
struct  ipa_param_aa_status
 
struct  ipa_bb_info
 
struct  ipa_func_body_info
 
struct  ipa_uid_to_idx_map_elt
 
struct  ipcp_transformation
 
class  ipa_edge_args
 
class  ipa_node_params_t
 
class  ipa_edge_args_sum_t
 
class  ipcp_transformation_t
 

Macros

#define IPA_UNDESCRIBED_USE   -1
 
#define IPA_PROP_ARG_INDEX_LIMIT_BITS   16
 

Enumerations

enum  jump_func_type {
  IPA_JF_UNKNOWN = 0 , IPA_JF_CONST , IPA_JF_PASS_THROUGH , IPA_JF_LOAD_AGG ,
  IPA_JF_ANCESTOR
}
 

Functions

tree ipa_get_jf_constant (struct ipa_jump_func *jfunc)
 
struct ipa_cst_ref_descipa_get_jf_constant_rdesc (struct ipa_jump_func *jfunc)
 
void ipa_zap_jf_refdesc (ipa_jump_func *jfunc)
 
tree ipa_get_jf_pass_through_operand (struct ipa_jump_func *jfunc)
 
int ipa_get_jf_pass_through_formal_id (struct ipa_jump_func *jfunc)
 
enum tree_code ipa_get_jf_pass_through_operation (struct ipa_jump_func *jfunc)
 
bool ipa_get_jf_pass_through_agg_preserved (struct ipa_jump_func *jfunc)
 
bool ipa_get_jf_pass_through_refdesc_decremented (struct ipa_jump_func *jfunc)
 
void ipa_set_jf_pass_through_refdesc_decremented (ipa_jump_func *jfunc, bool value)
 
bool ipa_get_jf_pass_through_type_preserved (struct ipa_jump_func *jfunc)
 
HOST_WIDE_INT ipa_get_jf_ancestor_offset (struct ipa_jump_func *jfunc)
 
int ipa_get_jf_ancestor_formal_id (struct ipa_jump_func *jfunc)
 
bool ipa_get_jf_ancestor_agg_preserved (struct ipa_jump_func *jfunc)
 
bool ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc)
 
bool ipa_get_jf_ancestor_keep_null (struct ipa_jump_func *jfunc)
 
int ipa_get_param_count (class ipa_node_params *info)
 
tree ipa_get_param (const vec< ipa_param_descriptor, va_gc > &descriptors, int i)
 
tree ipa_get_param (class ipa_node_params *info, int i)
 
tree ipa_get_type (class ipa_node_params *info, int i)
 
int ipa_get_param_move_cost (class ipa_node_params *info, int i)
 
void ipa_set_param_used (class ipa_node_params *info, int i, bool val)
 
void ipa_set_param_used_by_ipa_predicates (class ipa_node_params *info, int i, bool val)
 
void ipa_set_param_used_by_indirect_call (class ipa_node_params *info, int i, bool val)
 
void ipa_set_param_used_by_polymorphic_call (class ipa_node_params *info, int i, bool val)
 
int ipa_get_controlled_uses (class ipa_node_params *info, int i)
 
void ipa_set_controlled_uses (class ipa_node_params *info, int i, int val)
 
int ipa_get_param_load_dereferenced (class ipa_node_params *info, int i)
 
void ipa_set_param_load_dereferenced (class ipa_node_params *info, int i, bool val)
 
bool ipa_is_param_used (class ipa_node_params *info, int i)
 
bool ipa_is_param_used_by_ipa_predicates (class ipa_node_params *info, int i)
 
bool ipa_is_param_used_by_indirect_call (class ipa_node_params *info, int i)
 
bool ipa_is_param_used_by_polymorphic_call (class ipa_node_params *info, int i)
 
void ipa_set_node_agg_value_chain (struct cgraph_node *node, vec< ipa_argagg_value, va_gc > *aggs)
 
void ipcp_transformation_initialize (void)
 
void ipcp_free_transformation_sum (void)
 
int ipa_get_cs_argument_count (class ipa_edge_args *args)
 
struct ipa_jump_funcipa_get_ith_jump_func (class ipa_edge_args *args, int i)
 
class ipa_polymorphic_call_contextipa_get_ith_polymorhic_call_context (class ipa_edge_args *args, int i)
 
void ipa_create_all_node_params (void)
 
void ipa_create_all_edge_args (void)
 
void ipa_check_create_edge_args (void)
 
void ipa_free_all_node_params (void)
 
void ipa_free_all_edge_args (void)
 
void ipa_free_all_structures_after_ipa_cp (void)
 
void ipa_free_all_structures_after_iinln (void)
 
void ipa_register_cgraph_hooks (void)
 
int count_formal_params (tree fndecl)
 
void ipa_check_create_node_params (void)
 
bool ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge)
 
ipcp_transformationipcp_get_transformation_summary (cgraph_node *node)
 
void ipa_initialize_node_params (struct cgraph_node *node)
 
bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs, vec< cgraph_edge * > *new_edges)
 
tree ipa_get_indirect_edge_target (struct cgraph_edge *ie, ipa_call_arg_values *avals, bool *speculative)
 
struct cgraph_edgeipa_make_edge_direct_to_target (struct cgraph_edge *, tree, bool speculative=false)
 
tree ipa_impossible_devirt_target (struct cgraph_edge *, tree)
 
void ipa_analyze_node (struct cgraph_node *)
 
tree ipa_find_agg_cst_from_init (tree scalar, HOST_WIDE_INT offset, bool by_ref)
 
bool ipa_load_from_parm_agg (struct ipa_func_body_info *fbi, vec< ipa_param_descriptor, va_gc > *descriptors, gimple *stmt, tree op, int *index_p, HOST_WIDE_INT *offset_p, poly_int64 *size_p, bool *by_ref, bool *guaranteed_unmodified=NULL)
 
void ipa_print_node_params (FILE *, struct cgraph_node *node)
 
void ipa_print_all_params (FILE *)
 
void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node)
 
void ipa_print_all_jump_functions (FILE *f)
 
void ipcp_verify_propagated_values (void)
 
void ipa_prop_write_jump_functions (void)
 
void ipa_prop_read_jump_functions (void)
 
void ipcp_write_transformation_summaries (void)
 
void ipcp_read_transformation_summaries (void)
 
int ipa_get_param_decl_index (class ipa_node_params *, tree)
 
tree ipa_value_from_jfunc (class ipa_node_params *info, struct ipa_jump_func *jfunc, tree type)
 
tree ipa_agg_value_from_jfunc (ipa_node_params *info, cgraph_node *node, const ipa_agg_jf_item *item)
 
unsigned int ipcp_transform_function (struct cgraph_node *node)
 
ipa_polymorphic_call_context ipa_context_from_jfunc (ipa_node_params *, cgraph_edge *, int, ipa_jump_func *)
 
void ipa_value_range_from_jfunc (vrange &, ipa_node_params *, cgraph_edge *, ipa_jump_func *, tree)
 
void ipa_push_agg_values_from_jfunc (ipa_node_params *info, cgraph_node *node, ipa_agg_jump_function *agg_jfunc, unsigned dst_index, vec< ipa_argagg_value > *res)
 
void ipa_dump_param (FILE *, class ipa_node_params *info, int i)
 
void ipa_release_body_info (struct ipa_func_body_info *)
 
tree ipa_get_callee_param_type (struct cgraph_edge *e, int i)
 
bool ipcp_get_parm_bits (tree, tree *, widest_int *)
 
tree ipcp_get_aggregate_const (struct function *func, tree parm, bool by_ref, HOST_WIDE_INT bit_offset, HOST_WIDE_INT bit_size)
 
bool unadjusted_ptr_and_unit_offset (tree op, tree *ret, poly_int64 *offset_ret)
 
void ipa_prop_cc_finalize (void)
 
tree build_ref_for_offset (location_t, tree, poly_int64, bool, tree, gimple_stmt_iterator *, bool)
 
void ipa_cp_cc_finalize (void)
 
void ipa_range_set_and_normalize (vrange &r, tree val)
 
bool ipa_return_value_range (value_range &range, tree decl)
 
void ipa_record_return_value_range (value_range val)
 
bool ipa_jump_functions_equivalent_p (ipa_jump_func *jf1, ipa_jump_func *jf2)
 

Variables

ipa_node_params_tipa_node_params_sum
 
ipa_edge_args_sum_tipa_edge_args_sum
 
function_summary< ipcp_transformation * > * ipcp_transformation_sum
 
object_allocator< ipcp_value< tree > > ipcp_cst_values_pool
 
object_allocator< ipcp_value< ipa_polymorphic_call_context > > ipcp_poly_ctx_values_pool
 
object_allocator< ipcp_value_source< tree > > ipcp_sources_pool
 
object_allocator< ipcp_agg_latticeipcp_agg_lattice_pool
 

Macro Definition Documentation

◆ IPA_PROP_ARG_INDEX_LIMIT_BITS

#define IPA_PROP_ARG_INDEX_LIMIT_BITS   16
Index identifying an actualargument or a formal parameter may have only this
many bits.   

Referenced by ipa_analyze_node().

◆ IPA_UNDESCRIBED_USE

#define IPA_UNDESCRIBED_USE   -1
Interprocedural analyses.
   Copyright (C) 2005-2024 Free Software Foundation, Inc.

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/>.   
The following definitions and interfaces are used by
interprocedural analyses or parameters.   

Referenced by adjust_references_in_caller(), combine_controlled_uses_counters(), ipa_edge_args_sum_t::duplicate(), ipa_analyze_controlled_uses(), ipa_get_controlled_uses(), ipa_get_param_load_dereferenced(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), jfunc_rdesc_usable(), and propagate_controlled_uses().

Enumeration Type Documentation

◆ jump_func_type

ipa-prop.cc stuff (ipa-cp, indirect inlining):   
A jump function for a callsite represents the values passed as actual
arguments of the callsite.  They were originally proposed in a paper called
"Interprocedural Constant Propagation", by David Callahan, Keith D Cooper,
Ken Kennedy, Linda Torczon in Comp86, pg 152-161.  There are three main
types of values :

Pass-through - the caller's formal parameter is passed as an actual
               argument, possibly one simple operation performed on it.
Constant     - a constant (is_gimple_ip_invariant)is passed as an actual
               argument.
Unknown      - neither of the above.

IPA_JF_LOAD_AGG is a compound pass-through jump function, in which primary
operation on formal parameter is memory dereference that loads a value from
a part of an aggregate, which is represented or pointed to by the formal
parameter.  Moreover, an additional unary/binary operation can be applied on
the loaded value, and final result is passed as actual argument of callee
(e.g. *(param_1(D) + 4) op 24 ).  It is meant to describe usage of aggregate
parameter or by-reference parameter referenced in argument passing, commonly
found in C++ and Fortran.

IPA_JF_ANCESTOR is a special pass-through jump function, which means that
the result is an address of a part of the object pointed to by the formal
parameter to which the function refers.  It is mainly intended to represent
getting addresses of ancestor fields in C++
(e.g. &this_1(D)->D.1766.D.1756).  Note that if the original pointer is
NULL, ancestor jump function must behave like a simple pass-through.

Other pass-through functions can either simply pass on an unchanged formal
parameter or can apply one simple binary operation to it (such jump
functions are called polynomial).

Jump functions are computed in ipa-prop.cc by function
update_call_notes_after_inlining.  Some information can be lost and jump
functions degraded accordingly when inlining, see
update_call_notes_after_inlining in the same file.   
Enumerator
IPA_JF_UNKNOWN 
IPA_JF_CONST 
IPA_JF_PASS_THROUGH 
IPA_JF_LOAD_AGG 
IPA_JF_ANCESTOR 

Function Documentation

◆ build_ref_for_offset()

tree build_ref_for_offset ( location_t loc,
tree base,
poly_int64 offset,
bool reverse,
tree exp_type,
gimple_stmt_iterator * gsi,
bool insert_after )
From tree-sra.cc:   
Construct a MEM_REF that would reference a part of aggregate BASE of type
EXP_TYPE at the given OFFSET and with storage order REVERSE.  If BASE is
something for which get_addr_base_and_unit_offset returns NULL, gsi must
be non-NULL and is used to insert new statements either before or below
the current one as specified by INSERT_AFTER.  This function is not capable
of handling bitfields.   

References build_aligned_type(), build_fold_addr_expr, build_int_cst(), build_pointer_type(), build_qualified_type(), ENCODE_QUAL_ADDR_SPACE, fold_build2_loc(), gcc_checking_assert, get_addr_base_and_unit_offset(), get_object_alignment_1(), gimple_build_assign(), gimple_set_location(), gsi_insert_after(), gsi_insert_before(), GSI_NEW_STMT, GSI_SAME_STMT, int_const_binop(), make_ssa_name(), MIN, offset, REF_REVERSE_STORAGE_ORDER, reference_alias_ptr_type(), STRIP_USELESS_TYPE_CONVERSION, TREE_CODE, TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_ALIGN, TYPE_QUALS, and unshare_expr().

Referenced by analyze_access_subtree(), and build_ref_for_model().

◆ count_formal_params()

◆ ipa_agg_value_from_jfunc()

tree ipa_agg_value_from_jfunc ( ipa_node_params * info,
cgraph_node * node,
const ipa_agg_jf_item * item )

◆ ipa_analyze_node()

◆ ipa_check_create_edge_args()

void ipa_check_create_edge_args ( void )
Ensure that array of edge arguments infos is big enough to accommodate a
structure for all edges and reallocates it if not.  Also, allocate
associated hash tables is they do not already exist.   

References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), ggc_alloc_no_dtor(), ipa_edge_args_sum, ipa_vr_hash_table, and symtab.

Referenced by ipa_analyze_node(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), ipcp_driver(), and update_indirect_edges_after_inlining().

◆ ipa_check_create_node_params()

void ipa_check_create_node_params ( void )
inline
This function ensures the array of node param infos is big enough to
accommodate a structure for all nodes and reallocates it if not.   

References ggc_alloc_no_dtor(), ipa_node_params_sum, and symtab.

Referenced by analyze_function_body(), ipa_analyze_node(), ipa_make_edge_direct_to_target(), ipa_prop_read_jump_functions(), ipa_register_cgraph_hooks(), and ipcp_driver().

◆ ipa_context_from_jfunc()

◆ ipa_cp_cc_finalize()

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

References base_count, ipcp_free_transformation_sum(), orig_overall_size, overall_size, and profile_count::uninitialized().

Referenced by toplev::finalize().

◆ ipa_create_all_edge_args()

void ipa_create_all_edge_args ( void )

◆ ipa_create_all_node_params()

void ipa_create_all_node_params ( void )
Creating and freeing ipa_node_params and ipa_edge_args.   

◆ ipa_dump_param()

void ipa_dump_param ( FILE * file,
class ipa_node_params * info,
int i )
Return the declaration of Ith formal parameter of the function corresponding
to INFO.  Note there is no setter function as this array is built just once
using ipa_initialize_node_params.  

References ipa_node_params::descriptors, i, and print_generic_expr().

Referenced by decide_about_value(), estimate_local_effects(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), get_replacement_map(), and ipa_print_node_params().

◆ ipa_edge_args_info_available_for_edge_p()

bool ipa_edge_args_info_available_for_edge_p ( struct cgraph_edge * edge)
inline
Returns true if edge summary contains a record for EDGE.  The main purpose
of this function is that debug dumping function can check info availability
without causing allocations.   

References ipa_edge_args_sum.

Referenced by ipa_print_node_jump_functions().

◆ ipa_find_agg_cst_from_init()

tree ipa_find_agg_cst_from_init ( tree scalar,
HOST_WIDE_INT offset,
bool by_ref )
Aggregate jump function related functions.   
Check whether SCALAR could be used to look up an aggregate interprocedural
invariant from a static constructor and if so, return it.  Otherwise return
NULL.  

References DECL_INITIAL, find_constructor_constant_at_offset(), is_global_var(), NULL, offset, TREE_CODE, TREE_OPERAND, TREE_READONLY, and VAR_P.

Referenced by evaluate_conditions_for_known_args(), ipa_get_indirect_edge_target_1(), try_make_edge_direct_simple_call(), and try_make_edge_direct_virtual_call().

◆ ipa_free_all_edge_args()

void ipa_free_all_edge_args ( void )
Free all ipa_edge structures.   

References ggc_delete(), ipa_edge_args_sum, and NULL.

Referenced by ipa_free_all_structures_after_iinln(), and ipa_free_all_structures_after_ipa_cp().

◆ ipa_free_all_node_params()

void ipa_free_all_node_params ( void )

◆ ipa_free_all_structures_after_iinln()

void ipa_free_all_structures_after_iinln ( void )
Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after indirect inlining.   

References ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_refdesc_pool, ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_cst_values_pool, ipcp_poly_ctx_values_pool, and ipcp_sources_pool.

◆ ipa_free_all_structures_after_ipa_cp()

void ipa_free_all_structures_after_ipa_cp ( void )
Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after ipa-cp.   

References ipa_free_all_edge_args(), ipa_free_all_node_params(), ipa_refdesc_pool, ipa_unregister_cgraph_hooks(), ipcp_agg_lattice_pool, ipcp_cst_values_pool, ipcp_poly_ctx_values_pool, and ipcp_sources_pool.

Referenced by ipcp_driver().

◆ ipa_get_callee_param_type()

tree ipa_get_callee_param_type ( struct cgraph_edge * e,
int i )

◆ ipa_get_controlled_uses()

int ipa_get_controlled_uses ( class ipa_node_params * info,
int i )
inline
Return how many uses described by ipa-prop a parameter has or
IPA_UNDESCRIBED_USE if there is a use that is not described by these
structures.   

References ipa_node_params::descriptors, i, IPA_UNDESCRIBED_USE, and vec_safe_length().

Referenced by adjust_references_in_caller(), create_specialized_node(), ipa_edge_args_sum_t::duplicate(), ipa_get_param_load_dereferenced(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), and propagate_controlled_uses().

◆ ipa_get_cs_argument_count()

◆ ipa_get_indirect_edge_target()

tree ipa_get_indirect_edge_target ( struct cgraph_edge * ie,
ipa_call_arg_values * avals,
bool * speculative )
Indirect edge processing and target discovery.   
If an indirect edge IE can be turned into a direct one based on data in
AVALS, return the destination.  Store into *SPECULATIVE a boolean determinig
whether the discovered target is only speculative guess.   

References ipa_get_indirect_edge_target_1(), ipa_call_arg_values::m_known_contexts, and ipa_call_arg_values::m_known_vals.

Referenced by estimate_edge_devirt_benefit().

◆ ipa_get_ith_jump_func()

◆ ipa_get_ith_polymorhic_call_context()

class ipa_polymorphic_call_context * ipa_get_ith_polymorhic_call_context ( class ipa_edge_args * args,
int i )
inline
Returns a pointer to the polymorphic call context for the ith argument.
NULL if contexts are not computed.   

References i, and NULL.

Referenced by ipa_compute_jump_functions_for_edge(), ipa_context_from_jfunc(), ipa_print_node_jump_functions_for_edge(), ipa_read_edge_info(), ipa_write_node_info(), propagate_context_across_jump_function(), and update_jump_functions_after_inlining().

◆ ipa_get_jf_ancestor_agg_preserved()

◆ ipa_get_jf_ancestor_formal_id()

◆ ipa_get_jf_ancestor_keep_null()

bool ipa_get_jf_ancestor_keep_null ( struct ipa_jump_func * jfunc)
inline
Return if jfunc represents an operation whether we first check the formal
parameter for non-NULLness unless it does not matter because the offset is
zero anyway.   

References ipa_jump_func::jump_func_value::ancestor, gcc_checking_assert, IPA_JF_ANCESTOR, ipa_ancestor_jf_data::keep_null, ipa_jump_func::type, and ipa_jump_func::value.

Referenced by ipa_get_jf_ancestor_result(), propagate_bits_across_jump_function(), and update_jump_functions_after_inlining().

◆ ipa_get_jf_ancestor_offset()

◆ ipa_get_jf_ancestor_type_preserved()

◆ ipa_get_jf_constant()

◆ ipa_get_jf_constant_rdesc()

◆ ipa_get_jf_pass_through_agg_preserved()

◆ ipa_get_jf_pass_through_formal_id()

◆ ipa_get_jf_pass_through_operand()

◆ ipa_get_jf_pass_through_operation()

◆ ipa_get_jf_pass_through_refdesc_decremented()

bool ipa_get_jf_pass_through_refdesc_decremented ( struct ipa_jump_func * jfunc)
inline

◆ ipa_get_jf_pass_through_type_preserved()

◆ ipa_get_param() [1/2]

tree ipa_get_param ( class ipa_node_params * info,
int i )
inline
Return the declaration of Ith formal parameter of the function corresponding
to INFO.  Note there is no setter function as this array is built just once
using ipa_initialize_node_params.  This function should not be called in
WPA.   

References ipa_node_params::descriptors, gcc_checking_assert, i, and ipa_get_param().

◆ ipa_get_param() [2/2]

tree ipa_get_param ( const vec< ipa_param_descriptor, va_gc > & descriptors,
int i )
inline
Return the parameter declaration in DESCRIPTORS at index I and assert it is
indeed a PARM_DECL.   

References ipa_node_params::descriptors, gcc_checking_assert, i, and TREE_CODE.

Referenced by ipa_analyze_controlled_uses(), and ipa_get_param().

◆ ipa_get_param_count()

◆ ipa_get_param_decl_index()

◆ ipa_get_param_load_dereferenced()

int ipa_get_param_load_dereferenced ( class ipa_node_params * info,
int i )
inline
Assuming a parameter does not have IPA_UNDESCRIBED_USE controlled uses,
return flag which indicates it has been dereferenced but only in a load.   

References ipa_node_params::descriptors, gcc_assert, i, ipa_get_controlled_uses(), and IPA_UNDESCRIBED_USE.

Referenced by adjust_references_in_caller(), create_specialized_node(), ipa_print_node_params(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), and propagate_controlled_uses().

◆ ipa_get_param_move_cost()

int ipa_get_param_move_cost ( class ipa_node_params * info,
int i )
inline
Return the move cost of Ith formal parameter of the function corresponding
to INFO.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by gather_context_independent_values(), and ipa_write_node_info().

◆ ipa_get_type()

◆ ipa_impossible_devirt_target()

tree ipa_impossible_devirt_target ( struct cgraph_edge * ie,
tree target )
Return the target to be used in cases of impossible devirtualization.  IE
and target (the latter can be NULL) are dumped when dumping is enabled.   

References builtin_decl_unreachable(), cgraph_edge::caller, DECL_ASSEMBLER_NAME, dump_file, symtab_node::dump_name(), cgraph_node::get_create(), and IDENTIFIER_POINTER.

Referenced by ipa_get_indirect_edge_target_1(), and try_make_edge_direct_virtual_call().

◆ ipa_initialize_node_params()

void ipa_initialize_node_params ( struct cgraph_node * node)
Function formal parameters related computations.   
Initialize the ipa_node_params structure associated with NODE by counting
the function parameters, creating the descriptors and populating their
param_decls.   

References count_formal_params(), symtab_node::decl, ipa_node_params::descriptors, ipa_alloc_node_params(), ipa_node_params_sum, and ipa_populate_param_decls().

Referenced by analyze_function_body(), and ipa_analyze_node().

◆ ipa_is_param_used()

bool ipa_is_param_used ( class ipa_node_params * info,
int i )
inline

◆ ipa_is_param_used_by_indirect_call()

bool ipa_is_param_used_by_indirect_call ( class ipa_node_params * info,
int i )
inline
Return the used_by_indirect_call flag corresponding to the Ith formal
parameter of the function associated with INFO.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), evaluate_properties_for_edge(), and ipa_print_node_params().

◆ ipa_is_param_used_by_ipa_predicates()

bool ipa_is_param_used_by_ipa_predicates ( class ipa_node_params * info,
int i )
inline
Return the used_by_ipa_predicates flag corresponding to the Ith formal
parameter of the function associated with INFO.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), evaluate_properties_for_edge(), and ipa_print_node_params().

◆ ipa_is_param_used_by_polymorphic_call()

bool ipa_is_param_used_by_polymorphic_call ( class ipa_node_params * info,
int i )
inline
Return the used_by_polymorphic_call flag corresponding to the Ith formal
parameter of the function associated with INFO.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_cached_call_context::duplicate_from(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), evaluate_properties_for_edge(), and ipa_print_node_params().

◆ ipa_jump_functions_equivalent_p()

◆ ipa_load_from_parm_agg()

bool ipa_load_from_parm_agg ( struct ipa_func_body_info * fbi,
vec< ipa_param_descriptor, va_gc > * descriptors,
gimple * stmt,
tree op,
int * index_p,
HOST_WIDE_INT * offset_p,
poly_int64 * size_p,
bool * by_ref_p,
bool * guaranteed_unmodified )
Return true if we can prove that OP is a memory reference loading
data from an aggregate passed as a parameter.

The function works in two modes.  If GUARANTEED_UNMODIFIED is NULL, it return
false if it cannot prove that the value has not been modified before the
load in STMT.  If GUARANTEED_UNMODIFIED is not NULL, it will return true even
if it cannot prove the value has not been modified, in that case it will
store false to *GUARANTEED_UNMODIFIED, otherwise it will store true there.

INFO and PARMS_AINFO describe parameters of the current function (but the
latter can be NULL), STMT is the load statement.  If function returns true,
*INDEX_P, *OFFSET_P and *BY_REF is filled with the parameter index, offset
within the aggregate and whether it is a load from a value passed by
reference respectively.

Return false if the offset divided by BITS_PER_UNIT would not fit into an
unsigned int.   

References DECL_P, get_ref_base_and_extent_hwi(), integer_zerop(), ipa_get_param_decl_index_1(), load_from_unmodified_param(), parm_preserved_before_stmt_p(), parm_ref_data_preserved_p(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, and UINT_MAX.

Referenced by ipcp_modif_dom_walker::before_dom_children(), ipa_analyze_indirect_call_uses(), load_from_unmodified_param_or_agg(), and unmodified_parm_or_parm_agg_item().

◆ ipa_make_edge_direct_to_target()

◆ ipa_print_all_jump_functions()

void ipa_print_all_jump_functions ( FILE * f)
Print ipa_jump_func data structures of all nodes in the call graph to F.   

References FOR_EACH_FUNCTION, and ipa_print_node_jump_functions().

Referenced by ipcp_driver().

◆ ipa_print_all_params()

void ipa_print_all_params ( FILE * f)
Print ipa_tree_map data structures of all functions in the
callgraph to F.   

References FOR_EACH_FUNCTION, and ipa_print_node_params().

Referenced by ipcp_driver().

◆ ipa_print_node_jump_functions()

◆ ipa_print_node_params()

◆ ipa_prop_cc_finalize()

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

References function_insertion_hook_holder, ggc_delete(), ipa_edge_args_sum, ipa_node_params_sum, NULL, symbol_table::remove_cgraph_insertion_hook(), and symtab.

Referenced by toplev::finalize().

◆ ipa_prop_read_jump_functions()

◆ ipa_prop_write_jump_functions()

◆ ipa_propagate_indirect_call_infos()

bool ipa_propagate_indirect_call_infos ( struct cgraph_edge * cs,
vec< cgraph_edge * > * new_edges )
Update jump functions and call note functions on inlining the call site CS.
CS is expected to lead to a node already cloned by
cgraph_clone_inline_nodes.  Newly discovered indirect edges will be added to
*NEW_EDGES, unless NEW_EDGES is NULL.  Return true iff a new edge(s) were +
created.   

References cgraph_edge::callee, changed, ipa_cst_ref_desc::cs, FOR_EACH_VEC_ELT, gcc_assert, i, ipa_edge_args_sum, ipa_get_jf_constant_rdesc(), IPA_JF_CONST, ipa_node_params_sum, ipcp_transformation_sum, propagate_controlled_uses(), propagate_info_to_inlined_callees(), ipa_edge_args_sum_t::remove(), and ipa_jump_func::type.

Referenced by inline_call().

◆ ipa_push_agg_values_from_jfunc()

void ipa_push_agg_values_from_jfunc ( ipa_node_params * info,
cgraph_node * node,
ipa_agg_jump_function * agg_jfunc,
unsigned dst_index,
vec< ipa_argagg_value > * res )
Process all items in AGG_JFUNC relative to caller (or the node the original
caller is inlined to) NODE which described by INFO and push the results to
RES as describing values passed in parameter DST_INDEX.   

References ipa_agg_jump_function::by_ref, ipa_argagg_value::by_ref, gcc_assert, ipa_argagg_value::index, ipa_agg_value_from_jfunc(), ipa_agg_jump_function::items, ipa_argagg_value::killed, ipa_argagg_value::unit_offset, and ipa_argagg_value::value.

Referenced by evaluate_properties_for_edge().

◆ ipa_range_set_and_normalize()

void ipa_range_set_and_normalize ( vrange & r,
tree val )
inline
Set R to the range of [VAL, VAL] while normalizing addresses to
non-zero.   

References r, TREE_CODE, and TREE_TYPE.

Referenced by evaluate_conditions_for_known_args(), ipa_value_range_from_jfunc(), and propagate_vr_across_jump_function().

◆ ipa_record_return_value_range()

◆ ipa_register_cgraph_hooks()

◆ ipa_release_body_info()

void ipa_release_body_info ( struct ipa_func_body_info * fbi)

◆ ipa_return_value_range()

bool ipa_return_value_range ( value_range & range,
tree decl )

◆ ipa_set_controlled_uses()

void ipa_set_controlled_uses ( class ipa_node_params * info,
int i,
int val )
inline

◆ ipa_set_jf_pass_through_refdesc_decremented()

void ipa_set_jf_pass_through_refdesc_decremented ( ipa_jump_func * jfunc,
bool value )
inline

◆ ipa_set_node_agg_value_chain()

void ipa_set_node_agg_value_chain ( struct cgraph_node * node,
vec< ipa_argagg_value, va_gc > * aggs )
Set the aggregate replacements of NODE to be AGGVALS.   

References ipcp_transformation_initialize(), ipcp_transformation_sum, and ipcp_transformation::m_agg_values.

Referenced by create_specialized_node().

◆ ipa_set_param_load_dereferenced()

void ipa_set_param_load_dereferenced ( class ipa_node_params * info,
int i,
bool val )
inline
Set the load_dereferenced flag of a given parameter.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_analyze_controlled_uses(), ipa_read_node_info(), and propagate_controlled_uses().

◆ ipa_set_param_used()

void ipa_set_param_used ( class ipa_node_params * info,
int i,
bool val )
inline
Set the used flag corresponding to the Ith formal parameter of the function
associated with INFO to VAL.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_analyze_controlled_uses(), ipa_read_node_info(), and visit_ref_for_mod_analysis().

◆ ipa_set_param_used_by_indirect_call()

void ipa_set_param_used_by_indirect_call ( class ipa_node_params * info,
int i,
bool val )
inline
Set the used_by_indirect_call flag corresponding to the Ith formal
parameter of the function associated with INFO to VAL.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_note_param_call(), ipa_read_indirect_edge_info(), and update_indirect_edges_after_inlining().

◆ ipa_set_param_used_by_ipa_predicates()

void ipa_set_param_used_by_ipa_predicates ( class ipa_node_params * info,
int i,
bool val )
inline
Set the used_by_ipa_predicates flag corresponding to the Ith formal
parameter of the function associated with INFO to VAL.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by add_condition(), and inline_read_section().

◆ ipa_set_param_used_by_polymorphic_call()

void ipa_set_param_used_by_polymorphic_call ( class ipa_node_params * info,
int i,
bool val )
inline
Set the .used_by_polymorphic_call flag corresponding to the Ith formal
parameter of the function associated with INFO to VAL.   

References ipa_node_params::descriptors, gcc_checking_assert, and i.

Referenced by ipa_note_param_call(), ipa_read_indirect_edge_info(), and update_indirect_edges_after_inlining().

◆ ipa_value_from_jfunc()

tree ipa_value_from_jfunc ( class ipa_node_params * info,
struct ipa_jump_func * jfunc,
tree parm_type )

◆ ipa_value_range_from_jfunc()

◆ ipa_zap_jf_refdesc()

void ipa_zap_jf_refdesc ( ipa_jump_func * jfunc)
inline

◆ ipcp_free_transformation_sum()

void ipcp_free_transformation_sum ( void )
Release the IPA CP transformation summary.   

References ggc_free(), ipcp_transformation_sum, and NULL.

Referenced by ipa_cp_cc_finalize().

◆ ipcp_get_aggregate_const()

tree ipcp_get_aggregate_const ( struct function * func,
tree parm,
bool by_ref,
HOST_WIDE_INT bit_offset,
HOST_WIDE_INT bit_size )
If IPA-CP discovered a constant in parameter PARM at OFFSET of a given SIZE
- whether passed by reference or not is given by BY_REF - return that
constant.  Otherwise return NULL_TREE.  The is supposed to be used only
after clone materialization and transformation is done (because it asserts
that killed constants have been pruned).  

References ipa_argagg_value::by_ref, function::decl, gcc_assert, cgraph_node::get(), ipa_argagg_value_list::get_elt(), ipcp_transformation::get_param_index(), ipcp_get_transformation_summary(), ipa_argagg_value::killed, ipcp_transformation::m_agg_values, ipa_func_body_info::node, NULL_TREE, tree_to_poly_int64(), TREE_TYPE, TYPE_SIZE, and ipa_argagg_value::value.

Referenced by vn_reference_lookup_2().

◆ ipcp_get_parm_bits()

◆ ipcp_get_transformation_summary()

◆ ipcp_read_transformation_summaries()

void ipcp_read_transformation_summaries ( void )

◆ ipcp_transform_function()

◆ ipcp_transformation_initialize()

void ipcp_transformation_initialize ( void )
Initialize IPA CP transformation summary and also allocate any necessary hash
tables if they do not already exist.   

References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), ipcp_transformation_t::create_ggc(), ipa_vr_hash_table, ipcp_transformation_sum, NULL, and symtab.

Referenced by ipa_set_node_agg_value_chain(), ipcp_store_vr_results(), and read_ipcp_transformation_info().

◆ ipcp_verify_propagated_values()

void ipcp_verify_propagated_values ( void )
If checking is enabled, verify that no lattice is in the TOP state, i.e. not
bottom, not containing a variable component and without any known value at
the same time.   

References ipcp_lattice< valtype >::bottom, ipcp_lattice< valtype >::contains_variable, count, symtab_node::decl, symbol_table::dump(), dump_file, FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, gcc_unreachable, i, ipa_get_param_count(), ipa_get_scalar_lat(), ipa_node_params_sum, opt_for_fn, print_all_lattices(), symtab, and ipcp_lattice< valtype >::values_count.

Referenced by ipcp_propagate_stage().

◆ ipcp_write_transformation_summaries()

◆ unadjusted_ptr_and_unit_offset()

bool unadjusted_ptr_and_unit_offset ( tree op,
tree * ret,
poly_int64 * offset_ret )
Walk pointer adjustemnts from OP (such as POINTER_PLUS and ADDR_EXPR)
to find original pointer.  Initialize RET to the pointer which results from
the walk.
If offset is known return true and initialize OFFSET_RET.   

References get_addr_base_and_unit_offset(), get_base_address(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), i, is_gimple_assign(), mem_ref_offset(), offset, ptrdiff_tree_p(), SSA_NAME_DEF_STMT, SSA_NAME_IS_DEFAULT_DEF, TREE_CODE, and TREE_OPERAND.

Variable Documentation

◆ ipa_edge_args_sum

◆ ipa_node_params_sum

ipa_node_params_t* ipa_node_params_sum
extern
Function summary where the parameter infos are actually stored.  
Interprocedural analyses.
   Copyright (C) 2005-2024 Free Software Foundation, Inc.

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/>.   
Function summary where the parameter infos are actually stored.  

Referenced by add_all_node_vals_to_toposort(), adjust_references_in_caller(), analyze_function_body(), calls_same_node_or_its_all_contexts_clone_p(), cgraph_edge_brings_all_agg_vals_for_node(), cgraph_edge_brings_all_scalars_for_node(), cgraph_edge_brings_value_p(), cgraph_edge_brings_value_p(), check_argument_count(), create_specialized_node(), decide_about_value(), decide_whether_version_node(), ipa_edge_args_sum_t::duplicate(), ipa_fn_summary_t::duplicate(), ipa_cached_call_context::duplicate_from(), early_inliner(), ipa_call_context::equal_to(), estimate_calls_size_and_time(), estimate_local_effects(), evaluate_properties_for_edge(), find_aggregate_values_for_callers_subset(), find_more_contexts_for_caller_subset(), find_more_scalar_values_for_callers_subset(), gather_caller_stats(), get_info_about_necessary_edges(), good_cloning_opportunity_p(), has_undead_caller_from_outside_scc_p(), identify_dead_nodes(), initialize_node_lattices(), inline_read_section(), ipa_alloc_node_params(), ipa_analyze_controlled_uses(), ipa_analyze_node(), ipa_check_create_node_params(), ipa_compute_jump_functions_for_edge(), ipa_free_all_node_params(), ipa_initialize_node_params(), ipa_merge_fn_summary_after_inlining(), ipa_note_param_call(), ipa_print_node_params(), ipa_prop_cc_finalize(), ipa_prop_write_jump_functions(), ipa_propagate_indirect_call_infos(), ipa_read_node_info(), ipa_write_node_info(), ipcp_discover_new_direct_edges(), ipcp_propagate_stage(), ipcp_store_vr_results(), ipcp_verify_propagated_values(), ipcp_versionable_function_p(), ipa_icf::sem_function::param_used_p(), pop_node_from_stack(), print_all_lattices(), propagate_aggregate_lattice(), propagate_aggs_across_jump_function(), propagate_bits_across_jump_function(), propagate_constants_across_call(), propagate_constants_topo(), propagate_context_across_jump_function(), propagate_controlled_uses(), propagate_scalar_across_jump_function(), propagate_vr_across_jump_function(), push_agg_values_for_index_from_edge(), push_node_to_stack(), remap_edge_params(), self_recursive_agg_pass_through_p(), self_recursive_pass_through_p(), set_single_call_flag(), spread_undeadness(), update_indirect_edges_after_inlining(), and want_remove_some_param_p().

◆ ipcp_agg_lattice_pool

object_allocator<ipcp_agg_lattice> ipcp_agg_lattice_pool
extern

◆ ipcp_cst_values_pool

object_allocator<ipcp_value<tree> > ipcp_cst_values_pool
extern

◆ ipcp_poly_ctx_values_pool

object_allocator<ipcp_value<ipa_polymorphic_call_context> > ipcp_poly_ctx_values_pool
extern

◆ ipcp_sources_pool

object_allocator<ipcp_value_source<tree> > ipcp_sources_pool
extern

◆ ipcp_transformation_sum