From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F347D3858C53; Fri, 21 Jul 2023 06:17:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F347D3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689920269; bh=9eD/6m/KbLyS7esl10RB9S4Ckq9r0joBHerzGJppuc0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gmH+fof64bgZX63gANtigT5QzQ/iajIKfCy2sZm5I8wwo5b8p+8xda7y9itFR7Wwk 355tkCh+dVYaaULl33KRHLaUpR/AZCuv5zVS4qIX7j32oCW0reYusVdulE3cnFSYPq ObLZbqETZk3wE5R6ehABmZozzj1z9H7v3mwU5cjs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110751] RISC-V: Suport undefined value that allows VSETVL PASS use TA/MA Date: Fri, 21 Jul 2023 06:17:48 +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: rguenth 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=3D110751 --- Comment #17 from Richard Biener --- (In reply to JuzheZhong from comment #15) > I am wondering: do we have have other situations need "undef" value to do > optimizations? If yes, I am aggree with Richard that we need to support > "undef" > value. But "undef" value in Gimple IR support would be a long term work > since it > is not an easy job. For example, in llvm, undef + a -> undef, but undef &= a > -> 0. We do have "undef" in the GIMPLE IR, for SSA variables it's the default definition. Note I think that a formal "undef" is different from "unspecified" (or in this case "target specified"). In GIMPLE an "undef" use is invoking undefined behavior but clearly doing a MASK/LEN operation with some "undef" lanes and then operating on the vector is _not_ invoking undefined behavior. In fact with RVV intrinsics the programmer can rely on RVV semantics, thus either all-ones _or_ merge which means if you know the old value has some specific bits set you know the new value will as well. That's _not_ "undef" in the classical sense so I think LLVMs "undef" isn't a very good fit here (nor would putting a SSA default def as the "else" value).=