From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B736B3858C27; Thu, 14 Sep 2023 08:54:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B736B3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694681658; bh=F7aYpdFCfIugOIsMiBx44pdhjJigu7QTxQsEe1+lkDA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gP54CStqKTvDwA3aX2F9q19cutqIkLlo4DB7WUVJimHxWYYsvutqVrqqHR5JK9Kqh AbAFlOJsML6FAXde5mq6jjACIADh49Kjyjsk597qiEherzS3H8n3cRzo/AUpm1aMlZ Kvc5dQeFPieirb/ravOSrHA1DZcDIakjphkUJBww= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110751] RISC-V: Suport undefined value that allows VSETVL PASS use TA/MA Date: Thu, 14 Sep 2023 08:53:43 +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: juzhe.zhong at rivai dot ai 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=3D110751 --- Comment #40 from JuzheZhong --- I try this following code to set ELSE_VALUE: static tree riscv_preferred_else_value (unsigned ifn, tree vectype, unsigned int nops, tree *ops) { if (riscv_v_ext_mode_p (TYPE_MODE (vectype))) { // return build_zero_cst (size_type_node); return get_or_create_ssa_default_def (cfun, create_tmp_var (vectype)); } return default_preferred_else_value (ifn, vectype, nops, ops); } It generate the GIMPLE IR ELSE VALUE is an uninitialized value: vector([128,128]) signed char D.2821; vector([128,128]) signed char _72(D); vect_patt_42.12_73 =3D .COND_LEN_MOD ({ -1, ... }, vect__3.8_67, vect__6.11= _71, _72(D), _82, 0); Then "_72" is expanded into RTL as: (reg:RVVM8QI 136 [ D.2821 ]) I try to use SSA_NAME_IS_DEFAULT_DEF to check whether this operand is=20 the undef value since: (gdb) p ops[4]->u->reg->attrs->decl->base.default_def_flag $7 =3D 0 It's false that I can't recognize it as "undefine" value.=