public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4, committed] Enable parallelization of kernels-loop-n.c
@ 2015-05-28 10:46 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2015-05-28 10:46 UTC (permalink / raw)
  To: gcc-patches, Jakub Jelinek

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

Hi,

I've committed this patch.

It enables parallelization of the kernels-loops-n.c testcase.

This is now possible, due the commit of the fix for PR65637 to the 
gomp-4_0-branch ( 
https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01569.html ).

Thanks,
- Tom

[-- Attachment #2: 0002-Enable-parallelization-of-kernels-loop-n.c.patch --]
[-- Type: text/x-patch, Size: 2992 bytes --]

Enable parallelization of kernels-loop-n.c

2015-05-27  Tom de Vries  <tom@codesourcery.com>

	* tree-parloops.c (parallelize_loops): Remove checks limiting type of
	loops allowed.

	* c-c++-common/goacc/kernels-loop-n.c: Check for parallelization.

diff --git a/gcc/testsuite/ChangeLog.gomp b/gcc/testsuite/ChangeLog.gomp
index a5f1167..9b657fb 100644
--- a/gcc/testsuite/ChangeLog.gomp
+++ b/gcc/testsuite/ChangeLog.gomp
@@ -1,5 +1,9 @@
 2015-05-27  Tom de Vries  <tom@codesourcery.com>
 
+	* c-c++-common/goacc/kernels-loop-n.c: Check for parallelization.
+
+2015-05-27  Tom de Vries  <tom@codesourcery.com>
+
 	* c-c++-common/goacc/kernels-loop-n.c (main): Remove.
 
 2015-05-15  Cesar Philippidis  <cesar@codesourcery.com>
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-loop-n.c b/gcc/testsuite/c-c++-common/goacc/kernels-loop-n.c
index 5f7c1df6..d227786 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-loop-n.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-loop-n.c
@@ -1,6 +1,7 @@
 /* { dg-additional-options "-O2" } */
 /* { dg-additional-options "-ftree-parallelize-loops=32" } */
-/* TODO: parallelize this example.  */
+/* { dg-additional-options "-fdump-tree-parloops_oacc_kernels-all" } */
+/* { dg-additional-options "-fdump-tree-optimized" } */
 
 #include <stdlib.h>
 
@@ -41,3 +42,14 @@ foo (COUNTERTYPE n)
   return 0;
 }
 
+/* Check that only one loop is analyzed, and that it can be parallelized.  */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops_oacc_kernels" } } */
+/* { dg-final { scan-tree-dump-not "FAILED:" "parloops_oacc_kernels" } } */
+
+/* Check that the loop has been split off into a function.  */
+/* { dg-final { scan-tree-dump-times "(?n);; Function .*foo.*._omp_fn.0" 1 "optimized" } } */
+
+/* { dg-final { scan-tree-dump-times "(?n)pragma omp target oacc_parallel.*num_gangs\\(32\\)" 1 "parloops_oacc_kernels" } } */
+
+/* { dg-final { cleanup-tree-dump "parloops_oacc_kernels" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index f5bc8b3..e10179d 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2273,24 +2273,6 @@ parallelize_loops (bool oacc_kernels_p)
 	  if (loop->inner)
 	    continue;
 
-	  gcc_assert (single_succ_p (region_entry));
-	  basic_block first = single_succ (region_entry);
-
-	  /* TODO: Allow conditional loop entry.  This test triggers when the
-	     loop bound is not known at compile time.  */
-	  if (!single_succ_p (first))
-	    continue;
-
-	  /* TODO: allow more complex loops.  */
-	  if (single_exit (loop) == NULL)
-	    continue;
-
-	  /* TODO: Allow other code than a single loop inside a kernels
-	     region.  */
-	  if (loop->header != single_succ (first)
-	      || single_exit (loop)->dest != region_exit)
-	    continue;
-
 	  if (dump_file && (dump_flags & TDF_DETAILS))
 	    fprintf (dump_file,
 		     "Trying loop %d with header bb %d in oacc kernels region\n",
-- 
1.9.1


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

only message in thread, other threads:[~2015-05-28 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 10:46 [gomp4, committed] Enable parallelization of kernels-loop-n.c Tom de Vries

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).