From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3234A3858D38; Tue, 7 Feb 2023 14:13:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3234A3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675779184; bh=eSU/3RC6lrbeTz3GateLegxlspOVL78PrXuhd5++0eo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=epXFE+RxoaIIjER59BIJl3ycldBjQcndbB/8/pUCd2USy0xcYlJXjHg6Ebr93k4qj geL7jEsEERTEzUwoPKRu7XS0P+LZKaDzdZZhIDpCDBmXzffIJ+cV4+MaKWMGnrXPyr Tq/zAuELWsSzhVh7lJohoGkB0MagOWDzuw6Vletk= From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108697] constructing a path-range-query is expensive Date: Tue, 07 Feb 2023 14:13:03 +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: 13.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108697 --- Comment #1 from Aldy Hernandez --- Sharing a cache with say the ranger is a no go, because the path_range_quer= y's cache is specific to the path, but perhaps we could share the path's cache between constructions providing a constructor that takes the cache as you suggest. The path query has a bitmap to determine if a cache entry is used (m_has_cache_entry), so I think we could reuse a dirty cache since the bitm= ap gets cleared at construction. I assume the main culprit is the path_range_query's being instantiated from class back_threader? If so, the= re could be one cache per back_threader? Hmmm, perhaps we'd have to call ssa_global_cache::clear_global_range() befo= re each set_global_range() for reused caches otherwise the latter would try to reuse slots (fits_p and all that). Also, is it the clearing part of safe_grow_cleared() that is taking up the time, or just safe_grow. Cause ISTM we don't need to clear the cache for u= se in path_range_query. So we could even add a flag to use safe_grow() instea= d of safe_grow_cleared() for the path query?=