From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 71F8E3858C53; Thu, 29 Feb 2024 18:15:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71F8E3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709230509; bh=FPvAii1HXrWDyhTKfP80VB5Ad3HNNKZOVItuekRcwa4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mWSwMrVezldCWEEioSKvsI7c+xG5A0sDAVxTaWtnffbxKqI8kXNoEaWoPlMRAQEf8 WjyashYvTptPkJWpPwR8cP6m/bKvlQl3eVsthI44g5KQGB/egzDQQsT6Uc4pu91sgV 7yJX9l1bB2t3sG1rBHZz/FsyH5Fe93sCagLAt1bQ= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114151] [14 Regression] weird and inefficient codegen and addressing modes since g:a0b1798042d033fd2cc2c806afbb77875dd2909b Date: Thu, 29 Feb 2024 18:15:08 +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: amacleod at redhat dot com 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 #5 from Andrew Macleod --- (In reply to rguenther@suse.de from comment #4) >=20 > What was definitely missing is consideration of POLY_INT_CSTs (and > variable polys, as I think there's no range info for those). >=20 Ranger doesn't do anything with POLY_INTs, mostly because I didn't understa= nd them.=20=20 > We do eventually want to improve how ranger behaves here. I'm not sure > why when we do not provide a context 'stmt' it can't see to compute > a range valid at the SSA names point of definition? (so basically > compute the global range) The call looks like it doesn't provide the stmt. Without the stmt, all ran= ger will ever provide is global ranges. I think you are asking why, If there is no global range, it doesn't try to compute one from the ssa_name_def_stmt? Ranger does when it is active.=20= =20 Otherwise it simply picks up the global information from SSA_NAME_RANGE_INF= O()=20 Of course, if its a poly int, we don't actually support those... so all y= ou will ever see is VARYING. Again, because I don't understand them. > Maybe there's another API to do that. But I thought it was convenient > to use range_of_expr as that also handles GENERIC expression trees > to some extent and those are common within SCEV. A range can always be calculated by simply calling fold_range from gimple-range-fold.h: // Fold stmt S into range R using range query Q. bool fold_range (vrange &r, gimple *s, range_query *q =3D NULL); if range_query is not provided, it'll simply use the current one. If you = want to ensure its only global ranges, you call it with fold_range (r, SSA_NAME_DEF_STMT (name), get_global_range_query ());=