[committed] amdgcn: Disallow TImode vector permute

Message ID 4f16e1fb-e42b-4aca-b675-a37e8fcec48b@codesourcery.com
State Accepted
Headers
Series [committed] amdgcn: Disallow TImode vector permute |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Andrew Stubbs Nov. 27, 2023, 1:38 p.m. UTC
  This fixes an ICE that affects some testsuite compiles that use vector 
extensions, but probably not much real code (certainly not for offloading).

Andrew
amdgcn: Disallow TImode vector permute

We don't support it and it doesn't happen without vector extensions, so
just remove the unhandled case.

Fixes gcc.dg/pr78575.c failure.

gcc/ChangeLog:

	* config/gcn/gcn.cc (gcn_vectorize_vec_perm_const): Disallow TImode.
  

Patch

diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 52c8a0e409c..22d2b6ebf6d 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -5050,7 +5050,9 @@  gcn_vectorize_vec_perm_const (machine_mode vmode, machine_mode op_mode,
 			      rtx dst, rtx src0, rtx src1,
 			      const vec_perm_indices & sel)
 {
-  if (vmode != op_mode)
+  if (vmode != op_mode
+      || !VECTOR_MODE_P (vmode)
+      || GET_MODE_INNER (vmode) == TImode)
     return false;
 
   unsigned int nelt = GET_MODE_NUNITS (vmode);