testsuite/102861 - adjust gcc.dg/vect/bb-slp-16.c change

Message ID 6r2p91n0-4ro9-3842-63n6-9063o80n218@fhfr.qr
State Committed
Commit d438dd2523a35e073eed04d146f1e73e2514d93d
Headers
Series testsuite/102861 - adjust gcc.dg/vect/bb-slp-16.c change |

Commit Message

Richard Biener Oct. 21, 2021, 8:02 a.m. UTC
  This reverts the bogus previous change causing runtime failures
and instead realizes that we now have the loop condition
if-converted and the BB vectorization opportunity realized during
the loop vectorization pass.

Tested on x86_64-unknown-linux-gnu, pushed.

2021-10-21  Richard Biener  <rguenther@suse.de>

	PR testsuite/102861
	* gcc.dg/vect/bb-slp-16.c: Revert previous change, scan
	the vect dump instead.
---
 gcc/testsuite/gcc.dg/vect/bb-slp-16.c | 73 ++++++++++++---------------
 1 file changed, 32 insertions(+), 41 deletions(-)
  

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-16.c b/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
index 4fc176dde84..82fae06e324 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
@@ -1,4 +1,6 @@ 
 /* { dg-require-effective-target vect_int } */
+/* The SLP vectorization happens as part of the if-converted loop body.  */
+/* { dg-additional-options "-fdump-tree-vect-details" } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
@@ -16,52 +18,41 @@  main1 (int dummy)
   unsigned int *pin = &in[0];
   unsigned int *pout = &out[0];
   unsigned int a = 0;
-
-  i = N;
-  if (i > 0)
+  
+  for (i = 0; i < N; i++)
     {
-      do
-	{
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  *pout++ = *pin++ + a;
-	  if (arr[i] = i)
-	    a = i;
-	  else
-	    a = 2;
-	}
-      while (i < N);
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      *pout++ = *pin++ + a;
+      if (arr[i] = i)
+        a = i;
+      else
+        a = 2;
     }
 
   a = 0;
-  /* check results: */
-  i = N;
-  if (i > 0)
+  /* check results: */ 
+  for (i = 0; i < N; i++)
     {
-      do
-	{
-	  if (out[i*8] !=  in[i*8] + a
-	      || out[i*8 + 1] != in[i*8 + 1] + a
-	      || out[i*8 + 2] != in[i*8 + 2] + a
-	      || out[i*8 + 3] != in[i*8 + 3] + a
-	      || out[i*8 + 4] != in[i*8 + 4] + a
-	      || out[i*8 + 5] != in[i*8 + 5] + a
-	      || out[i*8 + 6] != in[i*8 + 6] + a
-	      || out[i*8 + 7] != in[i*8 + 7] + a)
-	    abort ();
+      if (out[i*8] !=  in[i*8] + a
+         || out[i*8 + 1] != in[i*8 + 1] + a
+         || out[i*8 + 2] != in[i*8 + 2] + a
+         || out[i*8 + 3] != in[i*8 + 3] + a
+         || out[i*8 + 4] != in[i*8 + 4] + a
+         || out[i*8 + 5] != in[i*8 + 5] + a
+         || out[i*8 + 6] != in[i*8 + 6] + a
+         || out[i*8 + 7] != in[i*8 + 7] + a)
+	abort ();
 
-	  if (arr[i] = i)
-	    a = i;
-	  else
-	    a = 2;
-	  i++;
-	}
-      while (i < N);
+      if (arr[i] = i)
+        a = i;
+      else
+        a = 2;
     }
 
   return 0;
@@ -76,4 +67,4 @@  int main (void)
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "slp1" } } */
+/* { dg-final { scan-tree-dump-times "optimized: basic block" 1 "vect" } } */