From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 54D6A3858C3A; Thu, 14 Mar 2024 10:37:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54D6A3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710412647; bh=zrmfTGMf1WaJEPoyd5X3HAAdnYly1aW82coPwXWSlwM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=j81w2018Xx38DFGLKxH2COEjP+vq7sV+3BCZ0cWcieQRxNfvMCsA5Otd2PRMZR/5G r1MwtTrW8TqoplIGbdVm5WDvvOBJWttwdIqCKhlk79wJbQC5u8QZLdSRubYDvRHRRP ZIpeUU9gIpfVdQM/WAqgUGsedURuBHXezMVUgOKQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114324] [13/14 Regression] AVX2 vectorisation performance regression with gfortran 13/14 Date: Thu, 14 Mar 2024 10:37:22 +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: 13.1.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: 13.3 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=3D114324 --- Comment #3 from Richard Biener --- So the missed feature is to implement swapping operands of a MINUS_EXPR during SLP discovery by introducing a conditional negate (for example by multiplying with { 1, -1 } or with two_operator negate, "nop" and blend). Note that with GCC 12 and the +- mixed op we ae able to use vaddsubpd, that's in the end likely the perfect code gen for the testcase. I'm not sure it's easy to get back to that with the "more optimized" scalar IL. I'll note the negate could be also consumed by the constant in the multiplication.=