Patchwork [testsuite] Fix vectorizer cost model test failures on SPU

login
register
mail settings
Submitter Ira Rosen
Date Jan. 20, 2011, 10:13 a.m.
Message ID <OF37480A04.D78477C4-ONC225781E.0036AA3B-C225781E.00382EFB@il.ibm.com>
Download mbox | patch
Permalink /patch/79664/
State New
Headers show

Comments

Ira Rosen - Jan. 20, 2011, 10:13 a.m.
Hi,

Uli noticed several vectorizer cost model test failures on SPU.
Two of them are because the loops are now unrolled, so I increased the loop
bounds. And the third failure is caused by different realignment technique.
I fixed the test accordingly.

Tested by Revital on Cell SPU.

OK for mainline?

Thanks,
Ira

testsuite/ChangeLog:

	* gcc.dg/vect/costmodel/spu/costmodel-vect-33.c: Expect
	vectorization to be not profitable if peeling is used to
	realign the memory access.
	* gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c: Increase
	loop bound to avoid loop unrolling.
	* gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c: Likewise.

Patch

Index: costmodel/spu/costmodel-vect-33.c
===================================================================
--- costmodel/spu/costmodel-vect-33.c   (revision 168537)
+++ costmodel/spu/costmodel-vect-33.c   (working copy)
@@ -4,7 +4,7 @@ 
 #include <stdarg.h>
 #include "../../tree-vect.h"

-#define N 17
+#define N 16
 struct test {
   char ca[N];
 };
@@ -35,6 +35,9 @@  int main (void)
   return main1 ();
 }

-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0
"vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Peeling to align the store is used. Overhead of peeling is too high.
*/
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1
"vect" { target vector_alignment_reachable } } } */
+
+/* Versioning to align the store is used. Overhead of versioning is not
too high.  */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1
"vect" { target {! vector_alignment_reachable} } } } */
 /* { dg-final { cleanup-tree-dump "vect" } } */
Index: costmodel/spu/costmodel-vect-76a.c
===================================================================
--- costmodel/spu/costmodel-vect-76a.c  (revision 168537)
+++ costmodel/spu/costmodel-vect-76a.c  (working copy)
@@ -3,7 +3,7 @@ 
 #include <stdarg.h>
 #include "../../tree-vect.h"

-#define N 8
+#define N 16
 #define OFF 4

 /* Check handling of accesses for which the "initial condition" -
Index: costmodel/spu/costmodel-vect-76c.c
===================================================================
--- costmodel/spu/costmodel-vect-76c.c  (revision 168537)
+++ costmodel/spu/costmodel-vect-76c.c  (working copy)
@@ -3,7 +3,7 @@ 
 #include <stdarg.h>
 #include "../../tree-vect.h"

-#define N 8
+#define N 32
 #define OFF 4

 /* Check handling of accesses for which the "initial condition" -