From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 56ECE3856DCA; Wed, 4 May 2022 13:12:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56ECE3856DCA From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103116] SLP vectoriser fails to peel for gaps Date: Wed, 04 May 2022 13:12:42 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: 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 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: Wed, 04 May 2022 13:12:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103116 --- Comment #7 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:52b7b86f8c72eb19e637f1e72ffd10f39b8cb829 commit r13-110-g52b7b86f8c72eb19e637f1e72ffd10f39b8cb829 Author: Richard Biener Date: Wed May 4 10:43:07 2022 +0200 tree-optimization/103116 - SLP permutes and peeling for gaps The testcase shows that we can end up with a contiguous access across loop iterations but by means of permutations the elements accessed might only cover parts of a vector. In this case we end up with GROUP_GAP =3D=3D 0 but still need to avoid accessing excess elements in the last loop iterations. Peeling for gaps is designed to cover this but a single scalar iteration might not cover all of the excess elements. The following ensures peeling for gaps is done in this situation and when that isn't sufficient because we need to peel more than one iteration (gcc.dg/vect/pr103116-2.c), fail the SLP vectorization. 2022-05-04 Richard Biener PR tree-optimization/103116 * tree-vect-stmts.cc (get_group_load_store_type): Handle the case we need peeling for gaps even though GROUP_GAP is zero. * gcc.dg/vect/pr103116-1.c: New testcase. * gcc.dg/vect/pr103116-2.c: Likewise.=