From patchwork Wed Oct 25 09:21:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 157952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2470085vqx; Wed, 25 Oct 2023 02:22:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErcQuIqplnbn5zF3qdg//16/w3rppFzngvgAZcfkUk11hx1uQum9aCKn41EXLoM1ppGw9T X-Received: by 2002:ac8:5847:0:b0:41e:2227:6abb with SMTP id h7-20020ac85847000000b0041e22276abbmr7459838qth.60.1698225740623; Wed, 25 Oct 2023 02:22:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698225740; cv=pass; d=google.com; s=arc-20160816; b=XZyCLZuc6zech9YFzN7cjGyAOPuDyF2Dq5rpKjyTDJu6ne13hzjD+LrJJ7ZWT5IVv3 LLK+17rxX56Pn0WHvkQjAqyMGC8S/gKFfRfPbqcDiFqLNNZHN8oUP81GmQ1dmYTv4lDC qNUwfm2ytjapxuTq3ST2EcYKezY5NnVnIB9AQrUnIhitvVG6gNlp3mZN+XxdBo5MSBnT TAzFqYXJIOEsijaZ/4CuuPwwgZPz8QBQYyG297uETIrRh7QN9cvY3o9258ZRFgQUNI9Z ba6m1af7vCfi7viRQeBlvLH1C/LyXtNVpMyjRv1cjXr/h+UjYLhriiAEEdPzh7bW1UDq fbiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=Ho+4g/W2YuBOLso0MeF7eXFeVM3rcOMIVAHlEDt9AkA=; fh=sWwT+rOYkCxnQbVM6TXAcwWGCueSuKsqr0SFTw5NLgg=; b=DwsmNXr2vxtvLmQPSwGM9FOTPRll5pvKPcyoMRWCvrCSs3TLOqVh9MFxwl8KYmp5vP 6TLZ5quDMXMt31LB1Vwng+Kk5knQwFvfFNRQkzg+LXy35xLUwGlzwZw6ZEJH5kgzYGIY 5AfQyV2UgNvhgB1y9RXgILHA0JnjC6WOAGN3DC8AJ6wOyH6XS+MCX5WdH2diZQe4hxVq n4JeKCPuCy81tAnpFP823i31mtmzU62i/Xws3N1sDphMd9CghNQfQgVJFlESebWbf0Yn mlOfZV4O8cHl9g+eri5XNRbax0Au9g55y0jKWiVII3G+toqcoDzmlKD42gk/25xU4Ww6 Ucfw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l1-20020a05622a174100b0041981d1c659si8727089qtk.579.2023.10.25.02.22.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 279413853D02 for ; Wed, 25 Oct 2023 09:22:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 13D163858421 for ; Wed, 25 Oct 2023 09:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13D163858421 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 13D163858421 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698225715; cv=none; b=R6DdyV8MGawbMfZnlRX2LijYo1bS8qOUoZuBWgoRcFG7YPqlIpfTseN+aJ8MojR+q8H/da3cvFrvOZcYJos/5hQWXxqDkx5BLPF/t/DOPSa0cQOUdhOeqmxcVIUorMVdgP+WnBESzv/v5uxOreGa00nyB0zSN9CwdhrzlMcHjB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698225715; c=relaxed/simple; bh=VUPnafdgmp0VQtmQFdHG45rob1FCWWkCH4feXYP6gVc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=i69hiusuQLVDYV1YXrjHDJPFolUkzJw9d0g7RhPX0Ls35jN+bDRtJtj+Lhqz0I7zEwa9JAxAKYqvrLFQemrP19rhnqnxFLp+aKVFoSejWzmQEFaRafm5bdg84wpChfW2N17CLtW5hdC4zplmgSi1lVtahAD8eKioCHZeFJTchYo= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: vEQ42KjnSQSQe2gdg/xWSA== X-CSE-MsgGUID: QxaAOg10RL62RTIGNyumxg== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20711701" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 25 Oct 2023 01:21:53 -0800 IronPort-SDR: kUj80+fw3ph0O1D0UDK0H+Y9VtBt2HKd96LY2qqoIZtVLq3B/Ctuvs57+mT8f9lsMHjVtu4q3T gbvZW/MDMEVCV8Bh63QFq+EggKFTz/veY4nJc2HzObDWkpEYVhGUgIo61J7x12zOS5OnZgJTOJ VZhOuRDcsuKoBfrlMDo7pVAfs0WNH4/cXedCTV31ERltk0WVxMKz8pTJ01fxukswV+cey+DUE9 hc1Z2Tsn7xI8gIRoKWaNy6fSbhg2IBze1598lCcky4ggfwLz9IwlGle/JvnpwjAU5xw31FKltE hgs= From: Thomas Schwinge To: Chung-Lin Tang , CC: Catherine Moore , Tobias Burnus Subject: Consistently order 'OMP_CLAUSE_SELF' right after 'OMP_CLAUSE_IF' (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) In-Reply-To: <87pm13w04d.fsf@euler.schwinge.homeip.net> References: <87pm13w04d.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Oct 2023 11:21:47 +0200 Message-ID: <87fs1zvyz8.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780718754347184107 X-GMAIL-MSGID: 1780718754347184107 Hi! On 2023-10-25T10:57:06+0200, I wrote: > With minor textual conflicts resolved, I've pushed this to master branch > in commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a > "OpenACC 2.7: Implement self clause for compute constructs", see > attached. > > > I'll then apply/submit a number of follow-on commits. > From 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a Mon Sep 17 00:00:00 2001 > From: Chung-Lin Tang > Date: Tue, 13 Jun 2023 08:44:31 -0700 > Subject: [PATCH] OpenACC 2.7: Implement self clause for compute constructs > it essentially behaves like the 'if' clause with the condition inverted) Pushed to master branch commit a5e919027fdb1900a6f2d64f763c99dbaf98aee6 "Consistently order 'OMP_CLAUSE_SELF' right after 'OMP_CLAUSE_IF'", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From a5e919027fdb1900a6f2d64f763c99dbaf98aee6 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 23 Oct 2023 14:24:44 +0200 Subject: [PATCH] Consistently order 'OMP_CLAUSE_SELF' right after 'OMP_CLAUSE_IF' As noted in recent commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a "OpenACC 2.7: Implement self clause for compute constructs", the OpenACC 'self' clause very much relates to the 'if' clause, and therefore copies a lot of the latter's handling. Therefore it makes sense to also place this handling in proximity to that of the 'if' clause, which was done in a lot but not all instances. gcc/ * tree-core.h (omp_clause_code): Move 'OMP_CLAUSE_SELF' after 'OMP_CLAUSE_IF'. * tree-pretty-print.cc (dump_omp_clause): Adjust. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Likewise. * tree.h: Likewise. --- gcc/tree-core.h | 6 +++--- gcc/tree-pretty-print.cc | 13 +++++++------ gcc/tree.cc | 4 ++-- gcc/tree.h | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gcc/tree-core.h b/gcc/tree-core.h index cfe37c1d627..4dc36827d32 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -389,6 +389,9 @@ enum omp_clause_code { /* OpenACC/OpenMP clause: if (scalar-expression). */ OMP_CLAUSE_IF, + /* OpenACC clause: self. */ + OMP_CLAUSE_SELF, + /* OpenMP clause: num_threads (integer-expression). */ OMP_CLAUSE_NUM_THREADS, @@ -527,9 +530,6 @@ enum omp_clause_code { /* OpenACC clause: nohost. */ OMP_CLAUSE_NOHOST, - - /* OpenACC clause: self. */ - OMP_CLAUSE_SELF, }; #undef DEFTREESTRUCT diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc index 39ec1df9394..1fadd752d05 100644 --- a/gcc/tree-pretty-print.cc +++ b/gcc/tree-pretty-print.cc @@ -587,6 +587,13 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) pp_right_paren (pp); break; + case OMP_CLAUSE_SELF: + pp_string (pp, "self("); + dump_generic_node (pp, OMP_CLAUSE_SELF_EXPR (clause), + spc, flags, false); + pp_right_paren (pp); + break; + case OMP_CLAUSE_NUM_THREADS: pp_string (pp, "num_threads("); dump_generic_node (pp, OMP_CLAUSE_NUM_THREADS_EXPR (clause), @@ -1453,12 +1460,6 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) false); pp_right_paren (pp); break; - case OMP_CLAUSE_SELF: - pp_string (pp, "self("); - dump_generic_node (pp, OMP_CLAUSE_SELF_EXPR (clause), - spc, flags, false); - pp_right_paren (pp); - break; default: gcc_unreachable (); } diff --git a/gcc/tree.cc b/gcc/tree.cc index c38b09c431b..cfead156ddf 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -280,6 +280,7 @@ unsigned const char omp_clause_num_ops[] = 1, /* OMP_CLAUSE__CONDTEMP_ */ 1, /* OMP_CLAUSE__SCANTEMP_ */ 1, /* OMP_CLAUSE_IF */ + 1, /* OMP_CLAUSE_SELF */ 1, /* OMP_CLAUSE_NUM_THREADS */ 1, /* OMP_CLAUSE_SCHEDULE */ 0, /* OMP_CLAUSE_NOWAIT */ @@ -326,7 +327,6 @@ unsigned const char omp_clause_num_ops[] = 0, /* OMP_CLAUSE_IF_PRESENT */ 0, /* OMP_CLAUSE_FINALIZE */ 0, /* OMP_CLAUSE_NOHOST */ - 1, /* OMP_CLAUSE_SELF */ }; const char * const omp_clause_code_name[] = @@ -372,6 +372,7 @@ const char * const omp_clause_code_name[] = "_condtemp_", "_scantemp_", "if", + "self", "num_threads", "schedule", "nowait", @@ -418,7 +419,6 @@ const char * const omp_clause_code_name[] = "if_present", "finalize", "nohost", - "self", }; /* Unless specific to OpenACC, we tend to internally maintain OpenMP-centric diff --git a/gcc/tree.h b/gcc/tree.h index aaf744c060e..ac94bd7b460 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1724,6 +1724,8 @@ class auto_suppress_location_wrappers OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FINAL), 0) #define OMP_CLAUSE_IF_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0) +#define OMP_CLAUSE_SELF_EXPR(NODE) \ + OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SELF), 0) #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0) #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \ @@ -1734,8 +1736,6 @@ class auto_suppress_location_wrappers OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_HINT), 0) #define OMP_CLAUSE_FILTER_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FILTER), 0) -#define OMP_CLAUSE_SELF_EXPR(NODE) \ - OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SELF), 0) #define OMP_CLAUSE_GRAINSIZE_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GRAINSIZE),0) -- 2.34.1