summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 12:44:59 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-09 12:44:59 +0000
commita34701c9dbe56c168a6c80d9368e8ae56d004310 (patch)
tree91e4185562fe3e96b03d4e888f1f1d690759dd6c /gcc/tree-vect-data-refs.c
parentfe52088f5e1a864aaa5bf142106376480ff1fbc4 (diff)
downloadgcc-a34701c9dbe56c168a6c80d9368e8ae56d004310.tar.gz
PR tree-optimization/40071
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Build a ref-all pointer if the original data reference doesn't conflict with the created vector data reference. Fix long line. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index bc18f0272f8..c3570d31948 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2369,9 +2369,20 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
vect_ptr_type = build_pointer_type (vectype);
vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
get_name (base_name));
- /* If any of the data-references in the stmt group does not conflict
- with the created vector data-reference use a ref-all pointer instead. */
- if (STMT_VINFO_DR_GROUP_SIZE (stmt_info) > 1)
+
+ /* Vector types inherit the alias set of their component type by default so
+ we need to use a ref-all pointer if the data reference does not conflict
+ with the created vector data reference because it is not addressable. */
+ if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
+ get_alias_set (DR_REF (dr))))
+ {
+ vect_ptr_type = build_pointer_type_for_mode (vectype, ptr_mode, true);
+ vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
+ get_name (base_name));
+ }
+
+ /* Likewise for any of the data references in the stmt group. */
+ else if (STMT_VINFO_DR_GROUP_SIZE (stmt_info) > 1)
{
gimple orig_stmt = STMT_VINFO_DR_GROUP_FIRST_DR (stmt_info);
do
@@ -2380,10 +2391,11 @@ vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
if (!alias_sets_conflict_p (get_deref_alias_set (vect_ptr),
get_alias_set (lhs)))
{
- vect_ptr_type = build_pointer_type_for_mode (vectype,
- ptr_mode, true);
- vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
- get_name (base_name));
+ vect_ptr_type
+ = build_pointer_type_for_mode (vectype, ptr_mode, true);
+ vect_ptr
+ = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
+ get_name (base_name));
break;
}