slp-pr56812.cc: Allow either basic-block or loop vectorization to happen.
authorRichard Biener <rguenther@suse.de>
Thu, 8 Feb 2018 10:52:00 +0000 (10:52 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 8 Feb 2018 10:52:00 +0000 (10:52 +0000)
2018-02-08  Richard Biener  <rguenther@suse.de>

* g++.dg/vect/slp-pr56812.cc: Allow either basic-block or
loop vectorization to happen.

From-SVN: r257479

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/slp-pr56812.cc

index 16f2b1a..7179728 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-08  Richard Biener  <rguenther@suse.de>
+
+       * g++.dg/vect/slp-pr56812.cc: Allow either basic-block or
+       loop vectorization to happen.
+
 2018-02-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/83204
index 8b24b33..08b0981 100644 (file)
@@ -1,22 +1,19 @@
-/* { dg-do compile } */\r
-/* { dg-require-effective-target vect_float } */\r
-/* { dg-require-effective-target vect_hw_misalign } */\r
-/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model=dynamic" } */\r
-\r
-class mydata {\r
-public:\r
-    mydata() {Set(-1.0);}\r
-    void Set (float);\r
-    static int upper() {return 8;}\r
-    float data[8];\r
-};\r
-\r
-void mydata::Set (float x)\r
-{\r
-  for (int i=0; i<upper(); i++)\r
-    data[i] = x;\r
-}\r
-\r
-/* For targets without vector loop peeling the loop becomes cheap\r
-   enough to be vectorized.  */\r
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { xfail { ! vect_peeling_profitable } } } } */\r
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_hw_misalign } */
+/* { dg-additional-options "-O3 -funroll-loops -fvect-cost-model=dynamic -fopt-info-vec" } */
+
+class mydata {
+public:
+    mydata() {Set(-1.0);}
+    void Set (float);
+    static int upper() {return 8;}
+    float data[8];
+};
+
+void mydata::Set (float x)
+{
+  /* We want to vectorize this either as loop or basic-block.  */
+  for (int i=0; i<upper(); i++) /* { dg-message "note: \[^\n\]* vectorized" } */
+    data[i] = x;
+}