public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Tom de Vries <Tom_deVries@mentor.com>,
	"gcc-patches@gnu.org"	<gcc-patches@gnu.org>,
	Jakub Jelinek <jakub@redhat.com>
Subject: Re: [gomp4, committed] Handle nested loops in kernels regions
Date: Mon, 13 Jul 2015 08:20:00 -0000	[thread overview]
Message-ID: <87io9o1nbn.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <55A2618A.7050503@mentor.com>

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

Hi!

On Sun, 12 Jul 2015 14:46:02 +0200, Tom de Vries <Tom_deVries@mentor.com> wrote:
> This patch allows parallelization of an outer loop in an openacc kernels 
> region.

\o/


> We rely on pass_lim to move the *.omp_data_i loads out of the loop nest. 
> For the test-case, pass_lim was managing to move the load out of the 
> inner loop, but not the outer loop, because the load was classified as 
> 'MOVE_PRESERVE_EXECUTION'. By marking the *.omp_data_i load 
> non-trapping, it's now classified as 'MOVE_POSSIBLE', and moved out of 
> the loop nest.

Should this go into trunk already?  (Jakub?)  Do we need to audit the
code for constructs that need similar treatment?

	* omp-low.c (build_receiver_ref): Mark *.omp_data_i as non-trapping.

--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1147,6 +1147,7 @@ build_receiver_ref (tree var, bool by_ref, omp_context *ctx)
     field = x;
 
   x = build_simple_mem_ref (ctx->receiver_decl);
+  TREE_THIS_NOTRAP (x) = 1;
   x = omp_build_component_ref (x, field);
   if (by_ref)
     x = build_simple_mem_ref (x);


> I've committed this patch to gomp-4_0-branch.

Are you planning to also add a Fortran test case?


> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c
> @@ -0,0 +1,42 @@
> +/* { dg-additional-options "-O2" } */
> +/* { dg-additional-options "-ftree-parallelize-loops=32" } */
> +/* { dg-additional-options "-fdump-tree-parloops_oacc_kernels-all" } */
> +/* { dg-additional-options "-fdump-tree-optimized" } */
> +[...]
> +/* { dg-final { cleanup-tree-dump "parloops_oacc_kernels" } } */
> +/* { dg-final { cleanup-tree-dump "optimized" } } */

Committed in r225728:

commit c2da6458c51cc71dccec2e49481560b91d57aa1c
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Jul 13 08:14:05 2015 +0000

    cleanup-tree-dump is no more
    
        ERROR: (DejaGnu) proc "cleanup-tree-dump parloops_oacc_kernels" does not exist.
    
    	gcc/testsuite/
    	* c-c++-common/goacc/kernels-loop-nest.c: Remove cleanup-tree-dump
    	directives.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@225728 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/testsuite/ChangeLog.gomp                         |    5 +++++
 gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp
index 636a087..4694a60 100644
--- gcc/testsuite/ChangeLog.gomp
+++ gcc/testsuite/ChangeLog.gomp
@@ -1,3 +1,8 @@
+2015-07-13  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* c-c++-common/goacc/kernels-loop-nest.c: Remove cleanup-tree-dump
+	directives.
+
 2015-07-12  Tom de Vries  <tom@codesourcery.com>
 
 	* c-c++-common/goacc/kernels-loop-nest.c: New test.
diff --git gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c
index 3e06c9f..e8eebaa 100644
--- gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c
+++ gcc/testsuite/c-c++-common/goacc/kernels-loop-nest.c
@@ -37,6 +37,3 @@ main (void)
 /* { dg-final { scan-tree-dump-times "(?n);; Function .*main._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" } } */


Grüße,
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-07-13  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 12:46 Tom de Vries
2015-07-13  8:20 ` Thomas Schwinge [this message]
2015-07-13  8:36   ` Jakub Jelinek
2015-07-13  9:49     ` [Committed] Mark *.omp_data_i as non-trapping Tom de Vries
2015-11-21 18:49       ` [PATCH] Mark by_ref mem_ref in build_receiver_ref " Tom de Vries
2015-11-23  9:10         ` Jakub Jelinek
2015-11-23 10:40           ` Richard Biener
2015-11-23 11:02             ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87io9o1nbn.fsf@kepler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=Tom_deVries@mentor.com \
    --cc=gcc-patches@gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).