From patchwork Thu Mar 13 07:57:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 329799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B452D2C0099 for ; Thu, 13 Mar 2014 18:58:07 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=doNMvSijI/Ea65zT WSYVYj2Ytw0fn5xZT3jJ37Nqdm6stLNIzROH6CkRyHoltGJXR+PfBU5yfBSE8cR4 SBn6+tMF42FvqnmVqQrIp4OqqQy4cp6qPTKUP9c0T9SbKegrWBrqycXOz4dZ28Ul G6N48OSsrMMCfzkQs0vxIuCqPks= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=qk5xqu3lcmo3Dpd+raK7zA DqLLU=; b=hVseaUWpyon3m/l2vAQ9GDkOIfjwZEY2pj1QJ3nKNb86Q7rqA+Bh6H +Rb6G+PQqZEJ8u636YySOvZChXNX5s/9OHCa2kgr+ZP+AJQ+GR4NHitfUhHt+4/G Twid1m2mkCKxM9z+C4XbkrNV3LqxTeipOemUZKpcSmgI0mvN8KzT0= Received: (qmail 30869 invoked by alias); 13 Mar 2014 07:58:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30855 invoked by uid 89); 13 Mar 2014 07:57:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Mar 2014 07:57:58 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WO0WX-0005mS-Vq from Thomas_Schwinge@mentor.com ; Thu, 13 Mar 2014 00:57:54 -0700 Received: from SVR-IES-FEM-03.mgc.mentorg.com ([137.202.0.108]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 13 Mar 2014 00:57:53 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.2.247.3; Thu, 13 Mar 2014 07:57:52 +0000 From: Thomas Schwinge To: , , CC: Jakub Jelinek , Richard Henderson , "Michael V. Zolotukhin" , Subject: Re: [gomp4] Accelerator constructs omp lowering and expansion In-Reply-To: <877g7zfrzg.fsf@kepler.schwinge.homeip.net> References: <20130904185447.GG23437@tucnak.redhat.com> <877g7zfrzg.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Thu, 13 Mar 2014 08:57:44 +0100 Message-ID: <87wqfyedjb.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Wed, 12 Mar 2014 14:48:03 +0100, I wrote: > On Wed, 4 Sep 2013 20:54:47 +0200, Jakub Jelinek wrote: > > This patch implements #pragma omp {target{, data, update},teams} lowering > > and expansion, and adds stub calls into libgomp, so that (for now > > unconditionally) we can at least always fall back to host execution. > > > 2013-09-04 Jakub Jelinek > > > * omp-low.c [...] > > (create_omp_child_function): If current function has > > "omp declare target" attribute or if current region > > is OMP_TARGET or lexically nested in it, add that > > attribute to the omp child function. > > It seems that I have missed this one when generalizing the existing code > for OpenACC: [...] > Even if not yet relevant at the moment for OpenACC, I think it makes > sense to make it more obvious, and change the code as follows. Will > commit soon unless someone disagrees. Committed to gomp-4_0-branch in r208531: commit d50387c6b64d888e2acf12088979e6147bdaccc9 Author: tschwinge Date: Thu Mar 13 07:53:48 2014 +0000 Properly detect all offloaded regions. gcc/ * omp-low.c (create_omp_child_function): Use is_gimple_omp_offloaded when looking for offloaded regions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@208531 138bc75d-0d04-0410-961f-82ee72b054a4 Grüße, Thomas diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index 4ee843f..5fb4657 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,8 @@ +2014-03-13 Thomas Schwinge + + * omp-low.c (create_omp_child_function): Use + is_gimple_omp_offloaded when looking for offloaded regions. + 2014-03-12 Thomas Schwinge * omp-low.c (scan_sharing_clauses): Move offloaded logic into... diff --git gcc/omp-low.c gcc/omp-low.c index 6b676e5..aa2dd32 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -1978,16 +1978,12 @@ create_omp_child_function (omp_context *ctx, bool task_copy) { omp_context *octx; for (octx = ctx; octx; octx = octx->outer) - if (gimple_code (octx->stmt) == GIMPLE_OMP_TARGET - && gimple_omp_target_kind (octx->stmt) - == GF_OMP_TARGET_KIND_REGION) + if (is_gimple_omp_offloaded (octx->stmt)) { target_p = true; break; } } - gcc_assert (!is_gimple_omp_oacc_specifically (ctx->stmt) - || !target_p); if (target_p) DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("omp declare target"),