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_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 (gimple *, ao_ref *, bool, unsigned int &, bitmap *, bool, void *(*)(ao_ref *, tree, void *, translate_flags *), void *, 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 *), 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 (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 NULL_TREE, ao_ref::ref, and reference_alias_ptr_type().

Referenced by 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::base, get_object_alignment_1(), get_object_alignment_2(), poly_int< N, C >::is_constant(), ao_ref::offset, offset, and ao_ref::ref.

Referenced by 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 handled_component_p(), NULL_TREE, ao_ref::ref, reference_alias_ptr_type(), TREE_CODE, and TREE_OPERAND.

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

◆ ao_ref_base_alias_set()

◆ ao_ref_init()

◆ 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
Init an alias-oracle reference representation from a gimple pointer
PTR a range specified by OFFSET, SIZE and MAX_SIZE under the assumption
that RANGE_KNOWN is set.

The access is assumed to be only to or after of the pointer target adjusted
by the offset, not before it (even in the case RANGE_KNOWN is false).   

References ao_ref::base, ao_ref::base_alias_set, build2(), char_type_node, gcc_assert, get_addr_base_and_unit_offset(), get_base_address(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_assign_single_p(), is_gimple_assign(), ao_ref::max_size, null_pointer_node, NULL_TREE, ao_ref::offset, offset, POINTER_TYPE_P, ptrdiff_tree_p(), ao_ref::ref, ao_ref::ref_alias_set, ao_ref::size, SSA_NAME_DEF_STMT, TREE_CODE, TREE_OPERAND, TREE_TYPE, and ao_ref::volatile_p.

Referenced by ao_ref_init_from_ptr_and_size(), check_fnspec(), and modref_access_node::get_ao_ref().

◆ ao_ref_init_from_ptr_and_size()

void ao_ref_init_from_ptr_and_size ( ao_ref * ref,
tree ptr,
tree size )
extern
Init an alias-oracle reference representation from a gimple pointer
PTR and a gimple size SIZE in bytes.  If SIZE is NULL_TREE then the
size is assumed to be unknown.  The access is assumed to be only
to or after of the pointer target, not before it.   

References ao_ref_init_from_ptr_and_range(), coeffs_in_range_p(), HOST_WIDE_INT_MAX, and poly_int_tree_p().

Referenced by call_may_clobber_ref_p_1(), determine_known_aggregate_parts(), ipa_polymorphic_call_context::get_dynamic_type(), gimple_fold_builtin_memory_op(), initialize_ao_ref_for_dse(), maybe_invalidate(), maybe_warn_pass_by_reference(), parm_ref_data_pass_through_p(), ref_maybe_used_by_call_p_1(), stmt_kills_ref_p(), and vn_reference_lookup_3().

◆ 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_1(), and r.

Referenced by 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_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 execute_function_todo().

◆ debug() [1/2]

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

References 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 dump_alias_info().

◆ debug_points_to_info_for()

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

References dump_points_to_info_for().

◆ dump_alias_info()

◆ dump_alias_stats()

void dump_alias_stats ( FILE * s)
extern

◆ dump_points_to_info_for()

void dump_points_to_info_for ( FILE * file,
tree ptr )
extern
Dump points-to information for SSA_NAME PTR into FILE.   

References dump_flags, dump_points_to_solution(), print_generic_expr(), ptr_info_def::pt, and SSA_NAME_PTR_INFO.

Referenced by debug_points_to_info_for(), dump_alias_info(), and dump_variable().

◆ dump_points_to_solution()

◆ dump_pta_stats()

void dump_pta_stats ( FILE * s)
extern

References HOST_WIDE_INT_PRINT_DEC, and pta_stats.

Referenced by dump_memory_report().

◆ get_continuation_for_phi()

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

◆ pt_solution_empty_p()

◆ pt_solution_includes()

◆ pt_solution_includes_const_pool()

bool pt_solution_includes_const_pool ( struct pt_solution * pt)
extern
Return true if the points-to solution *PT contains a reference to a
constant pool entry.   

References cfun, pt_solution::const_pool, pt_solution::escaped, pt_solution::ipa_escaped, ipa_escaped_pt, and pt_solution::nonlocal.

Referenced by ptrs_compare_unequal().

◆ pt_solution_includes_global()

bool pt_solution_includes_global ( struct pt_solution * pt,
bool escaped_local_p )
extern
Return true if the points-to solution *PT includes global memory.
If ESCAPED_LOCAL_P is true then escaped local variables are also
considered global.   

References pt_solution::anything, cfun, pt_solution::escaped, pt_solution::ipa_escaped, ipa_escaped_pt, pt_solution::nonlocal, pt_solution_includes_global(), pt_solution::vars_contains_escaped, pt_solution::vars_contains_escaped_heap, and pt_solution::vars_contains_nonlocal.

Referenced by pt_solution_includes_global(), and ptr_deref_may_alias_global_p().

◆ pt_solution_reset()

void pt_solution_reset ( struct pt_solution * pt)
extern
Reset the points-to solution *PT to a conservative default
(point to anything).   

References pt_solution::anything, and pt_solution::null.

Referenced by delete_tree_ssa(), expand_call_inline(), get_ptr_info(), gimple_call_reset_alias_info(), init_tree_ssa(), ipa_pta_execute(), parallelize_loops(), and pt_solution_ior_into().

◆ 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::vars, pt_solution::vars_contains_escaped, and pt_solution::vars_contains_nonlocal.

Referenced by update_alias_info_with_stack_vars().

◆ pt_solution_set_var()

void pt_solution_set_var ( struct pt_solution * pt,
tree var )
extern
Set the points-to solution *PT to point only to the variable VAR.   

References bitmap_bit_p, BITMAP_GGC_ALLOC, bitmap_set_bit, cfun, DECL_PT_UID, is_global_var(), pt_solution::vars, pt_solution::vars_contains_escaped, and pt_solution::vars_contains_nonlocal.

Referenced by copy_ref_info().

◆ pt_solution_singleton_or_null_p()

bool pt_solution_singleton_or_null_p ( struct pt_solution * pt,
unsigned * uid )
extern
Return true if the points-to solution *PT only point to a single var, and
return the var uid in *UID.   

References pt_solution::anything, bitmap_first_set_bit(), bitmap_single_bit_set_p(), pt_solution::escaped, pt_solution::ipa_escaped, pt_solution::nonlocal, NULL, and pt_solution::vars.

Referenced by fold_builtin_alloca_with_align(), and same_addr_size_stores_p().

◆ pt_solutions_intersect()

bool pt_solutions_intersect ( struct pt_solution * pt1,
struct pt_solution * pt2 )
extern

◆ 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 ptr_info_def::pt, pt_solution_includes_global(), SSA_NAME_PTR_INFO, and TREE_CODE.

Referenced by points_to_local_or_readonly_memory_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.   

◆ ref_can_have_store_data_races()

bool ref_can_have_store_data_races ( tree ref)
extern
Return whether REF can be subject to store data races.   

References auto_var_p(), get_base_address(), and may_be_aliased().

Referenced by cond_store_replacement(), execute_sm(), and ifcvt_memrefs_wont_trap().

◆ ref_may_alias_global_p() [1/2]

bool ref_may_alias_global_p ( ao_ref * ref,
bool escaped_local_p )
extern

◆ 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(), and refs_may_alias_p_1().

Referenced by dr_may_alias_p().

◆ refs_may_alias_p()

bool refs_may_alias_p ( tree ref1,
tree ref2,
bool tbaa_p = true )
extern

◆ 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(), and refs_may_alias_p_1().

Referenced by dr_may_alias_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(), and TREE_CODE.

Referenced by mark_stmt_if_obviously_necessary().

◆ stmt_may_clobber_ref_p()

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

◆ stmt_may_clobber_ref_p_1()

◆ walk_aliased_vdefs()

◆ walk_non_aliased_vuses()

void * walk_non_aliased_vuses ( ao_ref * ,
tree ,
bool ,
void * *)(ao_ref *, tree, void *,
void * *)(ao_ref *, tree, void *, translate_flags *,
tree(*  )(tree),
unsigned & ,
void *  )
extern

Variable Documentation

◆ ipa_escaped_pt