From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id AF40D3858D35; Mon, 19 Feb 2024 17:04:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF40D3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708362243; bh=oDvUjvoh9zCnmxx1SVbegFzyB4OfHCI3ZUwkqye7mzo=; h=From:To:Subject:Date:From; b=GH5mvpqoNmAA0ME184AgEbSgAWKyVFI29GrWCv6XZ/s1NU/g/e27GUGxdrL2qVwWO NmxKfqzH4YDAvAJwmWIkcVyAibz1XP1sEuEy+1n07XZJEtSZjDVk3Btm/zYsuAtoK/ N9X+qwT19JM3bWI+XkJeRmXELc+o8XSXb+NBlmpE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9068] GCN: Conditionalize 'define_expand "reduc__scal_"' on '!TARGET_RDNA2_PLUS' [PR11361 X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/master X-Git-Oldrev: 159174f25716c18a74a915cb01b9a28024ea7a3d X-Git-Newrev: 641b50bffc06123853a1421c0dd5a318c353fd85 Message-Id: <20240219170403.AF40D3858D35@sourceware.org> Date: Mon, 19 Feb 2024 17:04:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:641b50bffc06123853a1421c0dd5a318c353fd85 commit r14-9068-g641b50bffc06123853a1421c0dd5a318c353fd85 Author: Thomas Schwinge Date: Fri Feb 16 13:04:00 2024 +0100 GCN: Conditionalize 'define_expand "reduc__scal_"' on '!TARGET_RDNA2_PLUS' [PR113615] On top of commit c7ec7bd1c6590cf4eed267feab490288e0b8d691 "amdgcn: add -march=gfx1030 EXPERIMENTAL" conditionalizing 'define_expand "reduc__scal_"' on '!TARGET_RDNA2' (later: '!TARGET_RDNA2_PLUS'), we then did similar in commit 7cc2262ec9a410dc56d1c1c6b950c922e14f621d "gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615]" to conditionalize 'define_expand "fold_left_plus_"' on '!TARGET_RDNA2_PLUS', but I found we also need to conditionalize the related 'define_expand "reduc__scal_"' on '!TARGET_RDNA2_PLUS', to avoid ICEs like: [...]/gcc.dg/vect/pr108608.c: In function 'foo': [...]/gcc.dg/vect/pr108608.c:9:1: error: unrecognizable insn: (insn 34 33 35 2 (set (reg:V64DF 723) (unspec:V64DF [ (reg:V64DF 690 [ vect_m_11.20 ]) (const_int 1 [0x1]) ] UNSPEC_MOV_DPP_SHR)) -1 (nil)) during RTL pass: vregs Similar for 'gcc.dg/vect/vect-fmax-2.c', 'gcc.dg/vect/vect-fmin-2.c', and 'UNSPEC_SMAX_DPP_SHR' for 'gcc.dg/vect/vect-fmax-1.c', and 'UNSPEC_SMIN_DPP_SHR' for 'gcc.dg/vect/vect-fmin-1.c', when running 'vect.exp' for 'check-gcc-c'. PR target/113615 gcc/ * config/gcn/gcn-valu.md (define_expand "reduc__scal_"): Conditionalize on '!TARGET_RDNA2_PLUS'. * config/gcn/gcn.cc (gcn_expand_dpp_shr_insn) (gcn_expand_reduc_scalar): 'gcc_checking_assert (!TARGET_RDNA2_PLUS);'. Diff: --- gcc/config/gcn/gcn-valu.md | 2 +- gcc/config/gcn/gcn.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index 59e27d0aed79..e8381d28c1b0 100644 --- a/gcc/config/gcn/gcn-valu.md +++ b/gcc/config/gcn/gcn-valu.md @@ -4261,7 +4261,7 @@ [(match_operand: 0 "register_operand") (fminmaxop:V_FP (match_operand:V_FP 1 "register_operand"))] - "" + "!TARGET_RDNA2_PLUS" { /* fmin/fmax are identical to smin/smax. */ emit_insn (gen_reduc__scal_ (operands[0], operands[1])); diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index 4559d6932d4a..bc076d1120d9 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -5448,6 +5448,8 @@ char * gcn_expand_dpp_shr_insn (machine_mode mode, const char *insn, int unspec, int shift) { + gcc_checking_assert (!TARGET_RDNA2_PLUS); + static char buf[128]; const char *dpp; const char *vcc_in = ""; @@ -5509,6 +5511,8 @@ gcn_expand_dpp_shr_insn (machine_mode mode, const char *insn, rtx gcn_expand_reduc_scalar (machine_mode mode, rtx src, int unspec) { + gcc_checking_assert (!TARGET_RDNA2_PLUS); + machine_mode orig_mode = mode; machine_mode scalar_mode = GET_MODE_INNER (mode); int vf = GET_MODE_NUNITS (mode);