From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39B6C3971C2B; Wed, 27 Jan 2021 14:22:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39B6C3971C2B From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98854] [11 Regression] cray benchmark is about 15% slower since r11-4428-g4a369d199bf2f34e Date: Wed, 27 Jan 2021 14:22:35 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 11.0 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, 27 Jan 2021 14:22:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98854 --- Comment #4 from Richard Biener --- Little bit convoluted testcase: double a[1024]; int bar(); void foo (int n) { double x =3D 0, y =3D 0; int i =3D 1023; do { x +=3D a[i] + a[i+1]; y +=3D a[i] / a[i+1]; if (bar ()) break; } while (--i); a[0] =3D x; a[1] =3D y; } where we end up with the {x, y} vector CTOR inside the loop (and even spill/reload it because of the call). We have a PHI node-only feed for the vectorized store: t.c:16:8: note: Vectorizing SLP tree: t.c:16:8: note: node 0x3b21ee0 (max_nunits=3D2, refcnt=3D1) t.c:16:8: note: op template: a[0] =3D x_22; t.c:16:8: note: stmt 0 a[0] =3D x_22; t.c:16:8: note: stmt 1 a[1] =3D y_21; t.c:16:8: note: children 0x3b21f68 t.c:16:8: note: node 0x3b21f68 (max_nunits=3D2, refcnt=3D1) t.c:16:8: note: op template: x_22 =3D PHI t.c:16:8: note: stmt 0 x_22 =3D PHI t.c:16:8: note: stmt 1 y_21 =3D PHI t.c:16:8: note: children 0x3b21ff0 0x3b22210 t.c:16:8: note: node 0x3b21ff0 (max_nunits=3D2, refcnt=3D1) t.c:16:8: note: op template: x_26 =3D PHI t.c:16:8: note: stmt 0 x_26 =3D PHI t.c:16:8: note: stmt 1 y_24 =3D PHI t.c:16:8: note: children 0x3b22320 t.c:16:8: note: node (external) 0x3b22320 (max_nunits=3D1, refcnt=3D1) t.c:16:8: note: { x_14, y_15 } t.c:16:8: note: node 0x3b22210 (max_nunits=3D2, refcnt=3D1) t.c:16:8: note: op template: x_25 =3D PHI t.c:16:8: note: stmt 0 x_25 =3D PHI t.c:16:8: note: stmt 1 y_23 =3D PHI t.c:16:8: note: children 0x3b223a8 t.c:16:8: note: node (external) 0x3b223a8 (max_nunits=3D1, refcnt=3D1) t.c:16:8: note: { x_14, y_15 } fixing this issue fixes the slowdown. Testing a patch.=