The current default configuration has the problem:
  several GPUs aren't supported by default
and, additionally, that there are too many multilibs

This patch addresses the first one by adding the generic
architectures - with the plan to removed the specific ones
in GCC 17 (except for gfx908/gfx90a which do not have
a generic arch).

Hence:
* Minimal LLVM version for build will move from LLVM 15 to LLVM 19
* 4 new multilibs will be build (4 generic), making it 13.
* This will add support for several new devices, albeit
  for generic support ROCm 6.4.0 is required (by then 1 year old)

For GCC 17, my suggestion is:
* Use only 4 generic + 2 specific = 6 are supposed to be used
* This will then require updates to Makefiles.
[A variant would be to do this already for GCC 16.]

NOTE: When a specific gfx... is not supported but a generic is,
there is a message like:
  gcn mkoffload: fatal error: GCC was built without library
  support for ‘-march=gfx1150’; consider compiling for the
  associated generic architecture ‘-march=gfx11-generic’

Comments? Support for this patch? Arguments against?
OK for mainline?

* * *

IMHO, LLVM 19 is old enough to require it for a newly released
GCC compiler, esp. given that older LLVM down to LLVM 13 work with
some manual work (namely: --with-multilib-list=).
Likewise for ROCm 6.4, esp. by the time GCC 17 has been released.

Thanks,

Tobias
GCN: Add generic targets to default-built multilibs

gcc/ChangeLog:

	* config.gcc (TM_MULTILIB_CONFIG): For gcn, also built by default
	gfx{9,9-4,10-3,11}-generic.
	* doc/install.texi (amdgcn): Update accordingly.

 gcc/config.gcc       |  2 +-
 gcc/doc/install.texi | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 6ac00ebdcb3..7d53f33a98e 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4647,7 +4647,7 @@ case "${target}" in
 			TM_MULTILIB_CONFIG=
 			;;
 		xdefault | xyes)
-			TM_MULTILIB_CONFIG=`echo "gfx900,gfx906,gfx908,gfx90a,gfx90c,gfx1030,gfx1036,gfx1100,gfx1103" | sed "s/${with_arch},\?//;s/,$//"`
+			TM_MULTILIB_CONFIG=`echo "gfx900,gfx906,gfx908,gfx90a,gfx90c,gfx1030,gfx1036,gfx1100,gfx1103,gfx9-generic,gfx9-4-generic,gfx10-3-generic,gfx11-generic" | sed "s/${with_arch},\?//;s/,$//"`
 			;;
 		*)
 			TM_MULTILIB_CONFIG="${with_multilib_list}"
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 437e4636db3..32210fcabf0 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -4086,14 +4086,16 @@ a linker error.
 
 By default, multilib support is built for @code{gfx900}, @code{gfx906},
 @code{gfx908}, @code{gfx90a}, @code{gfx90c}, @code{gfx1030}, @code{gfx1036},
-@code{gfx1100} and @code{gfx1103}.  The default multilib configuration
-requires LLVM 15 or newer.  LLVM 13.0.1 or LLVM 14 can be used by specifying
-a @code{--with-multilib-list=} that does not list any GFX 11 device nor
-@code{gfx1036}.  At least LLVM 16 is required for @code{gfx1150} and
-@code{gfx1151}, LLVM 18 for @code{gfx942}, LLVM 19 for the generic
-@code{gfx9-generic}, @code{gfx9-4-generic}, @code{gfx10-3-generic}, and
-@code{gfx11-generic} targets and for @code{gfx1152}, while LLVM 20 is required
-for @code{gfx950} and @code{gfx1153}.
+@code{gfx1100}, @code{gfx1103}, @code{gfx9-generic}, @code{gfx9-4-generic},
+@code{gfx10-3-generic}, and @code{gfx11-generic}.  The default multilib
+configuration requires LLVM 19 or newer.  LLVM 13.0.1 or LLVM 14 can be used by
+specifying a @code{--with-multilib-list=} that only lists GFX9 or GFX10-3
+devices, while LLVM 15 is required for GFX 11 device and @code{gfx1036}.
+At least LLVM 16 is required for @code{gfx1150} and @code{gfx1151},
+LLVM 18 for @code{gfx942}, LLVM 19 for the generic @code{gfx9-generic},
+@code{gfx9-4-generic}, @code{gfx10-3-generic}, and @code{gfx11-generic}
+targets and for @code{gfx1152}, while LLVM 20 is required for
+@code{gfx950} and @code{gfx1153}.
 
 The supported ISA architectures are listed in the GCC manual. The generic
 ISA targets @code{gfx9-generic}, @code{gfx10-3-generic}, and
gcc-16/changes.html: Update AMD GPU (gcn) for updated multilib support

diff --git a/htdocs/gcc-16/changes.html b/htdocs/gcc-16/changes.html
index da9756f1..50c109df 100644
--- a/htdocs/gcc-16/changes.html
+++ b/htdocs/gcc-16/changes.html
@@ -229,9 +229,24 @@ for general information.</p>
 <ul>
   <li>Experimental support for AMD Instinct MI300 (<code>gfx942</code>) devices
       has been added, including the generic <code>gfx9-4-generic</code> and
-      mostly compatible <code>gfx950</code>. Consult GCC's
-      <a href="https://gcc.gnu.org/install/specific.html#amdgcn-x-amdhsa";>
-      installation notes</a> on how to enable multilib support for them.</li>
+      mostly compatible <code>gfx950</code>.</li>
+  <li>The default-built multilibs now include additionally
+      <code>gfx9-generic</code>, <code>gfx9-4-generic</code>,
+      <code>gfx10-3-generic</code>, and <code>gfx11-generic</code>. Note:
+      <ul>
+        <li>Generic architectures require ROCm 6.4.0.</li>
+        <li>The new default-built set of multilibs now requires the assembler
+            and linker of LLVM 19 or newer.</li>
+        <li>The next version of GCC is scheduled to build by default
+            only the multilibs for generic targets and for
+            <code>gfx908</code> and <code>gfx90a</code>.</li>
+        <li>Consult GCC's
+            <a href="https://gcc.gnu.org/install/specific.html#amdgcn-x-amdhsa";>
+            AMD installation notes</a> and
+            <a href="https://gcc.gnu.org/install/configure.html#:~:text=%2D%2Dwith%2Dmultilib%2Dlist";>
+            configuration notes</a> on how to enable/disable multilib
+            support.</li>
+      </ul></li>
 </ul>
 
 <!-- <h3 id="mips">MIPS</h3> -->

Reply via email to