[ was: Re: [PATCH] Check TYPE_OVERFLOW_WRAPS for parloops reductions ]

On 22/07/15 18:13, Tom de Vries wrote:
0003-Check-TYPE_OVERFLOW_WRAPS-for-parloops-reductions.patch


Check TYPE_OVERFLOW_WRAPS for parloops reductions

2015-07-21  Tom de Vries<t...@codesourcery.com>

        * tree-parloops.c (gather_scalar_reductions): Add arg to call to
        vect_force_simple_reduction.
        * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Same.
        (vect_is_simple_reduction_1): Add and handle
        need_wrapping_integral_overflow parameter.
        (vect_is_simple_reduction, vect_force_simple_reduction): Add and pass
        need_wrapping_integral_overflow parameter.
        (vectorizable_reduction): Add arg to call to vect_is_simple_reduction.
        * tree-vectorizer.h (vect_force_simple_reduction): Add parameter to 
decl.

        * gcc.dg/autopar/outer-4.c: Add xfail.
        * gcc.dg/autopar/outer-5.c: Same.
        * gcc.dg/autopar/outer-6.c: Same.
        * gcc.dg/autopar/reduc-2.c: Same.
        * gcc.dg/autopar/reduc-2char.c: Same.
        * gcc.dg/autopar/reduc-2short.c: Same.
        * gcc.dg/autopar/reduc-8.c: Same.
        * gcc.dg/autopar/uns-outer-4.c: New test.
        * gcc.dg/autopar/uns-outer-5.c: New test.
        * gcc.dg/autopar/uns-outer-6.c: New test.

diff --git a/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c 
b/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c
new file mode 100644
index 0000000..ef9fc2a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details 
-fdump-tree-optimized" } */
+
+void abort (void);
+
+unsigned int g_sum=0;
+unsigned int x[500][500];
+
+void __attribute__((noinline))
+parloop (int N)
+{
+  int i, j;
+  unsigned int sum;
+
+  /* Double reduction is currently not supported, outer loop is not
+     parallelized.  Inner reduction is detected, inner loop is
+     parallelized.  */
+  sum = 0;
+  for (i = 0; i < N; i++)
+    for (j = 0; j < N; j++)
+      sum += x[i][j];
+
+  g_sum = sum;
+}
+
+int
+main (void)
+{
+  parloop (500);
+
+  return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { 
xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" { xfail *-*-* } } 
} */

We currently get an XPASS for the last xfail.

The inner loop is paralllelized, so the split-off function loopfn exists.

Committed this follow-up patch to trunk, to remove the incorrect xfail.

Thanks,
- Tom

Remove xfail in autopar/uns-outer-4.c

2015-07-24  Tom de Vries  <t...@codesourcery.com>

	* gcc.dg/autopar/uns-outer-4.c: Remove loopfn xfail.
---
 gcc/testsuite/gcc.dg/autopar/uns-outer-4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c b/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c
index ef9fc2a..8365a89 100644
--- a/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c
+++ b/gcc/testsuite/gcc.dg/autopar/uns-outer-4.c
@@ -33,4 +33,4 @@ main (void)
 
 
 /* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
-- 
1.9.1

Reply via email to