From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5BC5F38582BF; Wed, 6 Mar 2024 07:14:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BC5F38582BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709709275; bh=kHTt/P5Aeluz3PL6OyXjLsQIQzBbwS7bWqyGuCBcEkk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=r3W137V+SoilLeyWZKHOpmGcBr+zA2KIBEK5q5XzCkExWYxBLQTzzBQJWwIjpOeKZ RY13ggWXpJ+BITEIOoMS6ajLnPS/YYuvwzWQE60pNzoRfTB//DPpSpIroWpSPYcZoc Im+h/jUeGYIIfyDZqqn+YwcIW7xQFXu8ktUNMf8w= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114151] [14 Regression] weird and inefficient codegen and addressing modes since r14-9193 Date: Wed, 06 Mar 2024 07:14: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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D114151 --- Comment #10 from Richard Biener --- (In reply to Andrew Macleod from comment #9) > Created attachment 57620 [details] > proposed patch >=20 > Does this solve your problem if there is an active ranger? it bootstraps > with no regressions I'll check what it does. > ITs pretty minimal, and basically we invokes the cache's version of > range_of_expr if there is no context. I tweaked it such that if there is > no context, and the def has not been calculated yet, it calls range_of_de= f, > and combines it with any SSA_NAME_RANGE_INFO that may have pre-existed. = All > without invoking any new lookups. >=20 > This seems relatively harmless and does not spawn new dynamic lookups. = As > long as it resolves your issue... If it still does not work, and we > require the def to actually be evaluated, I will look into that. we prpba= bly > should do that anyway. There appears to be a cycle when this is invoked > from the loop analysis, probably because folding of PHIs uses loop info... > and back and forth we go. Yeah, I ran into this as well. > I'd probably need to add a flag to the ranger > instantiation to tell it to avoid using loop info. I've quickly tried to detect active discovery in SCEV but it wasn't as easy as I thought. > Are we looking to fix this in this release? I think the full evaluation has to wait for stage1 because of that recursion issue. I'm also sure we're going to need ways to _not_ do this, so maybe a clearer separation in the API is warranted. As I see it when you call range_of_expr without context you get the same result as if using the global range query so maybe it should be a different API from the start (the one that is now without context) and range_of_expr without context using a conservative default (the definition point).=