aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-05-03 11:01:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-05-03 11:01:06 +0000
commit49ab46214e9288ee1268f87ddcd64dacfd21c31d (patch)
tree49ac386194b21f2505e28121e490f1735948196b /gcc/tree-vect-data-refs.c
parent8d5f521a5c09313c5c01005a69440f21bc80bc97 (diff)
downloadgcc-49ab46214e9288ee1268f87ddcd64dacfd21c31d.zip
gcc-49ab46214e9288ee1268f87ddcd64dacfd21c31d.tar.gz
gcc-49ab46214e9288ee1268f87ddcd64dacfd21c31d.tar.bz2
tree-vect-data-refs.c (vect_enhance_data_refs_alignment): When all DRs have unknown misaligned do not always peel when...
2017-05-03 Richard Biener <rguenther@suse.de> * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): When all DRs have unknown misaligned do not always peel when there is a store but apply the same costing model as if there were only loads. * gcc.dg/vect/costmodel/x86_64/costmodel-alignpeel.c: New testcase. From-SVN: r247544
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index aa504b6..c974268 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1715,18 +1715,18 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
dr0 = first_store;
}
- /* In case there are only loads with different unknown misalignments, use
- peeling only if it may help to align other accesses in the loop or
+ /* Use peeling only if it may help to align other accesses in the loop or
if it may help improving load bandwith when we'd end up using
unaligned loads. */
tree dr0_vt = STMT_VINFO_VECTYPE (vinfo_for_stmt (DR_STMT (dr0)));
- if (!first_store
- && !STMT_VINFO_SAME_ALIGN_REFS (
- vinfo_for_stmt (DR_STMT (dr0))).length ()
+ if (STMT_VINFO_SAME_ALIGN_REFS
+ (vinfo_for_stmt (DR_STMT (dr0))).length () == 0
&& (vect_supportable_dr_alignment (dr0, false)
!= dr_unaligned_supported
- || (builtin_vectorization_cost (vector_load, dr0_vt, 0)
- == builtin_vectorization_cost (unaligned_load, dr0_vt, -1))))
+ || (DR_IS_READ (dr0)
+ && (builtin_vectorization_cost (vector_load, dr0_vt, 0)
+ == builtin_vectorization_cost (unaligned_load,
+ dr0_vt, -1)))))
do_peeling = false;
}