From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E987396EC47; Mon, 14 Jun 2021 20:28:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E987396EC47 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101014] [12 Regression] Big compile time hog with -O3 since r12-1268-g9858cd1a6827ee7a Date: Mon, 14 Jun 2021 20:28:31 +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: 12.0 X-Bugzilla-Keywords: compile-time-hog, needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amacleod at redhat dot com X-Bugzilla-Target-Milestone: 12.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: Mon, 14 Jun 2021 20:28:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101014 --- Comment #4 from Andrew Macleod --- When a range is being calculated for an ssa-name, the propagation process o= ften goes along back edges. These back edges sometime require other ssa-names wh= ich have not be processed yet. These are flagged as "poor values" and when propagation is done, we visit the list of poor values, calculate them, and = see if that may result if a better range for the original ssa-name.=20 The problem is that calculating these poor values may also spawn another se= t of requests since the block at the far end of the back edge has not been proce= ssed yet... its highly likely that some additional unprocessed ssa-names are use= d in the calculation of that name, but typically they do not affect the current range in a significant way.=20 Thus we mostly we care about the first order effect only. It turns out to = be very rare that a 2nd order effect on a back edge affects anything that we d= on't catch later.=20 This patch turns off poor-value tagging when looking up the first order val= ues, thus avoiding the 2nd order and beyond cascading effects. I haven't found a test case we miss yet because of this change, yet it prob= ably resolves a number of the outstanding compilation problems in a significant = way. I think this will probably apply to gcc 11 in some form as well, so I'll lo= ok at an equivalent patch for there.=