From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98FD3385696F; Wed, 26 Apr 2023 19:26:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98FD3385696F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682537176; bh=AXahyl6nszdH/Cz0hEL2y5nc+9JHlKTE1I+4NhBuRDY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wpmnoQuwkrjwaouBvkYuLEAfRepo74hK9/yMAbjSiGVyuc0N4UR/PLJCXNQ6QwpXj 7Hp4Xzk4cL/7ZsF0czfGey1Cw6+qr7fDZj4bb9VnIErZVou1YnBqH+wc+HD6bByw4K /ob1bWH8JWY5PjvAm/lb/wC196IApaP8RWGSPu5E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108697] constructing a path-range-query is expensive Date: Wed, 26 Apr 2023 19:26:13 +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: cvs-commit 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 #7 from CVS Commits --- The master branch has been updated by Andrew Macleod : https://gcc.gnu.org/g:0a38f677463ff8a4fb61b049263aa596ef6471a7 commit r14-275-g0a38f677463ff8a4fb61b049263aa596ef6471a7 Author: Andrew MacLeod Date: Tue Mar 28 11:35:26 2023 -0400 Create a lazy ssa_cache. Sparsely used ssa caches can benefit from using a bitmap to determine if a name already has an entry. Utilize it in the path query and remove its private bitmap for tracking the same info. Also use it in the "assume" query class. PR tree-optimization/108697 * gimple-range-cache.cc (ssa_global_cache::clear_range): Do not clear the vector on an out of range query. (ssa_cache::dump): Use dump_range_query instead of get_range. (ssa_cache::dump_range_query): New. (ssa_lazy_cache::dump_range_query): New. (ssa_lazy_cache::set_range): New. * gimple-range-cache.h (ssa_cache::dump_range_query): New. (class ssa_lazy_cache): New. (ssa_lazy_cache::ssa_lazy_cache): New. (ssa_lazy_cache::~ssa_lazy_cache): New. (ssa_lazy_cache::get_range): New. (ssa_lazy_cache::clear_range): New. (ssa_lazy_cache::clear): New. (ssa_lazy_cache::dump): New. * gimple-range-path.cc (path_range_query::path_range_query): Do not allocate a ssa_cache object nor has_cache bitmap. (path_range_query::~path_range_query): Do not free objects. (path_range_query::clear_cache): Remove. (path_range_query::get_cache): Adjust. (path_range_query::set_cache): Remove. (path_range_query::dump): Don't call through a pointer. (path_range_query::internal_range_of_expr): Set cache directly. (path_range_query::reset_path): Clear cache directly. (path_range_query::ssa_range_in_phi): Fold with globals only. (path_range_query::compute_ranges_in_phis): Simply set range. (path_range_query::compute_ranges_in_block): Call cache directl= y. * gimple-range-path.h (class path_range_query): Replace bitmap and cache pointer with lazy cache object. * gimple-range.h (class assume_query): Use ssa_lazy_cache.=