From patchwork Thu May 23 20:53:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1938585 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TDzBNZhd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VlgQZ5lxRz20Q0 for ; Fri, 24 May 2024 06:54:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 148ED3865C29 for ; Thu, 23 May 2024 20:54:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 017FE3858CD1 for ; Thu, 23 May 2024 20:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 017FE3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 017FE3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716497622; cv=none; b=m50ObaoDbhFtChnNHAKd4aEVnTFPHf7TwA8+16ZOc7iWqixnOy+ml59cyK0p3qXYhQN6gsDCjotOum3SNQVvyZKtc78EPqIP7rd4ZJzJ7FYVD0DfOmh3g10XsW2VqSvJK2UjPsuPYBANgTG8dUZzoV6geLmHxOAUfyBi7HkBIFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716497622; c=relaxed/simple; bh=SBovPFEpcedf8o08+vBzvDfmKjwY9zZBxEuKU8GmIGU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=nh3h8M7V/Y4jVLPfRQFBqQr6qnsth1DZi+hFe/6FTpPMtsENLyrIMqUp5qVNawiyiQvrIvawIu4Y2dBvbrByLeaaNbsNgmwRi0iF76AGWwqkKugIpa0RV42MVMFHtslDKgavo6/aXiqXyF3w35AoBO4YR+gu1JWoJU53kFG81zo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716497615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=PinOpLP9D+/f+qlEV6EQjiZtf+vHW7UaFCYUZy35djE=; b=TDzBNZhdWxd64WaQqPCj6LhXpOH6zmWlc2KHmi2u59xJ0SnVQYSBXd5idZrycUEIgifaR1 5oq/pLoA0km18IURl2fkFF+NvL/ZPmwM1WDmefXg+JnXgZQhJP7k/ZzJtomRHjmkSjw3Tq UdkZ6v4RBzFCSMKvAYaJ6TGr1bHPFTw= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-4gkiYuyENEOVxQLjg40gdw-1; Thu, 23 May 2024 16:53:32 -0400 X-MC-Unique: 4gkiYuyENEOVxQLjg40gdw-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-792c2650197so76396085a.0 for ; Thu, 23 May 2024 13:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716497611; x=1717102411; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=745UX0RJywIiTQapxoRA3aAUHhEvAYbPuYrCgRhujqo=; b=gseBMKzThr+pxXBaVOE0qnUxJIHlVJ3CwecFCXBZyVBiiibBcXw9YFy8ZxQEgYqL66 av33Qg4fYM8+qTYnV6c46WvIEdTbCCK/XwoI81xNGQRn5UtHG308OvahJZ6c+/MK6o+a aoDuQidZDTxJLAS493g4VuA29JeuI42i2ay2lqeDrw3AO/iNYiXccAzVZO+r7cLQlfUp IWgXYiO4OPmj6mg0kf21vN6/IkNL6ttrvMZjuKUnuHer/5D4uJUua7o2ag3v6F9AjoXS ZyKh59mjOpBLXm6XFQAFwL5FIumehAAEGSeVvcmEKmTFh5WQv5RC33F0opzualuUgjI2 hyAQ== X-Gm-Message-State: AOJu0YwK7/qJ/NYaxYuZWvg/VhXIVUofynnAtRWCAAMCjsUqfK7HNqT1 Ms1F5xABJgmNDJe264F9a+eEv0nEQepm/RipIdnnjQvKinc5UqHynwllhAr27Lgpey+qieDUGBU j3TItCdmcGL+1H+8l06dje1M6UwVdxI/h66vQOSmtZ9C3MQY6nr7yIN4UZqacU/G71nHv2LiALi /QK5bhOKEP9uMygfeJjk2n0PdExIfwAzQr9efey+I= X-Received: by 2002:a05:620a:3604:b0:792:ea76:27d3 with SMTP id af79cd13be357-794ab13dd9dmr37296785a.63.1716497611379; Thu, 23 May 2024 13:53:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiHAYF/z/rpgwIe+1L7rAA8jViMtF/GNAL+UO+jlAAgwvQXKAKmZgLSb+h+Y1C0FisZk+3Uw== X-Received: by 2002:a05:620a:3604:b0:792:ea76:27d3 with SMTP id af79cd13be357-794ab13dd9dmr37294185a.63.1716497610765; Thu, 23 May 2024 13:53:30 -0700 (PDT) Received: from [192.168.0.174] ([104.219.121.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-794abd48978sm202985a.132.2024.05.23.13.53.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 13:53:30 -0700 (PDT) Message-ID: <336edc4c-d589-49e4-a879-3de7f533c65d@redhat.com> Date: Thu, 23 May 2024 16:53:29 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: gcc-patches Cc: "hernandez, aldy" From: Andrew MacLeod Subject: [COMMITTED 08/12] - Gori_compute no longer inherits from gori_map. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org This patch moves the gori_compute object away from inheriting a gori_map object and instead it as a local member.  Export it via map (). The gori_map object contains all the SSA name dependencies and import/export name lists for blocks.  GORI was inheriting from this originally as a convenient way to share the data, but it doesn't really belong there.  it is really a component that is used by GORI rather than part of what it is.  This more accurately reflects the relationship. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. From 9b42fafa0ec385bbc86be1d9f1a86c140e1045c3 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 9 May 2024 14:14:31 -0400 Subject: [PATCH 08/12] Gori_compute no longer inherits from gori_map. This patch moves the gori_compute object away from inheriting a gori_map object and instead it as a local member. Export it via map (). * gimple-range-cache.cc (ranger_cache::ranger_cache): Access gori_map via member call. (ranger_cache::dump_bb): Likewise. (ranger_cache::get_global_range): Likewise. (ranger_cache::set_global_range): Likewise. (ranger_cache::register_inferred_value): Likewise. * gimple-range-fold.cc (fold_using_range::range_of_range_op): Likewise. (fold_using_range::range_of_address): Likewise. (fold_using_range::range_of_phi): Likewise. * gimple-range-gori.cc (gori_compute::compute_operand_range_switch): likewise. (gori_compute::compute_operand_range): Likewise. (gori_compute::compute_logical_operands): Likewise. (gori_compute::refine_using_relation): Likewise. (gori_compute::compute_operand1_and_operand2_range): Likewise. (gori_compute::may_recompute_p): Likewise. (gori_compute::has_edge_range_p): Likewise. (gori_compute::outgoing_edge_range_p): Likewise. (gori_compute::condexpr_adjust): Likewise. * gimple-range-gori.h (class gori_compute): Do not inherit from gori_map. (gori_compute::m_map): New. * gimple-range-path.cc (gimple-range-path.cc): Use gori_map member. (path_range_query::compute_exit_dependencies): Likewise. * gimple-range.cc (gimple_ranger::range_of_stmt): Likewise. (gimple_ranger::register_transitive_inferred_ranges): Likewise. * tree-ssa-dom.cc (set_global_ranges_from_unreachable_edges): Likewise. * tree-ssa-threadedge.cc (hybrid_jt_simplifier::compute_exit_dependencies): Likewise. * tree-vrp.cc (remove_unreachable::handle_early): Likewise. (remove_unreachable::remove_and_update_globals): Likewise. --- gcc/gimple-range-cache.cc | 16 ++++++------- gcc/gimple-range-fold.cc | 12 +++++----- gcc/gimple-range-gori.cc | 47 +++++++++++++++++++------------------- gcc/gimple-range-gori.h | 4 +++- gcc/gimple-range-path.cc | 6 ++--- gcc/gimple-range.cc | 6 ++--- gcc/tree-ssa-dom.cc | 2 +- gcc/tree-ssa-threadedge.cc | 2 +- gcc/tree-vrp.cc | 9 ++++---- 9 files changed, 54 insertions(+), 50 deletions(-) diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 34dc9c4a3ec..c52475852a9 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -969,7 +969,7 @@ ranger_cache::ranger_cache (int not_executable_flag, bool use_imm_uses) { basic_block bb = BASIC_BLOCK_FOR_FN (cfun, x); if (bb) - m_gori.exports (bb); + m_gori.map ()->exports (bb); } m_update = new update_list (); } @@ -1000,7 +1000,7 @@ ranger_cache::dump (FILE *f) void ranger_cache::dump_bb (FILE *f, basic_block bb) { - m_gori.gori_map::dump (f, bb, false); + m_gori.map ()->dump (f, bb, false); m_on_entry.dump (f, bb); m_relation->dump (f, bb); } @@ -1033,8 +1033,8 @@ ranger_cache::get_global_range (vrange &r, tree name, bool ¤t_p) current_p = false; if (had_global) current_p = r.singleton_p () - || m_temporal->current_p (name, m_gori.depend1 (name), - m_gori.depend2 (name)); + || m_temporal->current_p (name, m_gori.map ()->depend1 (name), + m_gori.map ()->depend2 (name)); else { // If no global value has been set and value is VARYING, fold the stmt @@ -1071,8 +1071,8 @@ ranger_cache::set_global_range (tree name, const vrange &r, bool changed) if (!changed) { // If there are dependencies, make sure this is not out of date. - if (!m_temporal->current_p (name, m_gori.depend1 (name), - m_gori.depend2 (name))) + if (!m_temporal->current_p (name, m_gori.map ()->depend1 (name), + m_gori.map ()->depend2 (name))) m_temporal->set_timestamp (name); return; } @@ -1097,7 +1097,7 @@ ranger_cache::set_global_range (tree name, const vrange &r, bool changed) if (r.singleton_p () || (POINTER_TYPE_P (TREE_TYPE (name)) && r.nonzero_p ())) - m_gori.set_range_invariant (name); + m_gori.map ()->set_range_invariant (name); m_temporal->set_timestamp (name); } @@ -1783,7 +1783,7 @@ ranger_cache::register_inferred_value (const vrange &ir, tree name, m_on_entry.set_bb_range (name, bb, r); // If this range was invariant before, remove invariant. if (!m_gori.has_edge_range_p (name)) - m_gori.set_range_invariant (name, false); + m_gori.map ()->set_range_invariant (name, false); } } diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 9e9c5960972..b626855c51a 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -747,7 +747,7 @@ fold_using_range::range_of_range_op (vrange &r, if (lhs && gimple_range_ssa_p (op1)) { if (src.gori ()) - src.gori ()->register_dependency (lhs, op1); + src.gori ()->map ()->register_dependency (lhs, op1); relation_kind rel; rel = handler.lhs_op1_relation (r, range1, range1); if (rel != VREL_VARYING) @@ -775,8 +775,8 @@ fold_using_range::range_of_range_op (vrange &r, { if (src.gori ()) { - src.gori ()->register_dependency (lhs, op1); - src.gori ()->register_dependency (lhs, op2); + src.gori ()->map ()->register_dependency (lhs, op1); + src.gori ()->map ()->register_dependency (lhs, op2); } if (gimple_range_ssa_p (op1)) { @@ -845,7 +845,7 @@ fold_using_range::range_of_address (prange &r, gimple *stmt, fur_source &src) tree ssa = TREE_OPERAND (base, 0); tree lhs = gimple_get_lhs (stmt); if (lhs && gimple_range_ssa_p (ssa) && src.gori ()) - src.gori ()->register_dependency (lhs, ssa); + src.gori ()->map ()->register_dependency (lhs, ssa); src.get_operand (r, ssa); range_cast (r, TREE_TYPE (gimple_assign_rhs1 (stmt))); @@ -952,7 +952,7 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src) r.union_ (arg_range); if (gimple_range_ssa_p (arg) && src.gori ()) - src.gori ()->register_dependency (phi_def, arg); + src.gori ()->map ()->register_dependency (phi_def, arg); } // Track if all arguments are the same. @@ -1353,7 +1353,7 @@ fur_source::register_outgoing_edges (gcond *s, irange &lhs_range, // leading to the condition such as: // c_2 = a_4 < b_7 // if (c_2) - FOR_EACH_GORI_EXPORT_NAME (*(gori ()), bb, name) + FOR_EACH_GORI_EXPORT_NAME (*(gori ()->map ()), bb, name) { if (TREE_CODE (TREE_TYPE (name)) != BOOLEAN_TYPE) continue; diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 9afc7c1c19c..fa4a235f08b 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -589,7 +589,7 @@ gori_compute::compute_operand_range_switch (vrange &r, gswitch *s, } // If op1 is in the definition chain, pass lhs back. - if (gimple_range_ssa_p (op1) && in_chain_p (name, op1)) + if (gimple_range_ssa_p (op1) && m_map.in_chain_p (name, op1)) return compute_operand_range (r, SSA_NAME_DEF_STMT (op1), lhs, name, src); return false; @@ -646,8 +646,8 @@ gori_compute::compute_operand_range (vrange &r, gimple *stmt, // NAME is not in this stmt, but one of the names in it ought to be // derived from it. - bool op1_in_chain = op1 && in_chain_p (name, op1); - bool op2_in_chain = op2 && in_chain_p (name, op2); + bool op1_in_chain = op1 && m_map.in_chain_p (name, op1); + bool op2_in_chain = op2 && m_map.in_chain_p (name, op2); // If neither operand is derived, then this stmt tells us nothing. if (!op1_in_chain && !op2_in_chain) @@ -658,9 +658,9 @@ gori_compute::compute_operand_range (vrange &r, gimple *stmt, // Instead just evaluate the one operand. if (op1_in_chain && op2_in_chain) { - if (in_chain_p (op1, op2) || op1 == op2) + if (m_map.in_chain_p (op1, op2) || op1 == op2) op1_in_chain = false; - else if (in_chain_p (op2, op1)) + else if (m_map.in_chain_p (op2, op1)) op2_in_chain = false; } @@ -675,11 +675,11 @@ gori_compute::compute_operand_range (vrange &r, gimple *stmt, // a) both elements are in the defchain // c = x > y // (x and y are in c's defchain) if (op1_in_chain) - res = in_chain_p (vrel_ptr->op1 (), op1) - && in_chain_p (vrel_ptr->op2 (), op1); + res = m_map.in_chain_p (vrel_ptr->op1 (), op1) + && m_map.in_chain_p (vrel_ptr->op2 (), op1); if (!res && op2_in_chain) - res = in_chain_p (vrel_ptr->op1 (), op2) - || in_chain_p (vrel_ptr->op2 (), op2); + res = m_map.in_chain_p (vrel_ptr->op1 (), op2) + || m_map.in_chain_p (vrel_ptr->op2 (), op2); if (!res) { // or b) one relation element is in the defchain of the other and the @@ -955,7 +955,7 @@ gori_compute::compute_logical_operands (vrange &true_range, vrange &false_range, { gimple *stmt = handler.stmt (); gimple *src_stmt = gimple_range_ssa_p (op) ? SSA_NAME_DEF_STMT (op) : NULL; - if (!op_in_chain || !src_stmt || chain_import_p (handler.lhs (), op)) + if (!op_in_chain || !src_stmt || m_map.chain_import_p (handler.lhs (), op)) { // If op is not in the def chain, or defined in this block, // use its known value on entry to the block. @@ -1018,9 +1018,9 @@ gori_compute::refine_using_relation (tree op1, vrange &op1_range, return false; bool change = false; - bool op1_def_p = in_chain_p (op2, op1); + bool op1_def_p = m_map.in_chain_p (op2, op1); if (!op1_def_p) - if (!in_chain_p (op1, op2)) + if (!m_map.in_chain_p (op1, op2)) return false; tree def_op = op1_def_p ? op1 : op2; @@ -1304,8 +1304,8 @@ gori_compute::compute_operand1_and_operand2_range (vrange &r, bool gori_compute::may_recompute_p (tree name, basic_block bb, int depth) { - tree dep1 = depend1 (name); - tree dep2 = depend2 (name); + tree dep1 = m_map.depend1 (name); + tree dep2 = m_map.depend2 (name); // If the first dependency is not set, there is no recomputation. // Dependencies reflect original IL, not current state. Check if the @@ -1327,7 +1327,8 @@ gori_compute::may_recompute_p (tree name, basic_block bb, int depth) gcc_checking_assert (depth >= 1); } - bool res = (bb ? is_export_p (dep1, bb) : is_export_p (dep1)); + bool res = (bb ? m_map.is_export_p (dep1, bb) + : m_map.is_export_p (dep1)); if (res || depth <= 1) return res; // Check another level of recomputation. @@ -1335,9 +1336,9 @@ gori_compute::may_recompute_p (tree name, basic_block bb, int depth) } // Two dependencies terminate the depth of the search. if (bb) - return is_export_p (dep1, bb) || is_export_p (dep2, bb); + return m_map.is_export_p (dep1, bb) || m_map.is_export_p (dep2, bb); else - return is_export_p (dep1) || is_export_p (dep2); + return m_map.is_export_p (dep1) || m_map.is_export_p (dep2); } // Return TRUE if NAME can be recomputed on edge E. If any direct dependent @@ -1359,10 +1360,10 @@ gori_compute::has_edge_range_p (tree name, basic_block bb) { // Check if NAME is an export or can be recomputed. if (bb) - return is_export_p (name, bb) || may_recompute_p (name, bb); + return m_map.is_export_p (name, bb) || may_recompute_p (name, bb); // If no block is specified, check for anywhere in the IL. - return is_export_p (name) || may_recompute_p (name); + return m_map.is_export_p (name) || may_recompute_p (name); } // Return TRUE if a range can be calculated or recomputed for NAME on edge E. @@ -1402,7 +1403,7 @@ gori_compute::outgoing_edge_range_p (vrange &r, edge e, tree name, fur_stmt src (stmt, &q); // If NAME can be calculated on the edge, use that. - if (is_export_p (name, e->src)) + if (m_map.is_export_p (name, e->src)) { bool res; if ((idx = tracer.header ("outgoing_edge"))) @@ -1526,13 +1527,13 @@ gori_compute::condexpr_adjust (vrange &r1, vrange &r2, gimple *, tree cond, } // Now solve for SSA1 or SSA2 if they are in the dependency chain. - if (ssa1 && in_chain_p (ssa1, cond_name)) + if (ssa1 && m_map.in_chain_p (ssa1, cond_name)) { Value_Range tmp1 (TREE_TYPE (ssa1)); if (compute_operand_range (tmp1, def_stmt, cond_true, ssa1, src)) r1.intersect (tmp1); } - if (ssa2 && in_chain_p (ssa2, cond_name)) + if (ssa2 && m_map.in_chain_p (ssa2, cond_name)) { Value_Range tmp2 (TREE_TYPE (ssa2)); if (compute_operand_range (tmp2, def_stmt, cond_false, ssa2, src)) @@ -1555,7 +1556,7 @@ gori_compute::condexpr_adjust (vrange &r1, vrange &r2, gimple *, tree cond, void gori_compute::dump (FILE *f) { - gori_map::dump (f); + m_map.gori_map::dump (f); } // ------------------------------------------------------------------------ diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h index 8f08e9a088a..ae857ecb2b5 100644 --- a/gcc/gimple-range-gori.h +++ b/gcc/gimple-range-gori.h @@ -161,7 +161,7 @@ private: class value_relation; -class gori_compute : public gori_map +class gori_compute { public: gori_compute (int not_executable_flag = 0); @@ -174,7 +174,9 @@ public: bool compute_operand_range (vrange &r, gimple *stmt, const vrange &lhs, tree name, class fur_source &src, value_relation *rel = NULL); + gori_map *map () { return &m_map; } private: + gori_map m_map; bool refine_using_relation (tree op1, vrange &op1_range, tree op2, vrange &op2_range, fur_source &src, relation_kind k); diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index b35ab43524b..5043c00d482 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -410,7 +410,7 @@ path_range_query::compute_ranges_in_block (basic_block bb) } gori_compute &g = m_ranger.gori (); - bitmap exports = g.exports (bb); + bitmap exports = g.map()->exports (bb); EXECUTE_IF_AND_IN_BITMAP (m_exit_dependencies, exports, 0, i, bi) { tree name = ssa_name (i); @@ -488,7 +488,7 @@ path_range_query::compute_exit_dependencies (bitmap dependencies) // Start with the imports from the exit block... basic_block exit = m_path[0]; gori_compute &gori = m_ranger.gori (); - bitmap_copy (dependencies, gori.imports (exit)); + bitmap_copy (dependencies, gori.map()->imports (exit)); auto_vec worklist (bitmap_count_bits (dependencies)); bitmap_iterator bi; @@ -536,7 +536,7 @@ path_range_query::compute_exit_dependencies (bitmap dependencies) { basic_block bb = m_path[i]; tree name; - FOR_EACH_GORI_EXPORT_NAME (gori, bb, name) + FOR_EACH_GORI_EXPORT_NAME (*(gori.map ()), bb, name) if (TREE_CODE (TREE_TYPE (name)) == BOOLEAN_TYPE) bitmap_set_bit (dependencies, SSA_NAME_VERSION (name)); } diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index efc84dc3b44..e7e6fd86581 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -310,7 +310,7 @@ gimple_ranger::range_of_stmt (vrange &r, gimple *s, tree name) // Update any exports in the cache if this is a gimple cond statement. tree exp; basic_block bb = gimple_bb (s); - FOR_EACH_GORI_EXPORT_NAME (m_cache.m_gori, bb, exp) + FOR_EACH_GORI_EXPORT_NAME (*(m_cache.m_gori.map ()), bb, exp) m_cache.propagate_updated_value (exp, bb); } } @@ -540,8 +540,8 @@ gimple_ranger::register_transitive_inferred_ranges (basic_block bb) // an inferred range as well. Value_Range r (TREE_TYPE (lhs)); r.set_undefined (); - tree name1 = gori ().depend1 (lhs); - tree name2 = gori ().depend2 (lhs); + tree name1 = gori ().map () ->depend1 (lhs); + tree name2 = gori ().map ()->depend2 (lhs); if ((name1 && infer_oracle ().has_range_p (bb, name1)) || (name2 && infer_oracle ().has_range_p (bb, name2))) { diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc index 73264852ebd..81c8b16fd12 100644 --- a/gcc/tree-ssa-dom.cc +++ b/gcc/tree-ssa-dom.cc @@ -1431,7 +1431,7 @@ dom_opt_dom_walker::set_global_ranges_from_unreachable_edges (basic_block bb) tree name; gori_compute &gori = m_ranger->gori (); - FOR_EACH_GORI_EXPORT_NAME (gori, pred_e->src, name) + FOR_EACH_GORI_EXPORT_NAME (*(gori.map()), pred_e->src, name) if (all_uses_feed_or_dominated_by_stmt (name, stmt) // The condition must post-dominate the definition point. && (SSA_NAME_IS_DEFAULT_DEF (name) diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc index 2bae82a074b..f5268d45516 100644 --- a/gcc/tree-ssa-threadedge.cc +++ b/gcc/tree-ssa-threadedge.cc @@ -1449,7 +1449,7 @@ hybrid_jt_simplifier::compute_exit_dependencies (bitmap dependencies, gori_compute &gori = m_ranger->gori (); // Start with the imports to the final conditional. - bitmap_copy (dependencies, gori.imports (path[0])); + bitmap_copy (dependencies, gori.map ()->imports (path[0])); // Add any other interesting operands we may have missed. if (gimple_bb (stmt) != path[0]) diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index a36c08f469a..be9df39f680 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -210,14 +210,14 @@ remove_unreachable::handle_early (gimple *s, edge e) // Check if every export use is dominated by this branch. tree name; - FOR_EACH_GORI_EXPORT_NAME (m_ranger.gori (), e->src, name) + FOR_EACH_GORI_EXPORT_NAME (*(m_ranger.gori ().map ()), e->src, name) { if (!fully_replaceable (name, e->src)) return; } // Set the global value for each. - FOR_EACH_GORI_EXPORT_NAME (m_ranger.gori (), e->src, name) + FOR_EACH_GORI_EXPORT_NAME (*(m_ranger.gori ().map ()), e->src, name) { Value_Range r (TREE_TYPE (name)); m_ranger.range_on_entry (r, e->dest, name); @@ -287,7 +287,7 @@ remove_unreachable::remove_and_update_globals () gcc_checking_assert (gimple_code (s) == GIMPLE_COND); bool dominate_exit_p = true; - FOR_EACH_GORI_EXPORT_NAME (m_ranger.gori (), e->src, name) + FOR_EACH_GORI_EXPORT_NAME (*(m_ranger.gori ().map ()), e->src, name) { // Ensure the cache is set for NAME in the succ block. Value_Range r(TREE_TYPE (name)); @@ -304,7 +304,8 @@ remove_unreachable::remove_and_update_globals () // If the exit is dominated, add to the export list. Otherwise if this // isn't the final VRP pass, leave the call in the IL. if (dominate_exit_p) - bitmap_ior_into (all_exports, m_ranger.gori ().exports (e->src)); + bitmap_ior_into (all_exports, + m_ranger.gori ().map ()->exports (e->src)); else if (!final_p) continue; -- 2.41.0