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

Go to the source code of this file.


#define ALIAS_SET_MEMORY_BARRIER   ((alias_set_type) -1)


alias_set_type new_alias_set (void)
alias_set_type get_alias_set (tree)
alias_set_type get_deref_alias_set (tree)
alias_set_type get_varargs_alias_set (void)
alias_set_type get_frame_alias_set (void)
tree component_uses_parent_alias_set_from (const_tree)
bool ends_tbaa_access_path_p (const_tree)
bool alias_set_subset_of (alias_set_type, alias_set_type)
void record_alias_subset (alias_set_type, alias_set_type)
void record_component_aliases (tree)
bool alias_sets_conflict_p (alias_set_type, alias_set_type)
bool alias_sets_must_conflict_p (alias_set_type, alias_set_type)
bool objects_must_conflict_p (tree, tree)
bool nonoverlapping_memrefs_p (const_rtx, const_rtx, bool)
void dump_alias_stats_in_alias_c (FILE *s)
tree reference_alias_ptr_type (tree)
tree reference_alias_ptr_type_1 (tree *)
bool alias_ptr_types_compatible_p (tree, tree)
int compare_base_decls (tree, tree)
bool refs_same_for_tbaa_p (tree, tree)
bool mems_same_for_tbaa_p (rtx, rtx)
bool view_converted_memref_p (tree)

Macro Definition Documentation


#define ALIAS_SET_MEMORY_BARRIER   ((alias_set_type) -1)
This alias set can be used to force a memory to conflict with all
other memories, creating a barrier across which no memory reference
can move.  Note that there are other legacy ways to create such
memory barriers, including an address of SCRATCH.   

Referenced by check_mem_read_rtx(), get_builtin_sync_mem(), may_alias_p(), read_dependence(), true_dependence_1(), and write_dependence_p().

Function Documentation

◆ alias_ptr_types_compatible_p()

bool alias_ptr_types_compatible_p ( tree t1,
tree t2 )
Return whether the pointer-types T1 and T2 used to determine
two alias sets of two references will yield the same answer
from get_deref_alias_set.   

References get_deref_alias_set(), ref_all_alias_ptr_type_p(), TREE_TYPE, and TYPE_MAIN_VARIANT.

Referenced by ao_compare::compare_ao_refs(), and operand_compare::operand_equal_p().

◆ alias_set_subset_of()

◆ alias_sets_conflict_p()

◆ alias_sets_must_conflict_p()

bool alias_sets_must_conflict_p ( alias_set_type set1,
alias_set_type set2 )
Return true if the two specified alias sets will always conflict.   

References alias_stats.

Referenced by alias_sets_conflict_p(), and objects_must_conflict_p().

◆ compare_base_decls()

int compare_base_decls ( tree base1,
tree base2 )
BASE1 and BASE2 are decls.  Return 1 if they refer to same object, 0
if they refer to different objects and -1 if we cannot decide.   

References DECL_ASSEMBLER_NAME_RAW, DECL_ASSEMBLER_NAME_SET_P, DECL_HARD_REGISTER, decl_in_symtab_p(), DECL_P, symtab_node::equal_address_to(), gcc_checking_assert, symtab_node::get(), and VAR_P.

Referenced by compare_base_symbol_refs(), decl_refs_may_alias_p(), nonoverlapping_memrefs_p(), and ptr_deref_may_alias_decl_p().

◆ component_uses_parent_alias_set_from()

tree component_uses_parent_alias_set_from ( const_tree t)
Return the outermost parent of component present in the chain of
component references handled by get_inner_reference in T with the
following property:
  - the component is non-addressable
or NULL_TREE if no such parent exists.  In the former cases, the alias
set of this parent is the alias set that must be used for T itself.   

References ends_tbaa_access_path_p(), handled_component_p(), NULL_TREE, and TREE_OPERAND.

Referenced by reference_alias_ptr_type_1(), and set_mem_attributes_minus_bitpos().

◆ dump_alias_stats_in_alias_c()

void dump_alias_stats_in_alias_c ( FILE * s)

References alias_stats.

Referenced by dump_alias_stats().

◆ ends_tbaa_access_path_p()

bool ends_tbaa_access_path_p ( const_tree t)

◆ get_alias_set()

alias_set_type get_alias_set ( tree t)
Return the alias set for T, which may be either a type or an
expression.  Call language-specific routine for help, if needed.   

References AGGREGATE_TYPE_P, build_pointer_type(), build_reference_type(), canonical_type_used_p(), COMPLETE_TYPE_P, DECL_RTL, DECL_RTL_SET_P, error_mark_node, gcc_checking_assert, get_alias_set(), lang_hooks::get_alias_set, get_alias_set_entry(), get_deref_alias_set(), alias_set_entry::has_pointer, init_alias_set_entry(), alias_set_entry::is_pointer, MEM_ALIAS_SET, MEM_P, new_alias_set(), NULL, odr_type_p(), POINTER_TYPE_P, prevailing_odr_type(), ptr_type_node, record_component_aliases(), reference_alias_ptr_type_1(), STRIP_NOPS, TREE_CODE, TREE_TYPE, TYPE_ALIAS_SET, TYPE_ALIAS_SET_KNOWN_P, TYPE_CANONICAL, TYPE_MAIN_VARIANT, TYPE_NONALIASED_COMPONENT, TYPE_P, TYPE_STRUCTURAL_EQUALITY_P, TYPE_TYPELESS_STORAGE, type_with_alias_set_p(), and VAR_P.

Referenced by ao_ref_alias_set(), ao_ref_base_alias_set(), assign_stack_temp_for_type(), check_scan_store(), dr_may_alias_p(), dump_lto_records(), expand_assignment(), expand_builtin_va_copy(), get_alias_set(), get_deref_alias_set(), ipa_polymorphic_call_context::get_dynamic_type(), get_group_alias_ptr_type(), gimple_get_alias_set(), gimplify_init_constructor(), gimplify_init_ctor_preeval_1(), make_bit_field_ref(), objects_must_conflict_p(), record_component_aliases(), record_component_aliases(), safe_from_p(), same_type_for_tbaa(), set_mem_attributes_minus_bitpos(), store_constructor(), vect_analyze_data_ref_dependence(), vect_create_data_ref_ptr(), vectorizable_load(), and vectorizable_store().

◆ get_deref_alias_set()

alias_set_type get_deref_alias_set ( tree t)
Return the alias set for the memory pointed to by T, which may be
either a type or an expression.   

References get_alias_set(), get_deref_alias_set_1(), TREE_TYPE, and TYPE_P.

Referenced by alias_ptr_types_compatible_p(), call_may_clobber_ref_p_1(), get_alias_set(), ipa_icf::sem_item_optimizer::read_section(), ref_maybe_used_by_call_p_1(), and vn_reference_lookup_3().

◆ get_frame_alias_set()

alias_set_type get_frame_alias_set ( void )

◆ get_varargs_alias_set()

alias_set_type get_varargs_alias_set ( void )

References new_alias_set(), and varargs_set.

◆ mems_same_for_tbaa_p()

bool mems_same_for_tbaa_p ( rtx earlier,
rtx later )
Similar to refs_same_for_tbaa_p() but for use on MEM rtxs.   

References alias_set_subset_of(), gcc_assert, MEM_ALIAS_SET, MEM_EXPR, MEM_P, and refs_same_for_tbaa_p().

Referenced by cselib_redundant_set_p(), record_store(), and store_expr().

◆ new_alias_set()

alias_set_type new_alias_set ( void )
Exported functions from alias.cc
   Copyright (C) 2004-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

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
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
Return a brand-new alias set.   

References alias_sets, NULL, and vec_safe_push().

Referenced by asan_init_shadow_ptr_types(), expand_builtin_longjmp(), expand_builtin_setjmp_setup(), get_alias_set(), get_frame_alias_set(), get_spill_slot_decl(), get_varargs_alias_set(), and rt_bb_visited::rt_bb_visited().

◆ nonoverlapping_memrefs_p()

bool nonoverlapping_memrefs_p ( const_rtx x,
const_rtx y,
bool loop_invariant )

◆ objects_must_conflict_p()

bool objects_must_conflict_p ( tree t1,
tree t2 )
Return true if any MEM object of type T1 will always conflict (using the
dependency routines in this file) with any MEM object of type T2.
This is used when allocating temporary storage.  If T1 and/or T2 are
NULL_TREE, it means we know nothing about the storage.   

References alias_sets_must_conflict_p(), alias_stats, get_alias_set(), and TYPE_VOLATILE.

Referenced by assign_stack_temp_for_type().

◆ record_alias_subset()

void record_alias_subset ( alias_set_type superset,
alias_set_type subset )
Indicate that things in SUBSET can alias things in SUPERSET, but that
not everything that aliases SUPERSET also aliases SUBSET.  For example,
in C, a store to an `int' can alias a load of a structure containing an
`int', and vice versa.  But it can't alias a load of a 'double' member
of the same structure.  Here, the structure would be the SUPERSET and
`int' the SUBSET.  This relationship is also described in the comment at
the beginning of this file.

This function should be called only once per SUPERSET/SUBSET pair.

It is illegal for SUPERSET to be zero; everything is implicitly a
subset of alias set zero.   

References hash_map< KeyId, Value, Traits >::begin(), alias_set_entry::children, hash_map< KeyId, Value, Traits >::create_ggc(), hash_map< KeyId, Value, Traits >::end(), gcc_assert, get_alias_set_entry(), alias_set_entry::has_pointer, alias_set_entry::has_zero_child, init_alias_set_entry(), and hash_map< KeyId, Value, Traits >::put().

Referenced by record_component_aliases().

◆ record_component_aliases()

void record_component_aliases ( tree type)
Record that component types of TYPE, if any, are part of that type for
aliasing purposes.  For record types, we only record component types
for fields that are not marked non-addressable.  For array types, we
only record the component type if it is not marked non-aliased.   

References get_alias_set(), and record_component_aliases().

◆ reference_alias_ptr_type()

◆ reference_alias_ptr_type_1()

tree reference_alias_ptr_type_1 ( tree * t)
Return the pointer-type relevant for TBAA purposes from the
memory reference tree *T or NULL_TREE in which case *T is
adjusted to point to the outermost component reference that
can be used for assigning an alias set.   

References component_uses_parent_alias_set_from(), handled_component_p(), INDIRECT_REF_P, NULL_TREE, ref_all_alias_ptr_type_p(), TMR_OFFSET, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_MAIN_VARIANT, and view_converted_memref_p().

Referenced by get_alias_set(), and reference_alias_ptr_type().

◆ refs_same_for_tbaa_p()

bool refs_same_for_tbaa_p ( tree earlier,
tree later )
Return true if the ref EARLIER behaves the same as LATER with respect
to TBAA for every memory reference that might follow LATER.   

References alias_set_subset_of(), ao_ref_alias_set(), ao_ref_base_alias_set(), and ao_ref_init().

Referenced by cse_insn(), mems_same_for_tbaa_p(), and dom_opt_dom_walker::optimize_stmt().

◆ view_converted_memref_p()

bool view_converted_memref_p ( tree base)
Return true if access with BASE is view converted.
Base must not be stripped from inner MEM_REF (&decl)
which is done by ao_ref_base and thus one extra walk
of handled components is needed.   

References same_type_for_tbaa(), TREE_CODE, TREE_OPERAND, and TREE_TYPE.

Referenced by ao_compare::compare_ao_refs(), and reference_alias_ptr_type_1().