]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
amdgcn: remove gfx803 "Fiji" support
authorAndrew Stubbs <ams@baylibre.com>
Mon, 5 Aug 2024 15:14:17 +0000 (15:14 +0000)
committerAndrew Stubbs <ams@baylibre.com>
Mon, 2 Sep 2024 13:08:46 +0000 (13:08 +0000)
The gfx803 "Fiji" device was deprecated in GCC 14, removed from LLVM 18, and
hasn't worked properly with the drivers since about ROCm 4.

This patch removes the device from GCC options and documentation, and removes
the direct mentions from the internals.

The TARGET_GCN3 support in the back-end is now unused and can be removed (in a
follow-up patch).

gcc/ChangeLog:

* config.gcc (amdgcn-*-*): Remove "fiji" from with_arch checks.
* config/gcn/gcn-hsa.h (ABI_VERSION_SPEC): Remove fiji alternative.
(NO_XNACK): Likewise.
(NO_SRAM_ECC): Likewise.
(ASM_SPEC): Remove "%{}" around ABI_VERSION_SPEC.
* config/gcn/gcn-opts.h (enum processor_type): Remove PROCESSOR_FIJI.
(TARGET_FIJI): Delete.
* config/gcn/gcn.cc (gcn_option_override): Remove Fiji.
(gcn_omp_device_kind_arch_isa): Likewise.
(output_file_start): Likewise.
* config/gcn/gcn.h (TARGET_CPU_CPP_BUILTINS): Likewise.
* config/gcn/gcn.opt (gpu_type): Likewise.
(march, mtune): Change default to PROCESSOR_VEGA10.
* config/gcn/mkoffload.cc (EF_AMDGPU_MACH_AMDGCN_GFX803): Delete.
(copy_early_debug_info): Remove elf_flags_actual.
Use ELFABIVERSION_AMDGPU_HSA_V4 unconditionally.
(get_arch): Remove Fiji.
(main): Remove gfx803.
* config/gcn/t-omp-device
(omp-device-properties-gcn): Remove fiji and gfx803.
* doc/install.texi (amdgcn*-*-*): Remove fiji and special instructions.
* doc/invoke.texi: Remove fiji.

libgomp/ChangeLog:

* libgomp.texi: Remove fiji and gfx803.
* testsuite/libgomp.c/declare-variant-4.h: Remove fiji and gfx803.
* testsuite/libgomp.c/declare-variant-4-fiji.c: Removed.
* testsuite/libgomp.c/declare-variant-4-gfx803.c: Removed.

14 files changed:
gcc/config.gcc
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/gcn-opts.h
gcc/config/gcn/gcn.cc
gcc/config/gcn/gcn.h
gcc/config/gcn/gcn.opt
gcc/config/gcn/mkoffload.cc
gcc/config/gcn/t-omp-device
gcc/doc/install.texi
gcc/doc/invoke.texi
libgomp/libgomp.texi
libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c [deleted file]
libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c [deleted file]
libgomp/testsuite/libgomp.c/declare-variant-4.h

index 08291f4b6e07363eb6b1987c55fede9569ab69eb..f09ce9f63a01c932a66365e17b97354dfc20bc87 100644 (file)
@@ -4618,7 +4618,7 @@ case "${target}" in
                for which in arch tune; do
                        eval "val=\$with_$which"
                        case ${val} in
-                       "" | fiji | gfx900 | gfx906 | gfx908 | gfx90a | gfx90c | gfx1030 | gfx1036 | gfx1100 | gfx1103)
+                       "" | gfx900 | gfx906 | gfx908 | gfx90a | gfx90c | gfx1030 | gfx1036 | gfx1100 | gfx1103)
                                # OK
                                ;;
                        *)
index 0322055507554854ae5fa126116717175d6fa0e2..7a1bfad49cad1d4c8694ee95a8668c3a90bc62ff 100644 (file)
@@ -79,21 +79,18 @@ extern unsigned int gcn_local_sym_hash (const char *name);
    default; however, when debugging symbols are turned on, mkoffload.cc
    writes a new AMD GPU object file and the ABI version needs to be the
    same. - LLVM <= 17 defaults to 4 while LLVM >= 18 defaults to 5.
-   GCC supports LLVM >= 13.0.1 and only LLVM >= 14 supports version 5.
-   Note that Fiji is only supported with LLVM <= 17 as version 3 is no longer
-   supported in LLVM >= 18.  */
-#define ABI_VERSION_SPEC "march=fiji:--amdhsa-code-object-version=3;" \
-                        "!march=*|march=*:--amdhsa-code-object-version=4"
+   GCC supports LLVM >= 13.0.1 and only LLVM >= 14 supports version 5.  */
+#define ABI_VERSION_SPEC "--amdhsa-code-object-version=4"
 
 /* Note that the XNACK and SRAM-ECC settings must match those in mkoffload.cc
    as the latter creates new ELF object file when debugging is enabled and
    the ELF flags (e_flags) of that generated file must be identical to those
    generated by the compiler.  */
 
-#define NO_XNACK "march=fiji:;march=gfx1030:;march=gfx1036:;march=gfx1100:;march=gfx1103:;" \
+#define NO_XNACK "march=gfx1030:;march=gfx1036:;march=gfx1100:;march=gfx1103:;" \
     /* These match the defaults set in gcn.cc.  */ \
     "!mxnack*|mxnack=default:%{march=gfx900|march=gfx906|march=gfx908:-mattr=-xnack};"
-#define NO_SRAM_ECC "!march=*:;march=fiji:;march=gfx900:;march=gfx906:;march=gfx90c:;"
+#define NO_SRAM_ECC "!march=*:;march=gfx900:;march=gfx906:;march=gfx90c:;"
 
 /* In HSACOv4 no attribute setting means the binary supports "any" hardware
    configuration.  The name of the attribute also changed.  */
@@ -103,7 +100,7 @@ extern unsigned int gcn_local_sym_hash (const char *name);
 /* Use LLVM assembler and linker options.  */
 #define ASM_SPEC  "-triple=amdgcn--amdhsa "  \
                  "%{march=*:-mcpu=%*} " \
-                 "%{" ABI_VERSION_SPEC "} " \
+                 ABI_VERSION_SPEC " " \
                  "%{" NO_XNACK XNACKOPT "} " \
                  "%{" NO_SRAM_ECC SRAMOPT "} " \
                  "%{march=gfx1030|march=gfx1036|march=gfx1100|march=gfx1103:-mattr=+wavefrontsize64} " \
index 24e856bc0c3c443676421167623f555fcf88a87c..a896a80cd0a092852ebfbcd3e981333c18525c43 100644 (file)
@@ -20,7 +20,6 @@
 /* Which processor to generate code or schedule for.  */
 enum processor_type
 {
-  PROCESSOR_FIJI,    // gfx803
   PROCESSOR_VEGA10,  // gfx900
   PROCESSOR_VEGA20,  // gfx906
   PROCESSOR_GFX908,
@@ -32,7 +31,6 @@ enum processor_type
   PROCESSOR_GFX1103
 };
 
-#define TARGET_FIJI (gcn_arch == PROCESSOR_FIJI)
 #define TARGET_VEGA10 (gcn_arch == PROCESSOR_VEGA10)
 #define TARGET_VEGA20 (gcn_arch == PROCESSOR_VEGA20)
 #define TARGET_GFX908 (gcn_arch == PROCESSOR_GFX908)
index 17316a7ddb840cd95f544317ccbfe9ab6d9cd712..89aab6fe8e43323a1d6470dced6f9dadfe29e0ea 100644 (file)
@@ -133,8 +133,7 @@ gcn_option_override (void)
   if (!flag_pic)
     flag_pic = flag_pie;
 
-  gcn_isa = (gcn_arch == PROCESSOR_FIJI ? ISA_GCN3
-      : gcn_arch == PROCESSOR_VEGA10 ? ISA_GCN5
+  gcn_isa = (gcn_arch == PROCESSOR_VEGA10 ? ISA_GCN5
       : gcn_arch == PROCESSOR_VEGA20 ? ISA_GCN5
       : gcn_arch == PROCESSOR_GFX908 ? ISA_CDNA1
       : gcn_arch == PROCESSOR_GFX90a ? ISA_CDNA2
@@ -164,17 +163,15 @@ gcn_option_override (void)
        acc_lds_size = 32768;
     }
 
-  /* gfx803 "Fiji", gfx1030 and gfx1100 do not support XNACK.  */
-  if (gcn_arch == PROCESSOR_FIJI
-      || gcn_arch == PROCESSOR_GFX1030
+  /* gfx1030 and gfx1100 do not support XNACK.  */
+  if (gcn_arch == PROCESSOR_GFX1030
       || gcn_arch == PROCESSOR_GFX1036
       || gcn_arch == PROCESSOR_GFX1100
       || gcn_arch == PROCESSOR_GFX1103)
     {
       if (flag_xnack == HSACO_ATTR_ON)
        error ("%<-mxnack=on%> is incompatible with %<-march=%s%>",
-              (gcn_arch == PROCESSOR_FIJI ? "fiji"
-               : gcn_arch == PROCESSOR_GFX1030 ? "gfx1030"
+              (gcn_arch == PROCESSOR_GFX1030 ? "gfx1030"
                : gcn_arch == PROCESSOR_GFX1036 ? "gfx1036"
                : gcn_arch == PROCESSOR_GFX1100 ? "gfx1100"
                : gcn_arch == PROCESSOR_GFX1103 ? "gfx1103"
@@ -190,7 +187,6 @@ gcn_option_override (void)
   if (flag_xnack == HSACO_ATTR_DEFAULT)
     switch (gcn_arch)
       {
-      case PROCESSOR_FIJI:
       case PROCESSOR_VEGA10:
       case PROCESSOR_VEGA20:
       case PROCESSOR_GFX908:
@@ -3050,8 +3046,6 @@ gcn_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait,
     case omp_device_arch:
       return strcmp (name, "amdgcn") == 0 || strcmp (name, "gcn") == 0;
     case omp_device_isa:
-      if (strcmp (name, "fiji") == 0 || strcmp (name, "gfx803") == 0)
-       return gcn_arch == PROCESSOR_FIJI;
       if (strcmp (name, "gfx900") == 0)
        return gcn_arch == PROCESSOR_VEGA10;
       if (strcmp (name, "gfx906") == 0)
@@ -6587,11 +6581,6 @@ output_file_start (void)
   const char *cpu;
   switch (gcn_arch)
     {
-    case PROCESSOR_FIJI:
-      cpu = "gfx803";
-      xnack = "";
-      sram_ecc = "";
-      break;
     case PROCESSOR_VEGA10:
       cpu = "gfx900";
       sram_ecc = "";
index bd2afa61c10b9723343c5b4619f284dd3a4f86f0..a48fdc8f26294c6a035b6ae74b4ce4d553886128 100644 (file)
        builtin_define ("__RDNA3__");                                          \
       else                                                                     \
        gcc_unreachable ();                                                    \
-      if (TARGET_FIJI)                                                         \
-       {                                                                      \
-         builtin_define ("__fiji__");                                         \
-         builtin_define ("__gfx803__");                                       \
-       }                                                                      \
-      else if (TARGET_VEGA10)                                                  \
+      if (TARGET_VEGA10)                                                       \
        builtin_define ("__gfx900__");                                         \
       else if (TARGET_VEGA20)                                                  \
        builtin_define ("__gfx906__");                                         \
index 3317c492507009fc2a44a59708b20068f4dfc7d1..69ecca8a500be736cd295550dbdef0e0141493fb 100644 (file)
@@ -25,9 +25,6 @@ Enum
 Name(gpu_type) Type(enum processor_type)
 GCN GPU type to use:
 
-EnumValue
-Enum(gpu_type) String(fiji) Value(PROCESSOR_FIJI)
-
 EnumValue
 Enum(gpu_type) String(gfx900) Value(PROCESSOR_VEGA10)
 
@@ -56,11 +53,11 @@ EnumValue
 Enum(gpu_type) String(gfx1103) Value(PROCESSOR_GFX1103)
 
 march=
-Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_FIJI)
+Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_VEGA10)
 Specify the name of the target GPU.
 
 mtune=
-Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_FIJI)
+Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_VEGA10)
 Specify the name of the target GPU.
 
 m32
index 810298a799bf5bf33cf84352d2a67b043b175998..b8d981878edf7d9dd383d91ef7343776fdf7212a 100644 (file)
@@ -49,8 +49,6 @@
 #undef  ELFABIVERSION_AMDGPU_HSA_V4
 #define ELFABIVERSION_AMDGPU_HSA_V4 2
 
-#undef  EF_AMDGPU_MACH_AMDGCN_GFX803
-#define EF_AMDGPU_MACH_AMDGCN_GFX803 0x2a
 #undef  EF_AMDGPU_MACH_AMDGCN_GFX900
 #define EF_AMDGPU_MACH_AMDGCN_GFX900 0x2c
 #undef  EF_AMDGPU_MACH_AMDGCN_GFX906
@@ -352,18 +350,12 @@ copy_early_debug_info (const char *infile, const char *outfile)
   /* We only support host relocations of x86_64, for now.  */
   gcc_assert (ehdr.e_machine == EM_X86_64);
 
-  /* Fiji devices use HSACOv3 regardless of the assembler.  */
-  uint32_t elf_flags_actual = (elf_arch == EF_AMDGPU_MACH_AMDGCN_GFX803
-                              ? 0 : elf_flags);
-
   /* Patch the correct elf architecture flag into the file.  */
   ehdr.e_ident[7] = ELFOSABI_AMDGPU_HSA;
-  ehdr.e_ident[8] = (elf_arch == EF_AMDGPU_MACH_AMDGCN_GFX803
-                    ? ELFABIVERSION_AMDGPU_HSA_V3
-                    : ELFABIVERSION_AMDGPU_HSA_V4);
+  ehdr.e_ident[8] = ELFABIVERSION_AMDGPU_HSA_V4;
   ehdr.e_type = ET_REL;
   ehdr.e_machine = EM_AMDGPU;
-  ehdr.e_flags = elf_arch | elf_flags_actual;
+  ehdr.e_flags = elf_arch | elf_flags;
 
   /* Load the section headers so we can walk them later.  */
   Elf64_Shdr *sections = (Elf64_Shdr *)xmalloc (sizeof (Elf64_Shdr)
@@ -853,9 +845,7 @@ compile_native (const char *infile, const char *outfile, const char *compiler,
 static int
 get_arch (const char *str, const char *with_arch_str)
 {
-  if (strcmp (str, "fiji") == 0)
-    return EF_AMDGPU_MACH_AMDGCN_GFX803;
-  else if (strcmp (str, "gfx900") == 0)
+  if (strcmp (str, "gfx900") == 0)
     return EF_AMDGPU_MACH_AMDGCN_GFX900;
   else if (strcmp (str, "gfx906") == 0)
     return EF_AMDGPU_MACH_AMDGCN_GFX906;
@@ -1076,7 +1066,6 @@ main (int argc, char **argv)
      and ASM_SPEC.  */
   switch (elf_arch)
     {
-    case EF_AMDGPU_MACH_AMDGCN_GFX803:
     case EF_AMDGPU_MACH_AMDGCN_GFX1030:
     case EF_AMDGPU_MACH_AMDGCN_GFX1036:
     case EF_AMDGPU_MACH_AMDGCN_GFX1100:
index b92e19bb6d62909ed3539c11bbfed140b61fdd4d..233da0fcf6fb94c1a74249e1747b98ecdd02311e 100644 (file)
@@ -1,4 +1,4 @@
 omp-device-properties-gcn: $(srcdir)/config/gcn/gcn.cc
        echo kind: gpu > $@
        echo arch: amdgcn gcn >> $@
-       echo isa: fiji gfx803 gfx900 gfx906 gfx908 gfx90a gfx90c gfx1030 gfx1036 gfx1100 gfx1103 >> $@
+       echo isa: gfx900 gfx906 gfx908 gfx90a gfx90c gfx1030 gfx1036 gfx1100 gfx1103 >> $@
index f871227f684d8ab4c9de19e24dfcaf5bcd485fa2..d22ccdd96672c3fffb0f0dea14102b4c7d80cbc0 100644 (file)
@@ -1276,7 +1276,7 @@ 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},
+@var{list} is a comma separated list of ISA names (allowed values:
 @code{gfx900}, @code{gfx906}, @code{gfx908}, @code{gfx90a}, @code{gfx90c}, 
 @code{gfx1030}, @code{gfx1036}, @code{gfx1100}, @code{gfx1103}).
 It ought not include the name of the default
@@ -3965,12 +3965,6 @@ 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 was deprecated and has
-been removed in LLVM 18.
-
 @html
 <hr />
 @end html
index 1dede8234d391999338881aad47cc3d6eaf5d749..43afb0984e5d5999a50ec98835a31886370b247c 100644 (file)
@@ -22049,11 +22049,6 @@ Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
 are
 
 @table @samp
-@item fiji
-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).
 
index fe25d879788be55f3f1fd93395aa3054f5dad575..e8003df6f028dd12cba8ec770c6c5323517170b9 100644 (file)
@@ -6330,8 +6330,7 @@ on more architectures, GCC currently does not match any @code{arch} or
       @code{i586}, @code{i686}, @code{ia32}
       @tab See @code{-m...} flags in ``x86 Options'' (without @code{-m})
 @item @code{amdgcn}, @code{gcn}
-      @tab See @code{-march=} in ``AMD GCN Options''@footnote{Additionally,
-      @code{gfx803} is supported as an alias for @code{fiji}.}
+      @tab See @code{-march=} in ``AMD GCN Options''
 @item @code{nvptx}, @code{nvptx64}
       @tab See @code{-march=} in ``Nvidia PTX Options''
 @end multitable
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c b/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c
deleted file mode 100644 (file)
index 654f9bc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do link { target { offload_target_amdgcn } } } */
-/* { dg-additional-options -foffload=amdgcn-amdhsa } */
-/* { dg-additional-options -foffload=-march=fiji } */
-/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
-
-/* { dg-xfail-if "fiji/gfx803 is no longer enabled by default & deprectated in ROCm/LLVM/GCC" { *-*-* } } */
-
-#define USE_FIJI_FOR_GFX803
-#include "declare-variant-4.h"
-
-/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c
deleted file mode 100644 (file)
index b447631..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do link { target { offload_target_amdgcn } } } */
-/* { dg-additional-options -foffload=amdgcn-amdhsa } */
-/* { dg-additional-options -foffload=-march=fiji } */
-/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
-
-/* { dg-xfail-if "fiji/gfx803 is no longer enabled by default & deprectated in ROCm/LLVM/GCC" { *-*-* } } */
-
-#include "declare-variant-4.h"
-
-/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
index f244d09c655c89daba4e878618382a26928cdbbe..53788d2f92288c840a13b80425247a660e753e76 100644 (file)
@@ -1,12 +1,5 @@
 #pragma omp declare target
 
-__attribute__ ((noipa))
-int
-gfx803 (void)
-{
-  return 0x803;
-}
-
 __attribute__ ((noipa))
 int
 gfx900 (void)
@@ -70,11 +63,6 @@ gfx1103 (void)
   return 0x1103;
 }
 
-#ifdef USE_FIJI_FOR_GFX803
-#pragma omp declare variant(gfx803) match(device = {isa("fiji")})
-#else
-#pragma omp declare variant(gfx803) match(device = {isa("gfx803")})
-#endif
 #pragma omp declare variant(gfx900) match(device = {isa("gfx900")})
 #pragma omp declare variant(gfx906) match(device = {isa("gfx906")})
 #pragma omp declare variant(gfx908) match(device = {isa("gfx908")})