From patchwork Fri Nov 15 21:42:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1195863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513687-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Jaq2e9VB"; dkim-atps=neutral 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 47FBg416Wnz9s4Y for ; Sat, 16 Nov 2019 08:43:27 +1100 (AEDT) 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:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; q=dns; s= default; b=UNSOmHLD4nj2DB6rcfxvpuOcGgSXra7TdCs/S1+yWC8jlEmhHidwz o6K7QNTLXXZ5IO7pgWFzWDp03cHbC9le7J/NkjyajkoCggcBoMVUjk7bmbkGzpUs O3LK4YKqWngXsmn+QasaLaf9LTHkEN7L5KrNt3JqSxfoDQgMmKN5SU= 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:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=default; bh=sD+CGknhCOlsEVNQicBCdNp35SM=; b=Jaq2e9VByvV3m1IrTygbYZo901zi AqNd9Qtew4V4wbc1kEcMlMQuTXKTndciNfOxZMiJ8GAo1kdgGB5aURP14YPjE8// ZP7QVJ+3qEfom4rRXDhARae5BImgwfPwSK6nAxVfyIBmE8o2geccP+vsZrK4+EHV EfmDSVdzpHmUPJw= Received: (qmail 45349 invoked by alias); 15 Nov 2019 21:43:20 -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 45339 invoked by uid 89); 15 Nov 2019 21:43:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:autovec X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Nov 2019 21:43:18 +0000 IronPort-SDR: Jhdt/sSu0sm4lAzt7T58rdjuXoGQ2JUtd1U2raSckpxLS6/KqQZ7VjbE1Q8JmfD0kPgPReBO6J ebBQ7DvaCoc/3vRt0A/OGveNVQnofUH9CEB0zD0Sx4BKDXMg1XPXdI70YXJ5G394yiOUTkMp0i +l4sEJyMCQmBs32uXt9h+t+mG69/XxLsdwOYrKwMdYTfHIlH1TPqy5EddLVuheBa5L1WNJEAn3 JAx3e1jDjXaJf+ZzG/mcReAEQdx2qm2FEYtPOM1QoZFBxaLBI+M+9AoKQCQcNpxwNCvfE3j67O IE4= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 15 Nov 2019 13:43:11 -0800 IronPort-SDR: JIyWnBxb0D33yhaqAM0Qh1U5d1PS+7OQXySJwEiXLkIel+7j+nZ4wbvqVmQfg8nlGvaHcNoZdH qUHZqGTu44azu7bVfxarKu9lR9cINHEpYgMU5eJZVRf/+1K4O4cwqEuyZA0TEBeWb2W2vPb51o kO5aVvqeM4JVIm+3dGGQUiKes0vYRvG6O4C9AXbWFyGlDOazgCh+5snVUF6VCW95Mpjhwi0c9r W/7N9n7sN9AeKmEf6563dsGaPGubVVBFgyooWb9Jmd9YuO5On4gYcvF4lQjURu7z3upsqyHse3 9d4= From: Julian Brown To: CC: , , , Andrew Stubbs Subject: [PATCH 05/13] AMD GCN adjustments for middle-end worker partitioning Date: Fri, 15 Nov 2019 13:42:52 -0800 Message-ID: <17ea309bed83dac61eabfeb493739c38392f17be.1573849744.git.julian@codesourcery.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes This patch provides AMD GCN-specific parts supporting middle-end worker partitioning. The adjust_propagation_record hook is now called create_propagation_record. Several builtins are redefined to take an argument in a special address space (corresponding to GPU shared memory). Tested alongside other patches in this series. OK? Thanks, Julian ChangeLog gcc/ * config/gcn/gcn-protos.h (gcn_goacc_adjust_propagation_record): Rename prototype to... (gcn_goacc_create_propagation_record): This. * config/gcn/gcn-tree.c (gcn_goacc_adjust_propagation_record): Rename function to... (gcn_goacc_create_propagation_record): This. Adjust comment. * config/gcn/gcn.c (gcn_init_builtins): Override decls for BUILT_IN_GOACC_SINGLE_START, BUILT_IN_GOACC_SINGLE_COPY_START, BUILT_IN_GOACC_SINGLE_COPY_END and BUILT_IN_GOACC_BARRIER. (gcn_fork_join): Remove inaccurate comment. (TARGET_GOACC_ADJUST_PROPAGATION_RECORD): Rename to... (TARGET_GOACC_CREATE_PROPAGATION_RECORD): This. --- gcc/config/gcn/gcn-protos.h | 2 +- gcc/config/gcn/gcn-tree.c | 6 +++--- gcc/config/gcn/gcn.c | 11 +++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/gcc/config/gcn/gcn-protos.h b/gcc/config/gcn/gcn-protos.h index 714d51189d9..e33c0598fee 100644 --- a/gcc/config/gcn/gcn-protos.h +++ b/gcc/config/gcn/gcn-protos.h @@ -37,7 +37,7 @@ extern rtx gcn_full_exec (); extern rtx gcn_full_exec_reg (); extern rtx gcn_gen_undef (machine_mode); extern bool gcn_global_address_p (rtx); -extern tree gcn_goacc_adjust_propagation_record (tree record_type, bool sender, +extern tree gcn_goacc_create_propagation_record (tree record_type, bool sender, const char *name); extern void gcn_goacc_adjust_private_decl (tree var, int level); extern void gcn_goacc_reduction (gcall *call); diff --git a/gcc/config/gcn/gcn-tree.c b/gcc/config/gcn/gcn-tree.c index aa56e236134..538034f7372 100644 --- a/gcc/config/gcn/gcn-tree.c +++ b/gcc/config/gcn/gcn-tree.c @@ -667,12 +667,12 @@ gcn_goacc_reduction (gcall *call) } } -/* Implement TARGET_GOACC_ADJUST_PROPAGATION_RECORD. +/* Implement TARGET_GOACC_CREATE_PROPAGATION_RECORD. - Tweak (worker) propagation record, e.g. to put it in shared memory. */ + Create (worker) propagation record in shared memory. */ tree -gcn_goacc_adjust_propagation_record (tree record_type, bool sender, +gcn_goacc_create_propagation_record (tree record_type, bool sender, const char *name) { tree type = record_type; diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index cf2f30413ae..2f758ef3ddc 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -3494,8 +3494,6 @@ gcn_init_builtins (void) TREE_NOTHROW (gcn_builtin_decls[i]) = 1; } -/* FIXME: remove the ifdef once OpenACC support is merged upstream. */ -#ifdef BUILT_IN_GOACC_SINGLE_START /* These builtins need to take/return an LDS pointer: override the generic versions here. */ @@ -3512,7 +3510,6 @@ gcn_init_builtins (void) set_builtin_decl (BUILT_IN_GOACC_BARRIER, gcn_builtin_decls[GCN_BUILTIN_ACC_BARRIER], false); -#endif } /* Expand the CMP_SWAP GCN builtins. We have our own versions that do @@ -4798,8 +4795,6 @@ static bool gcn_fork_join (gcall *ARG_UNUSED (call), const int *ARG_UNUSED (dims), bool ARG_UNUSED (is_fork)) { - /* GCN does not use the fork/join concept invented for NVPTX. - Instead we use standard autovectorization. */ return false; } @@ -6064,9 +6059,9 @@ print_operand (FILE *file, rtx x, int code) #define TARGET_GIMPLIFY_VA_ARG_EXPR gcn_gimplify_va_arg_expr #undef TARGET_OMP_DEVICE_KIND_ARCH_ISA #define TARGET_OMP_DEVICE_KIND_ARCH_ISA gcn_omp_device_kind_arch_isa -#undef TARGET_GOACC_ADJUST_PROPAGATION_RECORD -#define TARGET_GOACC_ADJUST_PROPAGATION_RECORD \ - gcn_goacc_adjust_propagation_record +#undef TARGET_GOACC_CREATE_PROPAGATION_RECORD +#define TARGET_GOACC_CREATE_PROPAGATION_RECORD \ + gcn_goacc_create_propagation_record #undef TARGET_GOACC_ADJUST_PRIVATE_DECL #define TARGET_GOACC_ADJUST_PRIVATE_DECL gcn_goacc_adjust_private_decl #undef TARGET_GOACC_FORK_JOIN