aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-34.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c12
-rw-r--r--gcc/tree-vect-stmts.c13
6 files changed, 43 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4057969..dc87f1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69907
+ * tree-vect-stmts.c (vectorizable_load): Check for gaps at the
+ end of permutations for BB vectorization.
+
2016-02-24 Christian Bruel <christian.bruel@st.com>
* config/arm/arm-c.c (arm_option_override): Initialize
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index beb8026..d716932 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69907
+ * gcc.dg/vect/bb-slp-pr69907.c: New testcase.
+ * gcc.dg/vect/bb-slp-34.c: XFAIL.
+ * gcc.dg/vect/bb-slp-pr68892.c: Likewise.
+
2016-02-24 Christian Bruel <christian.bruel@st.com>
* gcc.target/arm/pragma_cpp_fma.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-34.c b/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
index c51c770..418f2b5 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-34.c
@@ -32,4 +32,5 @@ int main()
return 0;
}
-/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm } } } */
+/* ??? XFAILed because we access "excess" elements with the permutation. */
+/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target vect_perm xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
index ba51b76..216883f 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr68892.c
@@ -13,5 +13,7 @@ void foo(void)
b[3] = a[3][0];
}
-/* { dg-final { scan-tree-dump "not profitable" "slp2" } } */
+/* ??? The profitability check is not reached because we give up on the
+ gaps we access earlier. */
+/* { dg-final { scan-tree-dump "not profitable" "slp2" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Basic block will be vectorized" 0 "slp2" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c
new file mode 100644
index 0000000..9f1e71a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr69907.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+/* { dg-require-effective-target vect_unpack } */
+
+void foo(unsigned *p1, unsigned short *p2)
+{
+ int n;
+ for (n = 0; n < 320; n++)
+ p1[n] = p2[n * 2];
+}
+
+/* { dg-final { scan-tree-dump "BB vectorization with gaps at the end of a load is not supported" "slp1" } } */
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 1aade9e..9678d7c 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6395,6 +6395,19 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
slp_perm = true;
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
+
+ /* ??? The following is overly pessimistic (as well as the loop
+ case above) in the case we can statically determine the excess
+ elements loaded are within the bounds of a decl that is accessed.
+ Likewise for BB vectorizations using masked loads is a possibility. */
+ if (bb_vinfo && slp_perm && group_size % nunits != 0)
+ {
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "BB vectorization with gaps at the end of a load "
+ "is not supported\n");
+ return false;
+ }
+
if (!slp
&& !PURE_SLP_STMT (stmt_info)
&& !STMT_VINFO_STRIDED_P (stmt_info))