From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30DAD3861C7B; Tue, 20 Jul 2021 09:41:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30DAD3861C7B From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101523] Huge number of combine attempts Date: Tue, 20 Jul 2021 09:41:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel 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: --- 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: Tue, 20 Jul 2021 09:41:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101523 --- Comment #1 from Andreas Krebbel --- This appears to be triggered by try_combine unnecessarily setting back the position by returning the i2 insn. When 866 is inserted into 973 866 still needs to be kept around for other users. So try_combine first merges the two sets into a parallel and immedia= tely notices that this can't be recognized. Because none of the sets is a trivial move it is split again into two separate insns. Although the new i2 pattern exactly matches the input i2 combine considers this to be a new insn and triggers all the scanning log link creation and eventually returns it what let's the combine start all over at 866. Due to that combine tries many of the substitutions more than 400x. Trying 866 -> 973: 866: r22393:DI=3Dr22391:DI+r22392:DI 973: r22499:DF=3Dr22498:DF*[r22393:DI] REG_DEAD r22498:DF Failed to match this instruction: (parallel [ (set (reg:DF 22499) (mult:DF (reg:DF 22498) (mem:DF (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ])) [17 *_85087+0 S8 A64]))) (set (reg/f:DI 22393 [ _85087 ]) (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ]))) ]) Failed to match this instruction: (parallel [ (set (reg:DF 22499) (mult:DF (reg:DF 22498) (mem:DF (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ])) [17 *_85087+0 S8 A64]))) (set (reg/f:DI 22393 [ _85087 ]) (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ]))) ]) Successfully matched this instruction: (set (reg/f:DI 22393 [ _85087 ]) (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ]))) Successfully matched this instruction: (set (reg:DF 22499) (mult:DF (reg:DF 22498) (mem:DF (plus:DI (reg/f:DI 22391 [ _85085 ]) (reg:DI 22392 [ _85086 ])) [17 *_85087+0 S8 A64]))) allowing combination of insns 866 and 973 original costs 4 + 4 =3D 8 replacement costs 4 + 4 =3D 8 modifying insn i2 866: r22393:DI=3Dr22391:DI+r22392:DI deferring rescan insn with uid =3D 866. modifying insn i3 973: r22499:DF=3Dr22498:DF*[r22391:DI+r22392:DI] REG_DEAD r22498:DF deferring rescan insn with uid =3D 973.=