From patchwork Thu Oct 19 08:58:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 155396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp246843vqb; Thu, 19 Oct 2023 01:58:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWtcXUgIYWBcGGnAIkbZV+g0kn40bCS3iu+ymwoOHVba+dTK9lFOyi6BxESCx811p9NlGE X-Received: by 2002:a05:620a:4094:b0:775:68c8:79f7 with SMTP id f20-20020a05620a409400b0077568c879f7mr1433312qko.0.1697705926283; Thu, 19 Oct 2023 01:58:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697705926; cv=pass; d=google.com; s=arc-20160816; b=DnyjSX2egvMlnaJlHPMKzBk5y71WmFqfdqbygOY7RhQqBDu4BiJe+CKTiNQwpE9+dV DuK0HMlDuVZuJt4Fn7Uz4M/e5x/C75JaJUZKOiFI6WWD2vhW9GTfezQoM3F2VGptTA8O LPjfWa+9W+hbeiDT69KE6UZNVCvfl6uumXlv6sG9vUQxxSvehB/a4iWfgR+nyBScK2Om wMxduJibtHWIf29g6bDVI/GHOZcNedCcL1rb8lu2R80izhCr/mDWfdRS+ZlZpQBAaFbe h7ivwVkO21jJEYbYPUr0AuEKMsEtH8mQF8wC7nYyS/tYIKkgAugR209PK+a9fyJelLlz jaCg== 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:to:subject:from :content-language:user-agent:mime-version:date:message-id :ironport-sdr:arc-filter:dmarc-filter:delivered-to; bh=/Gri6Mt413qkQTTMSi5cpDedJq2MfrZm+nlRxYob9RA=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=RX0OWZS/jAhkUQI6UQM3nI0tELAQVPSUstB6i6CBargTWUWFumz9PUSfoaQOIEGTrv 57D1AytQQ9dBjB4vfCvsh/9DlZuy7EGsjVAa8xcli9YTxjs3tnMGDp/liLp6T3eA2E4F vG7JQmI9pqkvYXCQv+rBVYonBN/J0r9HxWHm2rvld53HXim1GmlIS9e2v4wlPpzm8MR+ 4eM5X+x651mkIbtdnClnM68Iqy8355DB2QIvcqOdUfjONMFhXqGb1POTIzEqpsGCDZpt 7kH9Ri6mc8tQcRGL7SeoCYkoYm/gtGXA7J1x4ghHF2lzi6xO/DMZ1WG8CMp5ZUE5jBAc 9m7Q== 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 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g20-20020ac87d14000000b00417fa6502a2si1165885qtb.387.2023.10.19.01.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; 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 2620:52:3:1:0:246e:9693:128c 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 005A0385AC3A for ; Thu, 19 Oct 2023 08:58:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 4806E385841F for ; Thu, 19 Oct 2023 08:58:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4806E385841F 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 4806E385841F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697705902; cv=none; b=sX/QoRfyZIBgOaVwN5Lp+bjC6Py8aO9eRASXuZ5kfIIvi9IaW1VZ6DjZ4JxxruIDYp8+Jl8D5x8iwNpfJ5UuM5/74mULOf4WGmEXRqobVQ9VdcVxx5IyNWwfIV7pvpTC7NVZ6yevvQM/IINCz3N4kDiB08rkY+hDVLJQDbH1/BI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697705902; c=relaxed/simple; bh=vE7Z+40aJoIQcKMT5jUPNTPZcvWSHGBjs4Ty7rrrCfk=; h=Message-ID:Date:MIME-Version:From:Subject:To; b=U7plwOU3rPi+YXrVh8AWNTowvy/G2kNcDH1fIDc/rwdMrbrBY4NHfqVnwaiA2vqzXs8b7Le3tg3IxCNZjUBk3ZxuyHEcczAtAdE/GDJtWDoPO/o/PXULLS/YvQPJOFfAvfy0ryCJiEZE3FlCnUHZGFdKYbAM5jIwcDSWg3i0h6Q= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: QU2Kf6SHQgeBahUcvw9Z2g== X-CSE-MsgGUID: w/7qjp5pQn+UUICyCuAsPA== X-IronPort-AV: E=Sophos;i="6.03,236,1694764800"; d="scan'208";a="22714839" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 19 Oct 2023 00:58:18 -0800 IronPort-SDR: 82+Ad88F5oPWCYctdWEaA7wkSob4rw4jarQ8BseGf95zL8Ru6sFKX1DWmHQ9mKNF30Mje3xLqq rCi+iRHxAEQpkw+IeKSiCVKqOnnYRSBNh2cKPxRoZ1le3NMiG5oVNZANQbAp4SKuji0tK4oEG7 C6CA9zAb4A4gwSYQSXFZP9jsvHALJuhjMgxbrNsG7kItHkcCSQpAtUV4a1uQ6DChloI8YFHhP8 QdjxowWjW92ffjWeAt2yO+5qKpxbPOe1qsA8Tv4+9BU93RmKtKp+1eFSP+c2iCjdNBtoZxurEW 0Fw= Message-ID: Date: Thu, 19 Oct 2023 09:58:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB From: Andrew Stubbs Subject: [committed] amdgcn: deprecate Fiji device and multilib To: "gcc-patches@gcc.gnu.org" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, 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: 1780173689287725101 X-GMAIL-MSGID: 1780173689287725101 The build has been failing for the last few days because LLVM removed support for the HSACOv3 binary metadata format, which we were still using for the Fiji multilib. The LLVM commit has now been reverted (thank you Pierre van Houtryve), but it's only a temporary repreive. This patch removes Fiji from the default configuration, and updates the documentation accordingly, but no more. Those that still use Fiji devices can re-enable it by configuring using --with-arch=fiji. Why not remove Fiji support entirely? This is simply because about one third of our test farm conists of Fiji devices and we can't replace them quickly. Andrew amdgcn: deprecate Fiji device and multilib LLVM wants to remove it, which breaks our build. This patch means that most users won't notice that change, when it comes, and those that do will have chosen to enable Fiji explicitly. I'm selecting gfx900 as the new default as that's the least likely for users to want, which means most users will specify -march explicitly, which means we'll be free to change the default again, when we need to, without breaking anybody's makefiles. gcc/ChangeLog: * config.gcc (amdgcn): Switch default to --with-arch=gfx900. Implement support for --with-multilib-list. * config/gcn/t-gcn-hsa: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Mark Fiji deprecated. diff --git a/gcc/config.gcc b/gcc/config.gcc index 37311fcd075..9c397156868 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4538,7 +4538,19 @@ case "${target}" in ;; esac done - [ "x$with_arch" = x ] && with_arch=fiji + [ "x$with_arch" = x ] && with_arch=gfx900 + + case "x${with_multilib_list}" in + x | xno) + TM_MULTILIB_CONFIG= + ;; + xdefault | xyes) + TM_MULTILIB_CONFIG=`echo "gfx900,gfx906,gfx908,gfx90a" | sed "s/${with_arch},\?//;s/,$//"` + ;; + *) + TM_MULTILIB_CONFIG="${with_multilib_list}" + ;; + esac ;; hppa*-*-*) diff --git a/gcc/config/gcn/t-gcn-hsa b/gcc/config/gcn/t-gcn-hsa index ea27122e484..18db7075356 100644 --- a/gcc/config/gcn/t-gcn-hsa +++ b/gcc/config/gcn/t-gcn-hsa @@ -42,8 +42,12 @@ ALL_HOST_OBJS += gcn-run.o gcn-run$(exeext): gcn-run.o +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $< -ldl -MULTILIB_OPTIONS = march=gfx900/march=gfx906/march=gfx908/march=gfx90a -MULTILIB_DIRNAMES = gfx900 gfx906 gfx908 gfx90a +empty := +space := $(empty) $(empty) +comma := , +multilib_list := $(subst $(comma),$(space),$(TM_MULTILIB_CONFIG)) +MULTILIB_OPTIONS = $(subst $(space),/,$(addprefix march=,$(multilib_list))) +MULTILIB_DIRNAMES = $(multilib_list) gcn-tree.o: $(srcdir)/config/gcn/gcn-tree.cc $(COMPILE) $< diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 31f2234640f..4035e8020b2 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1236,8 +1236,8 @@ sysv, aix. @itemx --without-multilib-list Specify what multilibs to build. @var{list} is a comma separated list of values, possibly consisting of a single value. Currently only implemented -for aarch64*-*-*, arm*-*-*, loongarch*-*-*, riscv*-*-*, sh*-*-* and -x86-64-*-linux*. The accepted values and meaning for each target is given +for aarch64*-*-*, amdgcn*-*-*, arm*-*-*, loongarch*-*-*, riscv*-*-*, sh*-*-* +and x86-64-*-linux*. The accepted values and meaning for each target is given below. @table @code @@ -1250,6 +1250,15 @@ default run-time library will be built. If @var{list} is default set of libraries is selected based on the value of @option{--target}. +@item amdgcn*-*-* +@var{list} is a comma separated list of ISA names (allowed values: @code{fiji}, +@code{gfx900}, @code{gfx906}, @code{gfx908}, @code{gfx90a}). It ought not +include the name of the default ISA, specified via @option{--with-arch}. If +@var{list} is empty, then there will be no multilibs and only the default +run-time library will be built. If @var{list} is @code{default} or +@option{--with-multilib-list=} is not specified, then the default set of +libraries is selected. + @item arm*-*-* @var{list} is a comma separated list of @code{aprofile} and @code{rmprofile} to build multilibs for A or R and M architecture @@ -3922,6 +3931,12 @@ To run the binaries, install the HSA Runtime from the @file{libexec/gcc/amdhsa-amdhsa/@var{version}/gcn-run} to launch them on the GPU. +To enable support for GCN3 Fiji devices (gfx803), GCC has to be configured with +@option{--with-arch=@code{fiji}} or +@option{--with-multilib-list=@code{fiji},...}. Note that support for Fiji +devices has been removed in ROCm 4.0 and support in LLVM is deprecated and will +be removed in the future. + @html
@end html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 9b5ff457027..8bbe1139c94 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21097,7 +21097,9 @@ are @table @samp @item fiji -Compile for GCN3 Fiji devices (gfx803). +Compile for GCN3 Fiji devices (gfx803). Support deprecated; availablility +depends on how GCC has been configured, see @option{--with-arch} and +@option{--with-multilib-list}. @item gfx900 Compile for GCN5 Vega 10 devices (gfx900).