public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Chung-Lin Tang <cltang@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Tobias Burnus <tobias@codesourcery.com>,
	Catherine Moore <clm@codesourcery.com>,
	Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: [PATCH, 2/3, OpenMP] Target mapping changes for OpenMP 5.0, middle-end parts and compiler testcases
Date: Thu, 29 Oct 2020 12:49:58 +0100	[thread overview]
Message-ID: <20201029114958.GF3788@tucnak> (raw)
In-Reply-To: <ab01948c-ce87-02a5-d347-8f14922db3ac@codesourcery.com>

On Wed, Oct 28, 2020 at 06:32:21PM +0800, Chung-Lin Tang wrote:
> > > @@ -8958,25 +9083,20 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
> > >   	      /* An "attach/detach" operation on an update directive should
> > >   		 behave as a GOMP_MAP_ALWAYS_POINTER.  Beware that
> > >   		 unlike attach or detach map kinds, GOMP_MAP_ALWAYS_POINTER
> > >   		 depends on the previous mapping.  */
> > >   	      if (code == OACC_UPDATE
> > >   		  && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH)
> > >   		OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_ALWAYS_POINTER);
> > > -	      if (gimplify_expr (pd, pre_p, NULL, is_gimple_lvalue, fb_lvalue)
> > > -		  == GS_ERROR)
> > > -		{
> > > -		  remove = true;
> > > -		  break;
> > > -		}
> > So what gimplifies those now?
> 
> They're gimplified somewhere during omp-low now.
> (some gimplify scan testcases were adjusted to accommodate this change)
> 
> I don't remember the exact case I encountered, but there were some issues with gimplified
> expressions inside the map clauses making some later checking more difficult. I haven't seen
> any negative effect of this modification so far.

I don't like that, it goes against many principles, gimplification really
shouldn't leave around non-GIMPLE IL.
If you need to compare same expression or same expression bases later,
perhaps detect the equalities during gimplification before actually gimplifying the
clauses and ensure they are gimplified to the same expression or are using
same base (e.g. by adding SAVE_EXPRs or TARGET_EXPRs before the
gimplification).

	Jakub


  reply	other threads:[~2020-10-29 11:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 13:16 Chung-Lin Tang
2020-10-13 13:31 ` Jakub Jelinek
2020-10-28 10:32   ` Chung-Lin Tang
2020-10-29 11:49     ` Jakub Jelinek [this message]
2020-11-03 18:02       ` Chung-Lin Tang
2020-11-06  9:53         ` 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=20201029114958.GF3788@tucnak \
    --to=jakub@redhat.com \
    --cc=clm@codesourcery.com \
    --cc=cltang@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas@codesourcery.com \
    --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).