From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC9B2383B817; Mon, 16 Aug 2021 07:49:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC9B2383B817 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101895] [11/12 Regression] SLP Vectorizer change pushes VEC_PERM_EXPR into bad location spoiling further optimization opportunities Date: Mon, 16 Aug 2021 07:49:36 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status priority cf_gcctarget cf_reconfirmed_on 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, 16 Aug 2021 07:49:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101895 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Priority|P3 |P2 Target| |x86_64-*-* Last reconfirmed| |2021-08-16 --- Comment #2 from Richard Biener --- Confirmed. void foo(float * restrict a, float b, float *c) { a[0] =3D c[0]*b + a[0]; a[1] =3D c[2]*b + a[1]; a[2] =3D c[1]*b + a[2]; a[3] =3D c[3]*b + a[3]; } shows the issue on x86_64 with a lack of an FMA. One complication is that FMA forming is done in a later pass only thus the vectorizer has no guidance to decide on placement of the permute. Note the vectorizer permute optimization propagates in one direction only (but the optimistic pieces), the intent is to reduce the number of permutes which almost exclusively come from loads.=