diff options
author | Keith Besaw <kbesaw@us.ibm.com> | 2005-05-29 13:14:42 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit@gcc.gnu.org> | 2005-05-29 13:14:42 +0000 |
commit | 9cf5a7e38d9098ce4961b091f70c40e8eb287e65 (patch) | |
tree | e9e4e7917523b632ed676b411c41a27546c3875b /gcc/tree-ssa-alias.c | |
parent | 6778b96ce1fa7ca57bb6d95fb40e769abd02734b (diff) | |
download | gcc-9cf5a7e38d9098ce4961b091f70c40e8eb287e65.tar.gz |
tree-ssa-alias.c (new_type_alias): New procedure to create a type memory tag for a pointer with a may-alias set...
2005-05-29 Keith Besaw <kbesaw@us.ibm.com>
* tree-ssa-alias.c (new_type_alias): New procedure to
create a type memory tag for a pointer with a may-alias
set determined from a variable declaration.
* tree-flow.h: export declaration of new_type_alias
* tree-optimize.c (init_tree_optimization_passes): document
that pass_may_alias cannot be called after pass_vectorize.
* tree-vect-transform (vect_create_data_ref_ptr): Call
new_type_alias when an type memory tag isn't available
for a reference.
(vectorizable_store): Use copy_virtual_operands to update
virtual defs in place (so that loop_version can be called).
Call mark_for_renaming for the virtual defs in case peeling
is done and virtual uses outside the loop need to be updated.
From-SVN: r100322
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 2ed712bea70..f8b992accd6 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2776,6 +2776,39 @@ found_tag: } +/* Create a type tag for PTR. Construct the may-alias list of this type tag + so that it has the aliasing of VAR. */ + +void +new_type_alias (tree ptr, tree var) +{ + var_ann_t p_ann = var_ann (ptr); + tree tag_type = TREE_TYPE (TREE_TYPE (ptr)); + var_ann_t v_ann = var_ann (var); + tree tag; + subvar_t svars; + + gcc_assert (p_ann->type_mem_tag == NULL_TREE); + gcc_assert (v_ann->mem_tag_kind == NOT_A_TAG); + tag = create_memory_tag (tag_type, true); + p_ann->type_mem_tag = tag; + + /* Add VAR to the may-alias set of PTR's new type tag. If VAR has + subvars, add the subvars to the tag instead of the actual var. */ + if (var_can_have_subvars (var) + && (svars = get_subvars_for_var (var))) + { + subvar_t sv; + for (sv = svars; sv; sv = sv->next) + add_may_alias (tag, sv->var); + } + else + add_may_alias (tag, var); + + /* Note, TAG and its set of aliases are not marked for renaming. */ +} + + /* This structure is simply used during pushing fields onto the fieldstack to track the offset of the field, since bitpos_of_field gives it relative to its immediate containing type, and we want it relative to the ultimate |