From patchwork Thu Feb 27 19:58:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 324903 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 3355F2C0097 for ; Fri, 28 Feb 2014 06:58:50 +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:subject:in-reply-to:references:date:message-id:mime-version :content-type; q=dns; s=default; b=VxMy6Z3Sn0dKoXXOsGZzgbfBWiwIf PMq4A7+x+ao8TLA7/U6O5ppjlRvCbOIBLQ3fsd9xzdBmaxz8i/QIfJUCbc+WQyhO I2Lm1v2k13tHQopsble6Ib6oN6WdAj1QCnKo2gYqLAUlaPq2u25TC5zHwHizVrzc EJtwM2yNGlFogo= 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:subject:in-reply-to:references:date:message-id:mime-version :content-type; s=default; bh=cbuqGaBXfOiq/yYAbKZPwijRYiQ=; b=Uzb b11lbNWVz/svQ9p9pN05XTiDZmtuMo9JUH/BK4PyC+qVhKzvWlaZbqCHNI7R9EpC q+eGIVmmpPgi+F38T42OrZ5UCnPFjze0T6ZyVmsKv6u0toLRnS+tj125GxWmdV2+ uQVL8k61/gfqmEiF4oFcyRGHcvyEbFN0LXM30TpU= Received: (qmail 4473 invoked by alias); 27 Feb 2014 19:58:43 -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 4460 invoked by uid 89); 27 Feb 2014 19:58:42 -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, 27 Feb 2014 19:58:39 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WJ76K-0003iT-7c from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Thu, 27 Feb 2014 11:58:36 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 27 Feb 2014 11:58:36 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 27 Feb 2014 19:58:34 +0000 From: Thomas Schwinge To: Subject: [gomp4] Gimplification: Merge gimplify_oacc_parallel into gimplify_omp_workshare. (was: [gomp4 9/9] OpenACC: Basic support for #pragma acc parallel.) In-Reply-To: <8761s5joir.fsf@schwinge.name> References: <878ux1jp2s.fsf@schwinge.name> <1383766943-8863-1-git-send-email-thomas@codesourcery.com> <1383766943-8863-2-git-send-email-thomas@codesourcery.com> <1383766943-8863-3-git-send-email-thomas@codesourcery.com> <1383766943-8863-4-git-send-email-thomas@codesourcery.com> <1383766943-8863-5-git-send-email-thomas@codesourcery.com> <1383766943-8863-6-git-send-email-thomas@codesourcery.com> <1383766943-8863-7-git-send-email-thomas@codesourcery.com> <1383766943-8863-8-git-send-email-thomas@codesourcery.com> <1383766943-8863-9-git-send-email-thomas@codesourcery.com> <8761s5joir.fsf@schwinge.name> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) Date: Thu, 27 Feb 2014 20:58:28 +0100 Message-ID: <87ha7knx97.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Wed, 6 Nov 2013 20:53:00 +0100, I wrote: > gcc/ > * gimplify.c [...] > (gimplify_oacc_parallel): New function. To get rid of code duplication, I have applied the following in r208206: commit 9ffb216dd43bda84f56ce7fe68ae15cc08110924 Author: tschwinge Date: Thu Feb 27 19:56:28 2014 +0000 Gimplification: Merge gimplify_oacc_parallel into gimplify_omp_workshare. gcc/ * gimplify.c (gimplify_oacc_parallel): Merge into gimplify_omp_workshare. Update all callers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@208206 138bc75d-0d04-0410-961f-82ee72b054a4 Grüße, Thomas diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index 9f5941f..3d9b06d 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,8 @@ +2014-02-27 Thomas Schwinge + + * gimplify.c (gimplify_oacc_parallel): Merge into + gimplify_omp_workshare. Update all callers. + 2014-02-27 Ilmir Usmanov Fix OpenACC ASYNC clause: it cannot contain integer-expression-list. diff --git gcc/gimplify.c gcc/gimplify.c index d0a4779..6dbabfa 100644 --- gcc/gimplify.c +++ gcc/gimplify.c @@ -6572,38 +6572,6 @@ gimplify_adjust_omp_clauses (tree *list_p) delete_omp_context (ctx); } -/* Gimplify the contents of an OACC_PARALLEL statement. This involves - gimplification of the body, as well as scanning the body for used - variables. We need to do this scan now, because variable-sized - decls will be decomposed during gimplification. */ - -static void -gimplify_oacc_parallel (tree *expr_p, gimple_seq *pre_p) -{ - tree expr = *expr_p; - gimple g; - gimple_seq body = NULL; - enum omp_region_type ort = (enum omp_region_type) (ORT_TARGET - | ORT_TARGET_OFFLOAD - | ORT_TARGET_MAP_FORCE); - - gimplify_scan_omp_clauses (&OACC_PARALLEL_CLAUSES (expr), pre_p, ort); - - push_gimplify_context (); - - g = gimplify_and_return_first (OACC_PARALLEL_BODY (expr), &body); - if (gimple_code (g) == GIMPLE_BIND) - pop_gimplify_context (g); - else - pop_gimplify_context (NULL); - - gimplify_adjust_omp_clauses (&OACC_PARALLEL_CLAUSES (expr)); - - g = gimple_build_oacc_parallel (body, OACC_PARALLEL_CLAUSES (expr)); - gimplify_seq_add_stmt (pre_p, g); - *expr_p = NULL_TREE; -} - /* Gimplify the contents of an OMP_PARALLEL statement. This involves gimplification of the body, as well as scanning the body for used variables. We need to do this scan now, because variable-sized @@ -7039,6 +7007,11 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p) ort = (enum omp_region_type) (ORT_TARGET | ORT_TARGET_MAP_FORCE); break; + case OACC_PARALLEL: + ort = (enum omp_region_type) (ORT_TARGET + | ORT_TARGET_OFFLOAD + | ORT_TARGET_MAP_FORCE); + break; case OMP_SECTIONS: case OMP_SINGLE: ort = ORT_WORKSHARE; @@ -7097,6 +7070,9 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p) stmt = gimple_build_omp_target (body, GF_OMP_TARGET_KIND_OACC_DATA, OACC_DATA_CLAUSES (expr)); break; + case OACC_PARALLEL: + stmt = gimple_build_oacc_parallel (body, OACC_PARALLEL_CLAUSES (expr)); + break; case OMP_SECTIONS: stmt = gimple_build_omp_sections (body, OMP_CLAUSES (expr)); break; @@ -8060,11 +8036,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ret = GS_ALL_DONE; break; - case OACC_PARALLEL: - gimplify_oacc_parallel (expr_p, pre_p); - ret = GS_ALL_DONE; - break; - case OACC_KERNELS: case OACC_HOST_DATA: case OACC_DECLARE: @@ -8095,6 +8066,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, break; case OACC_DATA: + case OACC_PARALLEL: case OMP_SECTIONS: case OMP_SINGLE: case OMP_TARGET: