From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6CE613851A81; Mon, 18 Jul 2022 13:13:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CE613851A81 From: "yyc1992 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106340] flag set from SVE svwhilelt intrinsic not reused in loop Date: Mon, 18 Jul 2022 13:13:27 +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: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yyc1992 at gmail dot com 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 13:13:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106340 --- Comment #1 from Yichao Yu --- Also note that this is for code I've tweaked to match what the finally code= as much as possible. For a complete implementation of this, I expect the loop transformation done for normal loop should move the whilelt as well so that source code like the following would generate pretty much the same code. ``` void set3(uint32_t *__restrict__ out, size_t m) { auto svelen =3D svcntw(); auto v =3D svdup_u32(1); for (size_t i =3D 0; i < m; i +=3D svelen) { auto pg =3D svwhilelt_b32(i, m); svst1(pg, &out[i], v); } } ``` Currently, while the cmp was moved to the end of the loop body and the loop header, the whilelt that is meant to be paired with it did not so the flag = from the whilelt instruction isn't directly usable as is in the code.=