diff options
author | Richard Biener <rguenther@suse.de> | 2016-11-08 10:23:57 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-11-08 10:23:57 +0000 |
commit | f9ef2c765ad3fce93ddacdabede6b67efdc13c0d (patch) | |
tree | 0340dbcfba314663bc12068e3c2e27437f874c44 /gcc/tree-vect-stmts.c | |
parent | ae55655b93f64ab5ea6739d5c6be015fbe11e038 (diff) | |
download | gcc-f9ef2c765ad3fce93ddacdabede6b67efdc13c0d.zip gcc-f9ef2c765ad3fce93ddacdabede6b67efdc13c0d.tar.gz gcc-f9ef2c765ad3fce93ddacdabede6b67efdc13c0d.tar.bz2 |
tree-vect-stmts.c (get_group_load_store_type): If the access is aligned do not trigger peeling for gaps.
2016-11-08 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (get_group_load_store_type): If the
access is aligned do not trigger peeling for gaps.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Do not
force alignment of vars with DECL_USER_ALIGN.
* gcc.dg/vect/vect-nb-iter-ub-2.c: Adjust.
From-SVN: r241959
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 15aec21..c29e73d 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1770,6 +1770,11 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp, " non-consecutive accesses\n"); return false; } + /* If the access is aligned an overrun is fine. */ + if (overrun_p + && aligned_access_p + (STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt)))) + overrun_p = false; if (overrun_p && !can_overrun_p) { if (dump_enabled_p ()) @@ -1789,6 +1794,10 @@ get_group_load_store_type (gimple *stmt, tree vectype, bool slp, /* If there is a gap at the end of the group then these optimizations would access excess elements in the last iteration. */ bool would_overrun_p = (gap != 0); + /* If the access is aligned an overrun is fine. */ + if (would_overrun_p + && aligned_access_p (STMT_VINFO_DATA_REF (stmt_info))) + would_overrun_p = false; if (!STMT_VINFO_STRIDED_P (stmt_info) && (can_overrun_p || !would_overrun_p) && compare_step_with_zero (stmt) > 0) |