public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4593] testsuite/102861 - adjust gcc.dg/vect/bb-slp-16.c change
@ 2021-10-21  8:03 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-10-21  8:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d438dd2523a35e073eed04d146f1e73e2514d93d

commit r12-4593-gd438dd2523a35e073eed04d146f1e73e2514d93d
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Oct 21 10:00:27 2021 +0200

    testsuite/102861 - adjust gcc.dg/vect/bb-slp-16.c change
    
    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.
    
    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.

Diff:
---
 gcc/testsuite/gcc.dg/vect/bb-slp-16.c | 73 +++++++++++++++--------------------
 1 file changed, 32 insertions(+), 41 deletions(-)

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" } } */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-21  8:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  8:03 [gcc r12-4593] testsuite/102861 - adjust gcc.dg/vect/bb-slp-16.c change Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).