From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C30E3858D20; Wed, 27 Mar 2024 16:53:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C30E3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711558381; bh=yd4Wf+1xzvy1ed3ivoZMeGwFthG4+fEe5Rd7TAMiGlY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AvkYRYY+ZtPfZZXbcvBgZ/ros0rL/sSvvzR377kSDiPmaqIEqEY4+PXdEAMA63TnH NAEVBT+Y4srmkpOTfq0A7oAUiZUxPcgR0v6MjPiCd3LRGHgMBR9KIQ+y1yEGfsOKTF cON0bZp12lbhwCJFgz5UsD9CU3jpvglIP819kWVs= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101523] Huge number of combine attempts Date: Wed, 27 Mar 2024 16:53:00 +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: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: segher 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101523 --- Comment #51 from Segher Boessenkool --- (In reply to Richard Biener from comment #46) > Maybe combine already knows that it just "keeps i2" rather than replacing= it? It never does that. Instead, it thinks it is making a new I2, but it ends = up to be exactly the same instruction. This is not a good thing to do, combine can change the whole thing back to the previous shape for example, when it feels like it (combine does not make canonical forms ever!) > When !newi2pat we seem to delete i2. Anyway, somebody more familiar with > combine should produce a good(TM) patch. Yes, the most common combinations delete I2, they combine 2->1 or 3->1 or 4= ->1. When this isn't possible combine tries to combine to two instructions, it h= as various strategies for this: the backend can do it explicitly (via a define_split), or it can break apart the expression that was the src in the one set that w= as the ->1 result, hoping that the two instructions it gets that way are valid insns. It tries only one way to do this, and it isn't very smart about it, just very heuristic.=