aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-06-03 13:10:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-06-03 13:10:13 +0000
commite004aa11b1d261b597aa3e062204af61762ba6a9 (patch)
treea02fed610be6458820ef2510b8d689c0791fa6aa /gcc/tree-vect-data-refs.c
parentfddde8d3d82bf11fa191d067dcf3ed505224089a (diff)
downloadgcc-e004aa11b1d261b597aa3e062204af61762ba6a9.zip
gcc-e004aa11b1d261b597aa3e062204af61762ba6a9.tar.gz
gcc-e004aa11b1d261b597aa3e062204af61762ba6a9.tar.bz2
tree-vect-data-refs.c (vect_analyze_group_access): Properly compute GROUP_GAP for the first element.
2015-06-03 Richard Biener <rguenther@suse.de> * tree-vect-data-refs.c (vect_analyze_group_access): Properly compute GROUP_GAP for the first element. * tree-vect-slp.c (vect_build_slp_tree_1): Remove restriction on in-group gaps. * gcc.dg/vect/bb-slp-36.c: New testcase. From-SVN: r224077
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 5c3fa3d..a019dba 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2205,29 +2205,33 @@ vect_analyze_group_access (struct data_reference *dr)
/* Check that the size of the interleaving is equal to count for stores,
i.e., that there are no gaps. */
- if (groupsize != count)
+ if (groupsize != count
+ && !DR_IS_READ (dr))
{
- if (DR_IS_READ (dr))
- {
- slp_impossible = true;
- /* There is a gap after the last load in the group. This gap is a
- difference between the groupsize and the number of elements.
- When there is no gap, this difference should be 0. */
- GROUP_GAP (vinfo_for_stmt (stmt)) = groupsize - count;
- }
- else
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "interleaved store with gaps\n");
- return false;
- }
- }
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "interleaved store with gaps\n");
+ return false;
+ }
+
+ /* If there is a gap after the last load in the group it is the
+ difference between the groupsize and the last accessed
+ element.
+ When there is no gap, this difference should be 0. */
+ GROUP_GAP (vinfo_for_stmt (stmt)) = groupsize - last_accessed_element;
GROUP_SIZE (vinfo_for_stmt (stmt)) = groupsize;
if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "Detected interleaving of size %d\n", (int)groupsize);
+ {
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "Detected interleaving of size %d starting with ",
+ (int)groupsize);
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
+ if (GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "There is a gap of %d elements after the group\n",
+ (int)GROUP_GAP (vinfo_for_stmt (stmt)));
+ }
/* SLP: create an SLP data structure for every interleaving group of
stores for further analysis in vect_analyse_slp. */