From patchwork Tue Jun 2 10:10:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 479372 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 7CE341402D0 for ; Tue, 2 Jun 2015 20:10:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=LbSocccC; dkim-atps=neutral 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=mxuNcZ0+AZXgCOG/ bBK6P+eK2e1rH+PsIbNiR/q+pX07oLwb+vhdHtyNrd1Mw2Eyb5TCKsmBgUEqrN58 L9T4UG5p0pyNsHRpstYPpIpXj/1lKNClaLieklMQpcB7+R5fP9c9xMofBNCQKndb ApTdZjvCEWAW3cJlnmZ6rnsd26M= 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=jpLqG6+/oSs9DyJaxqBwSC q6WWw=; b=LbSocccC85RED7wWzgzUBs42J906rTMY0rJlTqp2ib+05WB83d30J1 lBA9bFxwh+NRiX8FFoecEVnr7cLrz8GTaxJl3DTyvXLGiVCeCbTF/ZjcZ/2+tAZV RC6VN9EfszYWbgYXb7vQl6KwHh/sZqC6WAdvorQih8uoLSnyrXBPc= Received: (qmail 95420 invoked by alias); 2 Jun 2015 10:10:46 -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 95409 invoked by uid 89); 2 Jun 2015 10:10:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, SPF_PASS 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; Tue, 02 Jun 2015 10:10:43 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Yzj9b-0002pX-AA from Thomas_Schwinge@mentor.com ; Tue, 02 Jun 2015 03:10:39 -0700 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.3.224.2; Tue, 2 Jun 2015 11:10:37 +0100 From: Thomas Schwinge To: Bernd Schmidt CC: Jakub Jelinek , GCC Patches Subject: Re: [gomp4] Worker-single predication In-Reply-To: <556C813B.5020907@codesourcery.com> References: <556C813B.5020907@codesourcery.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Tue, 2 Jun 2015 12:10:29 +0200 Message-ID: <87382al8tm.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi Bernd! On Mon, 1 Jun 2015 17:58:51 +0200, Bernd Schmidt wrote: > This extends the previous vector-single support to also handle > worker-level predication. Thanks! > --- gcc/omp-low.c (revision 223974) > +++ gcc/omp-low.c (working copy) > +/* Allocate storage for OpenACC worker threads in CTX to broadcast > + condition results. CLAUSES are the clauses of the parallel construct. */ > + > +static void > +oacc_alloc_broadcast_storage (omp_context *ctx, tree clauses) > +{ > + tree vull_type_node = build_qualified_type (long_long_unsigned_type_node, > + TYPE_QUAL_VOLATILE); > + tree uptr_node = build_pointer_type (vull_type_node); > + > + tree clause = find_omp_clause (clauses, OMP_CLAUSE_NUM_WORKERS); > + tree host_count = integer_one_node; > + if (clause) > + host_count = OMP_CLAUSE_NUM_WORKERS_EXPR (clause); > + > + ctx->worker_sync_elt > + = alloc_var_ganglocal (NULL_TREE, long_long_unsigned_type_node, > + ctx, TYPE_SIZE_UNIT (long_long_unsigned_type_node)); > +} > @@ -12503,7 +12673,10 @@ lower_omp_target (gimple_stmt_iterator * > orlist = NULL; > > if (is_gimple_omp_oacc (stmt)) > - oacc_init_count_vars (ctx, clauses); > + { > + oacc_init_count_vars (ctx, clauses); > + oacc_alloc_broadcast_storage (ctx, clauses); > + } > > if (has_reduction) > { A few warnings/errors resulting in bootstrap failures. Not yet committed -- probably you meant to do something with host_count? commit f0a9e05f8b16436767e4f899580b8f3e753d228f Author: Thomas Schwinge Date: Tue Jun 2 12:07:35 2015 +0200 Resolve bootstrap failures ... introduced in r223989. [...]/source-gcc/gcc/omp-low.c: In function 'void oacc_alloc_broadcast_storage(omp_context*, tree)': [...]/source-gcc/gcc/omp-low.c:9412:8: error: unused variable 'uptr_node' [-Werror=unused-variable] tree uptr_node = build_pointer_type (vull_type_node); ^ [...]/source-gcc/gcc/omp-low.c:9415:8: error: variable 'host_count' set but not used [-Werror=unused-but-set-variable] tree host_count = integer_one_node; ^ [...]/source-gcc/gcc/omp-low.c: In function 'void predicate_bb(basic_block, omp_region*, int)': [...]/source-gcc/gcc/omp-low.c:10462:16: error: unused variable 'adjust_bb_ptr' [-Werror=unused-variable] basic_block *adjust_bb_ptr = NULL; ^ --- gcc/omp-low.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) Grüße, Thomas diff --git gcc/omp-low.c gcc/omp-low.c index 01e5d4b..ace9e24 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -9405,17 +9405,8 @@ expand_omp_atomic (struct omp_region *region) condition results. CLAUSES are the clauses of the parallel construct. */ static void -oacc_alloc_broadcast_storage (omp_context *ctx, tree clauses) +oacc_alloc_broadcast_storage (omp_context *ctx) { - tree vull_type_node = build_qualified_type (long_long_unsigned_type_node, - TYPE_QUAL_VOLATILE); - tree uptr_node = build_pointer_type (vull_type_node); - - tree clause = find_omp_clause (clauses, OMP_CLAUSE_NUM_WORKERS); - tree host_count = integer_one_node; - if (clause) - host_count = OMP_CLAUSE_NUM_WORKERS_EXPR (clause); - ctx->worker_sync_elt = alloc_var_ganglocal (NULL_TREE, long_long_unsigned_type_node, ctx, TYPE_SIZE_UNIT (long_long_unsigned_type_node)); @@ -10459,7 +10450,6 @@ predicate_bb (basic_block bb, struct omp_region *parent, int mask) return; basic_block skip_dest_bb = NULL; - basic_block *adjust_bb_ptr = NULL; if (gimple_code (stmt) == GIMPLE_OMP_ENTRY_END) return; @@ -12675,7 +12665,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) if (is_gimple_omp_oacc (stmt)) { oacc_init_count_vars (ctx, clauses); - oacc_alloc_broadcast_storage (ctx, clauses); + oacc_alloc_broadcast_storage (ctx); } if (has_reduction)