From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C15503858D35; Thu, 3 Feb 2022 14:51:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C15503858D35 From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104368] New: [12 Regression] Failure to vectorise conditional grouped accesses after PR102659 Date: Thu, 03 Feb 2022 14:51:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rsandifo 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Thu, 03 Feb 2022 14:51:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104368 Bug ID: 104368 Summary: [12 Regression] Failure to vectorise conditional grouped accesses after PR102659 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rsandifo at gcc dot gnu.org Target Milestone: --- The following test regressed with PR102659, compiled with -O3 -march=3Darmv8.2-a+sve: void f(int *restrict x, int *restrict y, int n) { for (int i =3D 0; i < n; ++i) if (x[i] > 0) x[i] =3D y[i * 2] + y[i * 2 + 1]; } Previously we treated the y[] accesses as a linear group and so could use LD2W. Now we treat them as individual gather loads instead: .L3: ld1w z1.s, p0/z, [x0, x3, lsl 2] lsl z0.s, z2.s, #1 cmpgt p0.s, p0/z, z1.s, #0 ld1w z1.s, p0/z, [x1, z0.s, sxtw 2] // Gather ld1w z0.s, p0/z, [x5, z0.s, sxtw 2] // Gather add z0.s, z1.s, z0.s st1w z0.s, p0, [x0, x3, lsl 2] incw z2.s add x3, x3, x4 whilelo p0.s, w3, w2 b.any .L3=