From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2D02D3858C1F; Thu, 29 Jun 2023 09:31:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D02D3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688031086; bh=XqN57xADw0+Pmop1wwcSkgPXqai7/EBhZRgC0GLazPs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DFrGnXt9lzmvkflny1G50beQNUiCpA3oUVBGrHldvnhgm2yUui+vunWm337QXp8Q7 a1fkI4Y7zhQVE0y6PbR93iL8AsML292K6wJadXHu8wYg0LwoLWzGLLUovBDvNwgA18 nUmK8Hlge9B7Bukq0s9wvkurKZQZIecqAZTmOOjA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110148] [14 Regression] TSVC s242 regression between g:c0df96b3cda5738afbba3a65bb054183c5cd5530 and g:e4c986fde56a6248f8fbe6cf0704e1da34b055d8 Date: Thu, 29 Jun 2023 09:31:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110148 --- Comment #5 from CVS Commits --- The master branch has been updated by Lili Cui : https://gcc.gnu.org/g:4633e38cd22c5e51fac984124c7627be912d0999 commit r14-2185-g4633e38cd22c5e51fac984124c7627be912d0999 Author: Lili Cui Date: Thu Jun 29 06:51:56 2023 +0000 Avoid adding loop-carried ops to long chains Avoid adding loop-carried ops to long chains, otherwise the whole chain will have dependencies across the loop iteration. Just keep loop-carried ops= in a separate chain. E.g. x_1 =3D phi(x_0, x_2) y_1 =3D phi(y_0, y_2) a + b + c + d + e + x1 + y1 SSA1 =3D a + b; SSA2 =3D c + d; SSA3 =3D SSA1 + e; SSA4 =3D SSA3 + SSA2; SSA5 =3D x1 + y1; SSA6 =3D SSA4 + SSA5; With the patch applied, these test cases improved by 32%~100%. S242: for (int i =3D 1; i < LEN_1D; ++i) { a[i] =3D a[i - 1] + s1 + s2 + b[i] + c[i] + d[i];} Case 1: for (int i =3D 1; i < LEN_1D; ++i) { a[i] =3D a[i - 1] + s1 + s2 + b[i] + c[i] + d[i] + e[i];} Case 2: for (int i =3D 1; i < LEN_1D; ++i) { a[i] =3D a[i - 1] + b[i - 1] + s1 + s2 + b[i] + c[i] + d[i] + e[i];} The value is the execution time A: original version B: with FMA patch g:e5405f065bace0685cb3b8878d1dfc7a6e7ef409(base on A) C: with current patch(base on B) A B C B/A C/A s242 2.859 5.152 2.859 1.802028681 1 case 1 5.489 5.488 3.511 0.999818 0.64 case 2 7.216 7.499 4.885 1.039218 0.68 gcc/ChangeLog: PR tree-optimization/110148 * tree-ssa-reassoc.cc (rewrite_expr_tree_parallel): Handle loop-carried ops in this function.=