From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6468E3858409; Tue, 10 Oct 2023 11:40:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6468E3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696938025; bh=dOY7t/P9eZBK3jq2nJIPAo4z0b3UWrYwDrhDZEDWOEA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CzhSXHkIR+WD7TwBuv3p1gaDPjMIqCr7PGT8/1ge+3JCYqkoxhfDEsY4Tk1mzGdbo C434US/YWEcgQiJZZxF/Aha9B0XWTN7XGM1BcaiyvtvIC30KoyepzixDYPbjDBNTOT 6j9z7b5xamnGt4GIH8iLZHcuJRuzsBfGOjE7Smfk= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111751] RISC-V: RVV unexpected vectorization Date: Tue, 10 Oct 2023 11:40:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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=3D111751 --- Comment #15 from JuzheZhong --- Also, I find this following case that ARM SVE failed to optimize: https://godbolt.org/z/d6YnneETj #define N 16 typedef int half_word; int foo2 () { int i; half_word ia[N]; half_word ic[N] =3D {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; half_word ib[N] =3D {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Not worthwhile, only 2 parts per int */ for (i =3D 0; i < N; i++) { ia[i] =3D ib[i] + ic[i]; } /* check results: */ for (i =3D 0; i < N; i++) { if (ia[i] !=3D ib[i] + ic[i]) abort (); } return 0; } I guess your approach can fix that for ARM SVE. Maybe ARM SVE can also add this case too.=