GCC Middle and Back End API Reference
tree-ssa-alias.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  pt_solution
class  ao_ref

Enumerations

enum  translate_flags { TR_TRANSLATE , TR_VALUEIZE_AND_DISAMBIGUATE , TR_DISAMBIGUATE }

Functions

void ao_ref_init (ao_ref *, tree)
void ao_ref_init_from_ptr_and_size (ao_ref *, tree, tree)
void ao_ref_init_from_ptr_and_range (ao_ref *, tree, bool, poly_int64, poly_int64, poly_int64)
tree ao_ref_base (ao_ref *)
alias_set_type ao_ref_alias_set (ao_ref *)
alias_set_type ao_ref_base_alias_set (ao_ref *)
tree ao_ref_alias_ptr_type (ao_ref *)
tree ao_ref_base_alias_ptr_type (ao_ref *)
bool ao_ref_alignment (ao_ref *, unsigned int *, unsigned HOST_WIDE_INT *)
bool ptr_deref_may_alias_global_p (tree, bool)
bool ptr_deref_may_alias_auto_p (tree)
bool ptr_derefs_may_alias_p (tree, tree)
bool ptrs_compare_unequal (tree, tree)
bool ref_may_alias_global_p (tree, bool)
bool ref_may_alias_global_p (ao_ref *, bool)
bool refs_may_alias_p (tree, tree, bool=true)
bool refs_may_alias_p_1 (ao_ref *, ao_ref *, bool)
bool refs_anti_dependent_p (tree, tree)
bool refs_output_dependent_p (tree, tree)
bool ref_maybe_used_by_stmt_p (gimple *, tree, bool=true)
bool ref_maybe_used_by_stmt_p (gimple *, ao_ref *, bool=true)
bool stmt_may_clobber_global_p (gimple *, bool)
bool stmt_may_clobber_ref_p (gimple *, tree, bool=true)
bool stmt_may_clobber_ref_p_1 (gimple *, ao_ref *, bool=true)
bool call_may_clobber_ref_p (gcall *, tree, bool=true)
bool call_may_clobber_ref_p_1 (gcall *, ao_ref *, bool=true)
bool stmt_kills_ref_p (gimple *, tree)
bool stmt_kills_ref_p (gimple *, ao_ref *)
bool ref_can_have_store_data_races (tree)
tree get_continuation_for_phi (gphi *, ao_ref *, bool, unsigned int &, bitmap *, bool, void *(*)(ao_ref *, tree, void *, translate_flags *), void *, bool(*)(edge, void *)=nullptr, translate_flags=TR_VALUEIZE_AND_DISAMBIGUATE)
void * walk_non_aliased_vuses (ao_ref *, tree, bool, void *(*)(ao_ref *, tree, void *), void *(*)(ao_ref *, tree, void *, translate_flags *), bool(*)(edge, void *), tree(*)(tree), unsigned &, void *)
int walk_aliased_vdefs (ao_ref *, tree, bool(*)(ao_ref *, tree, void *), void *, bitmap *, bool *function_entry_reached=NULL, unsigned int limit=0)
void dump_alias_info (FILE *)
void debug_alias_info (void)
void dump_points_to_solution (FILE *, struct pt_solution *)
void debug (pt_solution &ref)
void debug (pt_solution *ptr)
void dump_points_to_info_for (FILE *, tree)
void debug_points_to_info_for (tree)
void dump_alias_stats (FILE *)
unsigned int compute_may_aliases (void)
bool pt_solution_empty_p (const pt_solution *)
bool pt_solution_singleton_or_null_p (struct pt_solution *, unsigned *)
bool pt_solution_includes_global (struct pt_solution *, bool)
bool pt_solution_includes_auto (struct pt_solution *)
bool pt_solution_includes (struct pt_solution *, const_tree)
bool pt_solution_includes_const_pool (struct pt_solution *)
bool pt_solutions_intersect (struct pt_solution *, struct pt_solution *)
void pt_solution_reset (struct pt_solution *)
void pt_solution_set (struct pt_solution *, bitmap, bool)
void pt_solution_set_var (struct pt_solution *, tree)
void dump_pta_stats (FILE *)
bool ranges_overlap_p (HOST_WIDE_INT pos1, unsigned HOST_WIDE_INT size1, HOST_WIDE_INT pos2, unsigned HOST_WIDE_INT size2)

Variables

struct pt_solution ipa_escaped_pt

Enumeration Type Documentation

◆ translate_flags

Enumerator
TR_TRANSLATE 
TR_VALUEIZE_AND_DISAMBIGUATE 
TR_DISAMBIGUATE 

Function Documentation

◆ ao_ref_alias_ptr_type()

tree ao_ref_alias_ptr_type ( ao_ref * ref)
extern
Returns a type satisfying
get_deref_alias_set (type) == ao_ref_alias_set (REF).   

References ao_ref_alias_ptr_type(), NULL_TREE, ao_ref::ref, and reference_alias_ptr_type().

Referenced by ao_ref_alias_ptr_type(), ao_compare::compare_ao_refs(), and ipa_icf::sem_function::hash_stmt().

◆ ao_ref_alias_set()

◆ ao_ref_alignment()

bool ao_ref_alignment ( ao_ref * ref,
unsigned int * align,
unsigned HOST_WIDE_INT * bitpos )
extern
Return the alignment of the access *REF and store it in the *ALIGN
and *BITPOS pairs.  Returns false if no alignment could be determined.
See get_object_alignment_2 for details.   

References ptr_info_def::align, ao_ref_alignment(), ao_ref::base, get_object_alignment_1(), get_object_alignment_2(), poly_int< N, C >::is_constant(), ao_ref::offset, and ao_ref::ref.

Referenced by ao_ref_alignment(), and compute_trims().

◆ ao_ref_base()

◆ ao_ref_base_alias_ptr_type()

tree ao_ref_base_alias_ptr_type ( ao_ref * ref)
extern
Returns a type satisfying
get_deref_alias_set (type) == ao_ref_base_alias_set (REF).   

References ao_ref_base_alias_ptr_type(), handled_component_p(), NULL_TREE, ao_ref::ref, reference_alias_ptr_type(), TREE_CODE, and TREE_OPERAND.

Referenced by ao_ref_base_alias_ptr_type(), ao_compare::compare_ao_refs(), and ipa_icf::sem_function::hash_stmt().

◆ ao_ref_base_alias_set()

◆ ao_ref_init()

void ao_ref_init ( ao_ref * r,
tree ref )
extern
In tree-ssa-alias.cc   
Initializes the alias-oracle reference representation *R from REF.   

References ao_ref_init(), NULL_TREE, r, and TREE_THIS_VOLATILE.

Referenced by ao_ref_from_mem(), ao_ref_init(), call_may_clobber_ref_p(), can_handle_load(), ipa_icf_gimple::func_checker::compare_operand(), compute_avail(), cond_if_else_store_replacement_limited(), detect_type_change_from_memory_writes(), determine_known_aggregate_parts(), do_simple_agr_dse(), dse_classify_store(), dse_optimize_redundant_stores(), eliminate_dom_walker::eliminate_stmt(), pcom_worker::find_looparound_phi(), gather_mem_refs_stmt(), ipa_polymorphic_call_context::get_dynamic_type(), ipa_icf::sem_function::hash_stmt(), ifcvt_local_dce(), initialize_ao_ref_for_dse(), mark_aliased_reaching_defs_necessary(), mem_ref_alloc(), oacc_entry_exit_ok_1(), optimize_aggr_zeroprop(), param_change_prob(), parm_preserved_before_stmt_p(), parm_ref_data_preserved_p(), ref_maybe_used_by_call_p_1(), ref_maybe_used_by_stmt_p(), refs_anti_dependent_p(), refs_may_alias_p(), refs_may_alias_p(), refs_output_dependent_p(), refs_same_for_tbaa_p(), statement_sink_location(), stmt_kills_ref_p(), stmt_may_clobber_ref_p(), stmt_may_clobber_ref_p_1(), unmodified_parm_1(), vect_slp_analyze_load_dependences(), vect_slp_analyze_store_dependences(), visit_reference_op_call(), visit_reference_op_store(), vn_reference_insert(), vn_reference_lookup(), vn_reference_lookup_3(), vn_walk_cb_data::vn_walk_cb_data(), vuse_semi_invariant_p(), and warn_uninitialized_vars().

◆ ao_ref_init_from_ptr_and_range()

void ao_ref_init_from_ptr_and_range ( ao_ref * ref,
tree ptr,
bool range_known,
poly_int64 offset,
poly_int64 size,
poly_int64 max_size )
extern

◆ ao_ref_init_from_ptr_and_size()

void ao_ref_init_from_ptr_and_size ( ao_ref * ref,
tree ptr,
tree size )
extern

◆ call_may_clobber_ref_p()

bool call_may_clobber_ref_p ( gcall * call,
tree ref,
bool tbaa_p )
extern
If the call in statement CALL may clobber the memory reference REF
return true, otherwise return false.   

References alias_stats, ao_ref_init(), call_may_clobber_ref_p(), call_may_clobber_ref_p_1(), and r.

Referenced by call_may_clobber_ref_p(), dest_safe_for_nrv_p(), and find_tail_calls().

◆ call_may_clobber_ref_p_1()

◆ compute_may_aliases()

unsigned int compute_may_aliases ( void )
extern
In tree-ssa-structalias.cc   
Compute points-to information for every SSA_NAME pointer in the
current function and compute the transitive closure of escaped
variables to re-initialize the call-clobber states of local variables.   

References cfun, compute_dependence_clique(), compute_may_aliases(), compute_points_to_sets(), delete_points_to_sets(), dump_alias_info(), dump_file, dump_flags, gcc_assert, need_ssa_update_p(), TDF_ALIAS, and TDF_DETAILS.

Referenced by compute_may_aliases(), execute_function_todo(), and walk_non_aliased_vuses().

◆ debug() [1/2]

void debug ( pt_solution & ref)
extern
Unified dump function for pt_solution.   

References debug, and dump_points_to_solution().

◆ debug() [2/2]

void debug ( pt_solution * ptr)
extern

References debug.

◆ debug_alias_info()

void debug_alias_info ( void )
extern
Dump alias information on stderr.   

References debug_alias_info(), and dump_alias_info().

Referenced by debug_alias_info(), and walk_non_aliased_vuses().

◆ debug_points_to_info_for()

void debug_points_to_info_for ( tree var)
extern
Dump points-to information for VAR into stderr.   

References debug_points_to_info_for(), and dump_points_to_info_for().

Referenced by debug_points_to_info_for(), and walk_non_aliased_vuses().

◆ dump_alias_info()

◆ dump_alias_stats()

◆ dump_points_to_info_for()

void dump_points_to_info_for ( FILE * file,
tree ptr )
extern

◆ dump_points_to_solution()

◆ dump_pta_stats()

void dump_pta_stats ( FILE * s)
extern

◆ get_continuation_for_phi()

tree get_continuation_for_phi ( gphi * ,
ao_ref * ,
bool ,
unsigned int & ,
bitmap * ,
bool ,
void * *)(ao_ref *, tree, void *, translate_flags *,
void * ,
bool(*  )(edge, void *) = nullptr,
translate_flags = TR_VALUEIZE_AND_DISAMBIGUATE )
extern

◆ pt_solution_empty_p()

◆ pt_solution_includes()

◆ pt_solution_includes_auto()

bool pt_solution_includes_auto ( struct pt_solution * pt)
extern

◆ pt_solution_includes_const_pool()

bool pt_solution_includes_const_pool ( struct pt_solution * pt)
extern

◆ pt_solution_includes_global()

bool pt_solution_includes_global ( struct pt_solution * pt,
bool escaped_local_p )
extern

◆ pt_solution_reset()

void pt_solution_reset ( struct pt_solution * pt)
extern

◆ pt_solution_set()

void pt_solution_set ( struct pt_solution * pt,
bitmap vars,
bool vars_contains_nonlocal )
extern
Set the points-to solution *PT to point only to the variables
in VARS.  VARS_CONTAINS_GLOBAL specifies whether that contains
global variables and VARS_CONTAINS_RESTRICT specifies whether
it contains restrict tag variables.   

References bitmap_intersect_p(), cfun, pt_solution_set(), pt_solution::vars, pt_solution::vars_contains_escaped, and pt_solution::vars_contains_nonlocal.

Referenced by pt_solution_set(), update_alias_info_with_stack_vars(), and walk_non_aliased_vuses().

◆ pt_solution_set_var()

◆ pt_solution_singleton_or_null_p()

bool pt_solution_singleton_or_null_p ( struct pt_solution * pt,
unsigned * uid )
extern

◆ pt_solutions_intersect()

◆ ptr_deref_may_alias_auto_p()

bool ptr_deref_may_alias_auto_p ( tree ptr)
extern
Return true, if dereferencing PTR may alias with a local automatic
variable.   

References POINTER_TYPE_P, ptr_info_def::pt, pt_solution_includes_auto(), ptr_deref_may_alias_auto_p(), SSA_NAME_PTR_INFO, TREE_CODE, and TREE_TYPE.

Referenced by ptr_deref_may_alias_auto_p().

◆ ptr_deref_may_alias_global_p()

bool ptr_deref_may_alias_global_p ( tree ptr,
bool escaped_local_p )
extern
Return true, if dereferencing PTR may alias with a global variable.
When ESCAPED_LOCAL_P is true escaped local memory is also considered
global.   

References POINTER_TYPE_P, ptr_info_def::pt, pt_solution_includes_global(), ptr_deref_may_alias_global_p(), SSA_NAME_PTR_INFO, TREE_CODE, and TREE_TYPE.

Referenced by points_to_local_or_readonly_memory_p(), ptr_deref_may_alias_global_p(), ref_may_alias_global_p_1(), ref_maybe_used_by_stmt_p(), and thread_private_new_memory().

◆ ptr_derefs_may_alias_p()

bool ptr_derefs_may_alias_p ( tree ptr1,
tree ptr2 )
extern
Return true if dereferenced PTR1 and PTR2 may alias.
The caller is responsible for applying TBAA to see if accesses
through PTR1 and PTR2 may conflict at all.   

References CONSTANT_CLASS_P, DECL_P, get_base_address(), POINTER_TYPE_P, ptr_info_def::pt, pt_solutions_intersect(), ptr_deref_may_alias_decl_p(), ptr_derefs_may_alias_p(), SSA_NAME_PTR_INFO, STRIP_NOPS, TREE_CODE, TREE_OPERAND, and TREE_TYPE.

Referenced by dr_may_alias_p(), generate_memcpy_builtin(), indirect_refs_may_alias_p(), ptr_deref_may_alias_ref_p_1(), and ptr_derefs_may_alias_p().

◆ ptrs_compare_unequal()

◆ ranges_overlap_p()

bool ranges_overlap_p ( HOST_WIDE_INT pos1,
unsigned HOST_WIDE_INT size1,
HOST_WIDE_INT pos2,
unsigned HOST_WIDE_INT size2 )
inline
Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
overlap.  SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
range is open-ended.  Otherwise return false.   

References ranges_overlap_p().

Referenced by do_structure_copy(), ranges_overlap_p(), and vect_slp_analyze_instance_dependence().

◆ ref_can_have_store_data_races()

bool ref_can_have_store_data_races ( tree ref)
extern

◆ ref_may_alias_global_p() [1/2]

◆ ref_may_alias_global_p() [2/2]

bool ref_may_alias_global_p ( tree ref,
bool escaped_local_p )
extern

◆ ref_maybe_used_by_stmt_p() [1/2]

◆ ref_maybe_used_by_stmt_p() [2/2]

bool ref_maybe_used_by_stmt_p ( gimple * stmt,
tree ref,
bool tbaa_p = true )
extern

◆ refs_anti_dependent_p()

bool refs_anti_dependent_p ( tree load,
tree store )
extern
Returns true if there is a anti-dependence for the STORE that
executes after the LOAD.   

References ao_ref_init(), refs_anti_dependent_p(), and refs_may_alias_p_1().

Referenced by dr_may_alias_p(), and refs_anti_dependent_p().

◆ refs_may_alias_p()

◆ refs_may_alias_p_1()

◆ refs_output_dependent_p()

bool refs_output_dependent_p ( tree store1,
tree store2 )
extern
Returns true if there is a output dependence for the stores
STORE1 and STORE2.   

References ao_ref_init(), refs_may_alias_p_1(), and refs_output_dependent_p().

Referenced by dr_may_alias_p(), and refs_output_dependent_p().

◆ stmt_kills_ref_p() [1/2]

◆ stmt_kills_ref_p() [2/2]

bool stmt_kills_ref_p ( gimple * stmt,
tree ref )
extern

References ao_ref_init(), r, and stmt_kills_ref_p().

◆ stmt_may_clobber_global_p()

bool stmt_may_clobber_global_p ( gimple * stmt,
bool escaped_local_p )
extern
Return true whether STMT may clobber global memory.
When ESCAPED_LOCAL_P is true escaped local memory is also considered
global.   

References gimple_assign_lhs(), gimple_vdef(), ref_may_alias_global_p(), stmt_may_clobber_global_p(), and TREE_CODE.

Referenced by mark_stmt_if_obviously_necessary(), and stmt_may_clobber_global_p().

◆ stmt_may_clobber_ref_p()

◆ stmt_may_clobber_ref_p_1()

◆ walk_aliased_vdefs()

◆ walk_non_aliased_vuses()

Variable Documentation

◆ ipa_escaped_pt