re PR target/84278 (claims initv4sfv2sf is available but inits through stack)
authorRichard Biener <rguenther@suse.de>
Thu, 8 Feb 2018 12:53:19 +0000 (12:53 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 8 Feb 2018 12:53:19 +0000 (12:53 +0000)
2018-02-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/84278
* tree-vect-stmts.c (vectorizable_store): When looking for
smaller vector types to perform grouped strided loads/stores
make sure the mode is supported by the target.
(vectorizable_load): Likewise.

* gcc.target/i386/pr84278.c: New testcase.

From-SVN: r257483

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr84278.c [new file with mode: 0644]
gcc/tree-vect-stmts.c

index ef2f46ef0d75c50777203dafa75efa05cef8add9..4d65b9435a58853b9d1c053de75a2ede872358f4 100644 (file)
@@ -1,3 +1,11 @@
+2018-02-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/84278
+       * tree-vect-stmts.c (vectorizable_store): When looking for
+       smaller vector types to perform grouped strided loads/stores
+       make sure the mode is supported by the target.
+       (vectorizable_load): Likewise.
+
 2018-02-08  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_components_for_bb):
index c2eb50f453cdeaf76cc60a715de862a42306f543..5146f7ba612eeb272ab4807e00cd213d45327131 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/84278
+       * gcc.target/i386/pr84278.c: New testcase.
+
 2018-02-08  Wilco Dijkstra  <wdijkstr@arm.com>
 
        PR rtl-optimization/84068
diff --git a/gcc/testsuite/gcc.target/i386/pr84278.c b/gcc/testsuite/gcc.target/i386/pr84278.c
new file mode 100644 (file)
index 0000000..31e6288
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse2" } */
+
+float A[1024];
+float B[1024];
+int s;
+
+void foo(void)
+{
+  int i;
+  for (i = 0; i < 128; i++)
+    {
+      B[i*2+0] = A[i*s+0];
+      B[i*2+1] = A[i*s+1];
+    }
+}
+
+/* { dg-final { scan-assembler-not "\(%.sp\)" } } */
index 64a728eb1294fe579491e95b6f031f5a50dcd4f9..c5085ca9c0ae54c093f55bac42e781170ea02a6f 100644 (file)
@@ -6510,6 +6510,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
              machine_mode vmode;
              if (!mode_for_vector (elmode, group_size).exists (&vmode)
                  || !VECTOR_MODE_P (vmode)
+                 || !targetm.vector_mode_supported_p (vmode)
                  || (convert_optab_handler (vec_extract_optab,
                                             TYPE_MODE (vectype), vmode)
                      == CODE_FOR_nothing))
@@ -6528,6 +6529,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
                     element size stores.  */
                  if (mode_for_vector (elmode, lnunits).exists (&vmode)
                      && VECTOR_MODE_P (vmode)
+                     && targetm.vector_mode_supported_p (vmode)
                      && (convert_optab_handler (vec_extract_optab,
                                                 vmode, elmode)
                          != CODE_FOR_nothing))
@@ -7573,6 +7575,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
              machine_mode vmode;
              if (mode_for_vector (elmode, group_size).exists (&vmode)
                  && VECTOR_MODE_P (vmode)
+                 && targetm.vector_mode_supported_p (vmode)
                  && (convert_optab_handler (vec_init_optab,
                                             TYPE_MODE (vectype), vmode)
                      != CODE_FOR_nothing))
@@ -7598,6 +7601,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
                     element loads of the original vector type.  */
                  if (mode_for_vector (elmode, lnunits).exists (&vmode)
                      && VECTOR_MODE_P (vmode)
+                     && targetm.vector_mode_supported_p (vmode)
                      && (convert_optab_handler (vec_init_optab, vmode, elmode)
                          != CODE_FOR_nothing))
                    {