+2015-07-24 Tom de Vries <tom@codesourcery.com>
+
+ * tree-parloops.c (gen_parallel_loop): Add debug print for alternative
+ exit-first loop transform.
+
2015-07-24 Cesar Philippidis <cesar@codesourcery.com>
PR 66714
+2015-07-24 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/parloops-exit-first-loop-alt-2.c: Use debug print for
+ alternative exit-first loop transform.
+ * gcc.dg/parloops-exit-first-loop-alt-3.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt-4.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt-5.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt-6.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt-7.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt-pr66652.c: Same.
+ * gcc.dg/parloops-exit-first-loop-alt.c: Same.
+ * gfortran.dg/parloops-exit-first-loop-alt-2.f95: Same.
+ * gfortran.dg/parloops-exit-first-loop-alt.f95: Same.
+
2015-07-24 Ilya Enkovich <enkovich.gnu@gmail.com>
PR ipa/66566
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Constant bound, vector addition. */
c[i] = a[i] + b[i];
}
-/* Three times three array accesses:
- - three in f._loopfn.0
- - three in the parallel
- - three in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)\\\[i" 9 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Variable bound, reduction. */
return sum;
}
-/* Three array accesses:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)\\\* 4" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Constant bound, reduction. */
return sum;
}
-/* Three array accesses:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)\\\* 4" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Variable bound, vector addition, unsigned loop counter, unsigned bound. */
c[i] = a[i] + b[i];
}
-/* Three times a store:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Variable bound, vector addition, unsigned loop counter, signed bound. */
c[i] = a[i] + b[i];
}
-/* Three times a store:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Variable bound, vector addition, signed loop counter, signed bound. */
c[i] = a[i] + b[i];
}
-/* Three times a store:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
#include <stdio.h>
#include <stdlib.h>
return sum;
}
-/* Four times % 13:
- - once in f._loopfn.0
- - once in the parallel
- - once in the low iteration count loop
- - once for a peeled off last iteration following the parallel.
- In other words, we want try_transform_to_exit_first_loop_alt to fail. */
-/* { dg-final { scan-tree-dump-times "(?n)% 13" 4 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 0 "parloops" } } */
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
-/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
/* Variable bound, vector addition, signed loop counter, unsigned bound. */
c[i] = a[i] + b[i];
}
-/* Three times a store:
- - one in f._loopfn.0
- - one in the parallel
- - one in the low iteration count loop
- Crucially, none for a peeled off last iteration following the parallel. */
-/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
+
! { dg-additional-options "-O2" }
! { dg-require-effective-target pthread }
! { dg-additional-options "-ftree-parallelize-loops=2" }
-! { dg-additional-options "-fdump-tree-parloops" }
+! { dg-additional-options "-fdump-tree-parloops-details" }
! Constant bound, vector addition.
end do
end subroutine foo
-! Three times plus 25:
-! - once in f._loopfn.0
-! - once in the parallel
-! - once in the low iteration count loop
-! Crucially, none for a peeled off last iteration following the parallel.
-! { dg-final { scan-tree-dump-times "(?n) \\+ 25;" 3 "parloops" } }
+! { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } }
! { dg-additional-options "-O2" }
! { dg-require-effective-target pthread }
! { dg-additional-options "-ftree-parallelize-loops=2" }
-! { dg-additional-options "-fdump-tree-parloops" }
+! { dg-additional-options "-fdump-tree-parloops-details" }
! Variable bound, vector addition.
end do
end subroutine foo
-! Three times plus 25:
-! - once in f._loopfn.0
-! - once in the parallel
-! - once in the low iteration count loop
-! Crucially, none for a peeled off last iteration following the parallel.
-! { dg-final { scan-tree-dump-times "(?n) \\+ 25;" 3 "parloops" } }
+! { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } }
+
increment) and immediately follows the loop exit test. Attempt to move the
entry of the loop directly before the exit check and increase the number of
iterations of the loop by one. */
- if (!try_transform_to_exit_first_loop_alt (loop, reduction_list, nit))
+ if (try_transform_to_exit_first_loop_alt (loop, reduction_list, nit))
+ {
+ if (dump_file
+ && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "alternative exit-first loop transform succeeded"
+ " for loop %d\n", loop->num);
+ }
+ else
{
/* Fall back on the method that handles more cases, but duplicates the
loop body: move the exit condition of LOOP to the beginning of its