public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch] OpenMP: Skip target-nesting warning for reverse offload
Date: Tue, 17 May 2022 20:31:10 +0200	[thread overview]
Message-ID: <YoPp7qU52SAZpNy8@tucnak> (raw)
In-Reply-To: <9d5cb5b1-6b58-86b6-403f-e2ab9dd38d2e@codesourcery.com>

On Mon, May 16, 2022 at 05:14:12PM +0200, Tobias Burnus wrote:
> --- a/gcc/omp-low.cc
> +++ b/gcc/omp-low.cc
> @@ -3883,6 +3883,16 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
>  		}
>  	      else
>  		{
> +		  if ((gimple_omp_target_kind (ctx->stmt)
> +		       == GF_OMP_TARGET_KIND_REGION)
> +		      && (gimple_omp_target_kind (stmt)
> +			  == GF_OMP_TARGET_KIND_REGION)
> +		      && ((c = omp_find_clause (
> +				 gimple_omp_target_clauses (stmt),
> +				 OMP_CLAUSE_DEVICE))
> +			  != NULL_TREE)
> +		      && OMP_CLAUSE_DEVICE_ANCESTOR (c))
> +		    break;

The ( at the end of line is too ugly for me.
Can't you write it as:
		  if ((gimple_omp_target_kind (ctx->stmt)
		       == GF_OMP_TARGET_KIND_REGION)
		      && (gimple_omp_target_kind (stmt)
			  == GF_OMP_TARGET_KIND_REGION))
		    {
		      c = omp_find_clause (gimple_omp_target_clauses (stmt),
					   OMP_CLAUSE_DEVICE);
		      if (c && OMP_CLAUSE_DEVICE_ANCESTOR (c))
			break;
		    }
?

Otherwise LGTM.

	Jakub


      reply	other threads:[~2022-05-17 18:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 15:14 Tobias Burnus
2022-05-17 18:31 ` Jakub Jelinek [this message]

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=YoPp7qU52SAZpNy8@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.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).