From patchwork Mon Nov 9 11:31:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 541725 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 2CFAA1402CC for ; Mon, 9 Nov 2015 22:32:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wZE2DF4K; 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=vp5ijuR97Ratu4Y2 J/q5i5hpBzaToI/jWelO2b7bz9BhI59uGWuFy4Bbb7AqES/JDzG+MZ+QOlEPCwwA XUzYK5tJN0dRwLL+VYQUjVyvK53nbOlrAItRW66GfI7G0RnUFymQlsFqeRk5+qm4 dvjoobKfsPuq7sVMPbxORoUIIpU= 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=WEwzm/g0O7rgTNvV1qrP6U qh0Gg=; b=wZE2DF4K3RSjCBwxlXrc1woUcIA93aaP8y8hB7UBjt9VlFvGfF2IpF aTf5Q6+dB1Z03JVSuE1VYHP1Ix5Btl1JmJEChvlG0m9kBCLWFIBblQ9fhsAEs8yS kh3HPvSIJZMDWJaqg8ufHAjyGykP0zoZKxa6A8pdq1f8FBp22k/eM= Received: (qmail 5521 invoked by alias); 9 Nov 2015 11:31:54 -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 5508 invoked by uid 89); 9 Nov 2015 11:31:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, 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; Mon, 09 Nov 2015 11:31:47 +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 1Zvkfn-0005pO-Px from Thomas_Schwinge@mentor.com ; Mon, 09 Nov 2015 03:31:43 -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.3.224.2; Mon, 9 Nov 2015 11:31:41 +0000 From: Thomas Schwinge To: "gcc-patches@gcc.gnu.org" , Cesar Philippidis CC: Jakub Jelinek , Nathan Sidwell Subject: [gomp4] Re: [openacc] tile, independent, default, private and firstprivate support in c/++ In-Reply-To: <563C0C29.6040209@codesourcery.com> References: <5639325B.90006@codesourcery.com> <87k2pwzlqa.fsf@kepler.schwinge.homeip.net> <563B6C1E.8070408@codesourcery.com> <87twp02xdr.fsf@schwinge.name> <563B8E1E.1020400@codesourcery.com> <563C0C29.6040209@codesourcery.com> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Mon, 9 Nov 2015 12:31:31 +0100 Message-ID: <87fv0fwgrw.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Thu, 5 Nov 2015 18:10:49 -0800, Cesar Philippidis wrote: > I've applied this patch to trunk. It also includes the fortran and > template changes. [...] > Also, because of these reduction problems, I decided not to merge > combined_loops.f90 with combined-directives.f90 yet because the latter > relies on scanning which would fail with the errors detected during > gimplfication. I'm planning on adding a couple of more test cases [...] ACK. Merging Cesar's trunk r229832 into gomp-4_0-branch, I tried to replicate this part of his commit: > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -3449,16 +3478,33 @@ gfc_trans_oacc_combined_directive (gfc_code *code) > [...] > + loop_clauses.lists[OMP_LIST_PRIVATE] > + = construct_clauses.lists[OMP_LIST_PRIVATE]; > + loop_clauses.lists[OMP_LIST_REDUCTION] > + = construct_clauses.lists[OMP_LIST_REDUCTION]; > [...] > + construct_clauses.lists[OMP_LIST_PRIVATE] = NULL; > [...] ... in the gcc/fortran/trans-openmp.c:gfc_filter_oacc_combined_clauses function that we're using on gomp-4_0-branch, but ran into ICEs that looked like "double free" (or similar; maybe related to the slightly different structure of this code due to device_type support), so applied the following hack and XFAILs as part of the merge, which needs to be resolved later (on gomp-4_0-branch). (A few related TODOs also remain to be addressed in gcc/testsuite/c-c++-common/goacc/combined-directives.c.) With that, committed to gomp-4_0-branch in r230012: commit 80ebc1e747e3422e0cc57c4c11387ec26bbf8814 Merge: 175e08b ef014f9 Author: tschwinge Date: Mon Nov 9 11:10:12 2015 +0000 svn merge -r 229831:229832 svn+ssh://gcc.gnu.org/svn/gcc/trunk git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@230012 138bc75d-0d04-0410-961f-82ee72b054a4 Grüße Thomas --- gcc/fortran/trans-openmp.c +++ gcc/fortran/trans-openmp.c @@ -3691,12 +3691,14 @@ gfc_filter_oacc_combined_clauses (gfc_omp_clauses **orig_clauses, (*orig_clauses)->tile = false; (*loop_clauses)->tile_list = (*orig_clauses)->tile_list; (*orig_clauses)->tile_list = NULL; {+#if 0 /* TODO */+} (*loop_clauses)->lists[OMP_LIST_PRIVATE] = (*orig_clauses)->lists[OMP_LIST_PRIVATE]; (*orig_clauses)->lists[OMP_LIST_PRIVATE] = NULL; (*loop_clauses)->lists[OMP_LIST_REDUCTION] = (*orig_clauses)->lists[OMP_LIST_REDUCTION]; /* Don't reset (*orig_clauses)->lists[OMP_LIST_REDUCTION]. */ {+#endif+} (*loop_clauses)->device_types = (*orig_clauses)->device_types; --- gcc/testsuite/gfortran.dg/goacc/combined-directives.f90 +++ gcc/testsuite/gfortran.dg/goacc/combined-directives.f90 @@ -4,6 +4,9 @@ ! { dg-options "-fopenacc -fdump-tree-gimple" } ! TODO {+! Fix OMP_LIST_PRIVATE and OMP_LIST_REDUCTION splitting in+} {+! gcc/fortran/trans-openmp.c:gfc_filter_oacc_combined_clauses, and remove tree+} {+! scanning XFAILs.+} ! Enable and update tree scanning for reduction clauses. ! Enable/add/update device_type clauses and tree scanning. @@ -154,12 +157,12 @@ subroutine test ! !$acc end kernels loop end subroutine test ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. collapse.2." 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. gang" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. worker" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. vector" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. seq" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. auto" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. tile.2, 3" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. independent" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "private.z" 2 "gimple" } }