From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A18323858D39; Sun, 4 Jun 2023 14:03:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A18323858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685887410; bh=iU/OlR3huM8Ki22eo0fZ97pVt1BCfTKuiX29MJNIVWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oEcLrIs2MfFe40BO7OfawAJmim7T2sNeAxr/BWCqeRPinKhVwEQzleNjZIiJkoEzv 71gcSHY5acLw+9yUc/riU7YEMQ8c5jy1uZ+/vLltNUCNwT811djcbWfcSDvxXBWsUQ +XOr1skfqh3PJsTayflCzEzjONabGxy1PRyzYXHE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110109] RISC-V: ICE when build the Intrinsic code Date: Sun, 04 Jun 2023 14:03:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110109 --- Comment #3 from CVS Commits --- The master branch has been updated by Pan Li : https://gcc.gnu.org/g:a96ba6b958a00ad59c43cae10be65b263b5d0d2d commit r14-1531-ga96ba6b958a00ad59c43cae10be65b263b5d0d2d Author: Juzhe-Zhong Date: Sun Jun 4 16:51:47 2023 +0800 RISC-V: Remove redundant vlmul_ext_* patterns to fix PR110109 This patch is to fix PR110109 issue. This issue happens is because: (define_insn_and_split "*vlmul_extx2" [(set (match_operand: 0 "register_operand" "=3Dvr, ?&vr") (subreg: (match_operand:VLMULEXT2 1 "register_operand" " 0, vr") 0))] "TARGET_VECTOR" "#" "&& reload_completed" [(const_int 0)] { emit_insn (gen_rtx_SET (gen_lowpart (mode, operands[0]), operands[1])); DONE; }) Such pattern generate such codes in insn-recog.cc: static int pattern57 (rtx x1) { rtx * const operands ATTRIBUTE_UNUSED =3D &recog_data.operand[0]; rtx x2; int res ATTRIBUTE_UNUSED; if (maybe_ne (SUBREG_BYTE (x1).to_constant (), 0)) return -1; ... PR110109 ICE at maybe_ne (SUBREG_BYTE (x1).to_constant (), 0) since for scalable RVV modes can not be accessed as SUBREG_BYTE (x1).to_constant () I create that patterns is to optimize the following test: vfloat32m2_t test_vlmul_ext_v_f32mf2_f32m2(vfloat32mf2_t op1) { return __riscv_vlmul_ext_v_f32mf2_f32m2(op1); } codegen: test_vlmul_ext_v_f32mf2_f32m2: vsetvli a5,zero,e32,m2,ta,ma vmv.v.i v2,0 vsetvli a5,zero,e32,mf2,ta,ma vle32.v v2,0(a1) vs2r.v v2,0(a0) ret There is a redundant 'vmv.v.i' here, Since GCC doesn't undefine IR (unlike LLVM, LLVM has undef/poison). For vlmul_ext_* RVV intrinsic, GCC will initiate all zeros into register. However, I think it's not a big issue after we support subreg livness tracking. PR target/110109 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc: Change expand approach. * config/riscv/vector.md (@vlmul_extx2): Remove it. (@vlmul_extx4): Ditto. (@vlmul_extx8): Ditto. (@vlmul_extx16): Ditto. (@vlmul_extx32): Ditto. (@vlmul_extx64): Ditto. (*vlmul_extx2): Ditto. (*vlmul_extx4): Ditto. (*vlmul_extx8): Ditto. (*vlmul_extx16): Ditto. (*vlmul_extx32): Ditto. (*vlmul_extx64): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr110109-1.c: New test. * gcc.target/riscv/rvv/base/pr110109-2.c: New test.=