From patchwork Thu May 23 20:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1938589 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=F0KukrOw; 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 4VlgRY2sM2z20KL for ; Fri, 24 May 2024 06:55:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A33573846459 for ; Thu, 23 May 2024 20:55:19 +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 EC6573865C2B for ; Thu, 23 May 2024 20:53:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC6573865C2B 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 EC6573865C2B 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=1716497595; cv=none; b=CIZn14+wJlAz0GEX/3AcUJYLNfRYbXJlPShMhtXHrdoAAoLCJMwNRsKHlZdAZpW8HFUjHOI+EgDjJtqI/BiO4DXV7AooE4jMoXCuVmoTrZnCFIFJ1onJoK2K2U6fEmCyOL0DA5tNWFa0fFeV3jfiCNfODvxa/UbA/bi80YprFIU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716497595; c=relaxed/simple; bh=aOuNtZkojhUqP/NpZyDFUvfAJTmrMbNqEIJoazz4KLs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=QIbrHfNzLXSXysc2t3kvyFHhs1r0KNmKl+qDNVvAxmmxHK2RD2oYB/NaHGHZm49UFxeSjgPXUkpF+Wq6hErgGzJfLlcMBu7ew5weg01t4goPb2LDzmSnfIvsH2x0E0PEz8J4Weqw8dwh5vOh07Mt64vrVcti76fZ/KL/yQNEypA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716497591; 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=u5nm1eW+Vhy97En9o+LNMx/EN/emw+ZTPMv3ansEHbg=; b=F0KukrOw8NZXOcRm3NhJzP/1nI5wHv3nGyVmsUWkf+6Vc3wPeMTKlRqLXnnhCApBAJTLs2 lcfd8YVIS+v2/rW2uXYDPVXqxJM3vPZRXvSrP8JL4Bm0gZ6uJXQHza3GDbCWfcNzMFCIRP rkP99PVCHKetqLVVLVcYtxZfwyRaHz8= Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-299-4bJMoGmHOdCoWD1hN-VUqQ-1; Thu, 23 May 2024 16:53:09 -0400 X-MC-Unique: 4bJMoGmHOdCoWD1hN-VUqQ-1 Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-6f1190504b8so1971488a34.1 for ; Thu, 23 May 2024 13:53:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716497588; x=1717102388; 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=IWMQoT2dSkKvjHdRoQNjpkTr/qPRmkBBl3axOiTORu0=; b=Vb7Mo25Op1812VVSh56Fw2mZrQjCeA6gX3ZaH8v5OWSuahMPgYw3gWvjTxwFWD3aGK A3sMDWJ1lUAx83pvfN7Md7qeQ/shFW2os7gOSt5OHYIYQlUk7W0XA1tLXYezA+d2xxoB d7n2fk9wvFRpFVLXHq073BcNEbKGtFXNPund6anO4LTvyEKroTNm2MCAI/oYecZ0/M7I QbKCE1x1sR8SaAPpZc2k6oUNfqm0YxcYGKssvUUntGhDRBmOzWBI0cEWWap06W8/SclD 6VoDMTxVl5VIsgb5HSU78LYSFoVC2XUYrxMn+P17mAWYjd/bP+7Ep8Qs3UnhEluPv1LY JipQ== X-Gm-Message-State: AOJu0YzUJY///kKcIUMonFrxRzphtSL4InRs1GKwVL2yF+bntiMAKUjH Je5LI8xUZxJ3TqQtZCwSdYHAJLkQ8pU31mZwWQ4Dr1aCuhqw3EwsCwty2tSLwSV9ovCWYoIHFmY TKk3bEzfz4hMtKX7tau/sxkYLbJzTUwPvZqTAhaMU6A4wuLRWSGTRHV1vJvmF+A9t4jNMkloy33 MGVT6C2FB4i+Y2QB+QMjBQYqZnbo5lCSUOmL9dqLs= X-Received: by 2002:a05:6808:6043:b0:3c9:9294:8d8a with SMTP id 5614622812f47-3d1a7648051mr463571b6e.36.1716497588428; Thu, 23 May 2024 13:53:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoZNkOSUdCHfJHWq3a+lcBJXgi7mgXv7EJzDKgHkri/cmes1Ij8vVLNEDN4B5LlONYbSxcng== X-Received: by 2002:a05:6808:6043:b0:3c9:9294:8d8a with SMTP id 5614622812f47-3d1a7648051mr463544b6e.36.1716497587788; Thu, 23 May 2024 13:53:07 -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.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 May 2024 13:53:07 -0700 (PDT) Message-ID: <40e73fc3-3171-4ca8-9c78-b09d73c75473@redhat.com> Date: Thu, 23 May 2024 16:53:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: gcc-patches Cc: "hernandez, aldy" From: Andrew MacLeod Subject: [COMMITTED 03/12] - Rename relation oracle and API. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, 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 Could have been combined with the previous patch, but eh.... This changes the relation oracle accessed via a range_query to the name 'relation', as there are more oracles coming, and this is more description.  it also renames the registering and querying routines to have less redundant rext. relation->register_relation and relation->query_relation seem a bit texty.  they are now  relation.record () and relation.query () Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. From 3a5b702c4082950d614fe12a066609da23363246 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 17 May 2024 10:18:39 -0400 Subject: [PATCH 03/12] Rename relation oracle and API. With more oracles incoming, rename the range_query oracle () method to relation (), and remove the redundant 'relation' text from register and query methods, resulting in calls that look like: relation ()->record (...) and relation ()->query (...) * gimple-range-cache.cc (ranger_cache::dump_bb): Use m_relation. (ranger_cache::fill_block_cache): Likewise * gimple-range-fold.cc (fur_stmt::get_phi_operand): Use new names. (fur_depend::register_relation): Likewise. (fold_using_range::range_of_phi): Likewise. * gimple-range-path.cc (path_range_query::path_range_query): Likewise. (path_range_query::~path_range_query): Likewise. (ath_range_query::compute_ranges): Likewise. (jt_fur_source::register_relation): Likewise. (jt_fur_source::query_relation): Likewise. (path_range_query::maybe_register_phi_relation): Likewise. * gimple-range-path.h (get_path_oracle): Likewise. * value-query.cc (range_query::create_relation_oracle): Likewise. (range_query::destroy_relation_oracle): Likewise. (range_query::share_oracles): Likewise. (range_query::range_query): Likewise. * value-query.h (value_query::relation): Rename from oracle. (m_relation): Rename from m_oracle. * value-relation.cc (relation_oracle::query): Rename from query_relation. (equiv_oracle::query): Likewise. (equiv_oracle::record): Rename from register_relation. (relation_oracle::record): Likewise. (dom_oracle::record): Likewise. (dom_oracle::query): Rename from query_relation. (path_oracle::record): Rename from register_relation. (path_oracle::query): Rename from query_relation. * value-relation.h (*::record): Rename from register_relation. (*::query): Rename from query_relation. --- gcc/gimple-range-cache.cc | 4 +-- gcc/gimple-range-fold.cc | 10 ++++---- gcc/gimple-range-path.cc | 18 +++++++------- gcc/gimple-range-path.h | 2 +- gcc/gimple-range.cc | 4 +-- gcc/value-query.cc | 16 ++++++------ gcc/value-query.h | 4 +-- gcc/value-relation.cc | 51 ++++++++++++++++++--------------------- gcc/value-relation.h | 39 +++++++++++++----------------- 9 files changed, 69 insertions(+), 79 deletions(-) diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 020069fd635..55277ea8af1 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -1001,7 +1001,7 @@ ranger_cache::dump_bb (FILE *f, basic_block bb) { m_gori.gori_map::dump (f, bb, false); m_on_entry.dump (f, bb); - m_oracle->dump (f, bb); + m_relation->dump (f, bb); } // Get the global range for NAME, and return in R. Return false if the @@ -1439,7 +1439,7 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb) tree equiv_name; relation_kind rel; int prec = TYPE_PRECISION (type); - FOR_EACH_PARTIAL_AND_FULL_EQUIV (m_oracle, bb, name, equiv_name, rel) + FOR_EACH_PARTIAL_AND_FULL_EQUIV (m_relation, bb, name, equiv_name, rel) { basic_block equiv_bb = gimple_bb (SSA_NAME_DEF_STMT (equiv_name)); diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index eeffdce0b97..357a1beabd1 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -178,7 +178,7 @@ fur_stmt::get_phi_operand (vrange &r, tree expr, edge e) relation_kind fur_stmt::query_relation (tree op1, tree op2) { - return m_query->oracle ().query_relation (m_stmt, op1, op2); + return m_query->relation ().query (m_stmt, op1, op2); } // Instantiate a stmt based fur_source with a GORI object. @@ -196,7 +196,7 @@ fur_depend::fur_depend (gimple *s, gori_compute *gori, range_query *q) void fur_depend::register_relation (gimple *s, relation_kind k, tree op1, tree op2) { - m_query->oracle ().register_relation (s, k, op1, op2); + m_query->relation ().record (s, k, op1, op2); } // Register a relation on an edge if there is an oracle. @@ -204,7 +204,7 @@ fur_depend::register_relation (gimple *s, relation_kind k, tree op1, tree op2) void fur_depend::register_relation (edge e, relation_kind k, tree op1, tree op2) { - m_query->oracle ().register_relation (e, k, op1, op2); + m_query->relation ().record (e, k, op1, op2); } // This version of fur_source will pick a range up from a list of ranges @@ -854,7 +854,7 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src) tree single_arg = NULL_TREE; bool seen_arg = false; - relation_oracle *oracle = &(src.query()->oracle ()); + relation_oracle *oracle = &(src.query()->relation ()); // Start with an empty range, unioning in each argument's range. r.set_undefined (); for (x = 0; x < gimple_phi_num_args (phi); x++) @@ -875,7 +875,7 @@ fold_using_range::range_of_phi (vrange &r, gphi *phi, fur_source &src) // Likewise, if the incoming PHI argument is equivalent to this // PHI definition, it provides no new info. Accumulate these ranges // in case all arguments are equivalences. - if (oracle->query_relation (e, arg, phi_def) == VREL_EQ) + if (oracle->query (e, arg, phi_def) == VREL_EQ) equiv_range.union_(arg_range); else r.union_ (arg_range); diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index cf7e0409098..e35bec0e50d 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -44,7 +44,7 @@ path_range_query::path_range_query (gimple_ranger &ranger, m_ranger (ranger), m_resolve (resolve) { - m_oracle = new path_oracle (&(m_ranger.oracle ())); + m_relation = new path_oracle (&(m_ranger.relation ())); reset_path (path, dependencies); } @@ -54,13 +54,13 @@ path_range_query::path_range_query (gimple_ranger &ranger, bool resolve) m_ranger (ranger), m_resolve (resolve) { - m_oracle = new path_oracle (&(m_ranger.oracle ())); + m_relation = new path_oracle (&(m_ranger.relation ())); } path_range_query::~path_range_query () { - delete m_oracle; - m_oracle = NULL; + delete m_relation; + m_relation = NULL; } // Return TRUE if NAME is an exit dependency for the path. @@ -563,7 +563,7 @@ path_range_query::compute_ranges (const bitmap_head *dependencies) if (m_resolve) { path_oracle *p = get_path_oracle (); - p->reset_path (&(m_ranger.oracle ())); + p->reset_path (&(m_ranger.relation ())); } if (DEBUG_SOLVER) @@ -636,7 +636,7 @@ jt_fur_source::jt_fur_source (gimple *s, void jt_fur_source::register_relation (gimple *, relation_kind k, tree op1, tree op2) { - m_query->oracle ().register_relation (m_entry, k, op1, op2); + m_query->relation ().record (m_entry, k, op1, op2); } // Ignore edge and register relation on entry to path. @@ -644,7 +644,7 @@ jt_fur_source::register_relation (gimple *, relation_kind k, tree op1, tree op2) void jt_fur_source::register_relation (edge, relation_kind k, tree op1, tree op2) { - m_query->oracle ().register_relation (m_entry, k, op1, op2); + m_query->relation ().record (m_entry, k, op1, op2); } relation_kind @@ -653,7 +653,7 @@ jt_fur_source::query_relation (tree op1, tree op2) if (TREE_CODE (op1) != SSA_NAME || TREE_CODE (op2) != SSA_NAME) return VREL_VARYING; - return m_query->oracle().query_relation (m_entry, op1, op2); + return m_query->relation ().query (m_entry, op1, op2); } // Return the range of STMT at the end of the path being analyzed. @@ -707,7 +707,7 @@ path_range_query::maybe_register_phi_relation (gphi *phi, edge e) fprintf (dump_file, "maybe_register_phi_relation in bb%d:", bb->index); get_path_oracle ()->killing_def (result); - m_oracle->register_relation (entry_bb (), VREL_EQ, arg, result); + m_relation->record (entry_bb (), VREL_EQ, arg, result); } // Compute relations for each PHI in BB. For example: diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h index f9aba179949..f36a10eb824 100644 --- a/gcc/gimple-range-path.h +++ b/gcc/gimple-range-path.h @@ -51,7 +51,7 @@ private: void compute_exit_dependencies (bitmap_head *dependencies); bool defined_outside_path (tree name); void range_on_path_entry (vrange &r, tree name); - path_oracle *get_path_oracle () { return (path_oracle *)m_oracle; } + path_oracle *get_path_oracle () { return (path_oracle *)m_relation; } // Cache manipulation. bool get_cache (vrange &r, tree name); diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 24ffd63c89b..9664300a80b 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -44,7 +44,7 @@ gimple_ranger::gimple_ranger (bool use_imm_uses) : current_bb (NULL) { // Share the oracle from the cache. - m_oracle = &m_cache.oracle (); + m_relation = &m_cache.relation (); if (dump_file && (param_ranger_debug & RANGER_DEBUG_TRACE)) tracer.enable_trace (); m_stmt_list.create (0); @@ -68,7 +68,7 @@ gimple_ranger::gimple_ranger (bool use_imm_uses) : gimple_ranger::~gimple_ranger () { // Restore the original oracle. - m_oracle = NULL; + m_relation = NULL; m_stmt_list.release (); } diff --git a/gcc/value-query.cc b/gcc/value-query.cc index 03ce574bcb5..db64a95a284 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.cc @@ -189,12 +189,12 @@ void range_query::create_relation_oracle () { gcc_checking_assert (this != &global_ranges); - gcc_checking_assert (m_oracle == &default_relation_oracle); + gcc_checking_assert (m_relation == &default_relation_oracle); if (!dom_info_available_p (CDI_DOMINATORS)) return; - m_oracle = new dom_oracle (); - gcc_checking_assert (m_oracle); + m_relation = new dom_oracle (); + gcc_checking_assert (m_relation); } // Destroy any relation oracle that was created. @@ -202,18 +202,18 @@ range_query::create_relation_oracle () void range_query::destroy_relation_oracle () { - // m_oracle can be NULL if a derived range_query class took care of + // m_relation can be NULL if a derived range_query class took care of // disposing its own oracle. - if (m_oracle && m_oracle != &default_relation_oracle) + if (m_relation && m_relation != &default_relation_oracle) { - delete m_oracle; - m_oracle = &default_relation_oracle; + delete m_relation; + m_relation = &default_relation_oracle; } } range_query::range_query () { - m_oracle = &default_relation_oracle; + m_relation = &default_relation_oracle; } range_query::~range_query () diff --git a/gcc/value-query.h b/gcc/value-query.h index ed355bedfa8..a8688a099fa 100644 --- a/gcc/value-query.h +++ b/gcc/value-query.h @@ -75,7 +75,7 @@ public: virtual bool range_on_entry (vrange &r, basic_block bb, tree expr); virtual bool range_on_exit (vrange &r, basic_block bb, tree expr); - inline class relation_oracle &oracle () const { return *m_oracle; } + inline class relation_oracle &relation () const { return *m_relation; } void create_relation_oracle (); void destroy_relation_oracle (); @@ -87,7 +87,7 @@ protected: bool invoke_range_of_expr (vrange &v, tree expr, gimple *stmt, basic_block bbentry, basic_block bbexit); bool get_arith_expr_range (vrange &r, tree expr, gimple *stmt); - relation_oracle *m_oracle; + relation_oracle *m_relation; }; // Global ranges for SSA names using SSA_NAME_RANGE_INFO. diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index fac15613945..d7bc1b72558 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -233,11 +233,11 @@ relation_oracle::valid_equivs (bitmap b, const_bitmap equivs, basic_block bb) // the definitions have been processed and any relations have be created. relation_kind -relation_oracle::query_relation (gimple *s, tree ssa1, tree ssa2) +relation_oracle::query (gimple *s, tree ssa1, tree ssa2) { if (TREE_CODE (ssa1) != SSA_NAME || TREE_CODE (ssa2) != SSA_NAME) return VREL_VARYING; - return query_relation (gimple_bb (s), ssa1, ssa2); + return query (gimple_bb (s), ssa1, ssa2); } // Return any known relation between SSA1 and SSA2 on edge E. @@ -245,7 +245,7 @@ relation_oracle::query_relation (gimple *s, tree ssa1, tree ssa2) // the definitions have been processed and any relations have be created. relation_kind -relation_oracle::query_relation (edge e, tree ssa1, tree ssa2) +relation_oracle::query (edge e, tree ssa1, tree ssa2) { basic_block bb; if (TREE_CODE (ssa1) != SSA_NAME || TREE_CODE (ssa2) != SSA_NAME) @@ -259,7 +259,7 @@ relation_oracle::query_relation (edge e, tree ssa1, tree ssa2) else bb = e->dest; - return query_relation (bb, ssa1, ssa2); + return query (bb, ssa1, ssa2); } // ------------------------------------------------------------------------- @@ -478,7 +478,7 @@ equiv_oracle::equiv_set (tree ssa, basic_block bb) // Query if there is a relation (equivalence) between 2 SSA_NAMEs. relation_kind -equiv_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) +equiv_oracle::query (basic_block bb, tree ssa1, tree ssa2) { // If the 2 ssa names share the same equiv set, they are equal. if (equiv_set (ssa1, bb) == equiv_set (ssa2, bb)) @@ -491,8 +491,8 @@ equiv_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) // Query if there is a relation (equivalence) between 2 SSA_NAMEs. relation_kind -equiv_oracle::query_relation (basic_block bb ATTRIBUTE_UNUSED, const_bitmap e1, - const_bitmap e2) +equiv_oracle::query (basic_block bb ATTRIBUTE_UNUSED, const_bitmap e1, + const_bitmap e2) { // If the 2 ssa names share the same equiv set, they are equal. if (bitmap_equal_p (e1, e2)) @@ -624,8 +624,7 @@ equiv_oracle::register_initial_def (tree ssa) // containing all the ssa_names in this basic block. void -equiv_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, - tree ssa2) +equiv_oracle::record (basic_block bb, relation_kind k, tree ssa1, tree ssa2) { // Process partial equivalencies. if (relation_partial_equiv_p (k)) @@ -998,8 +997,7 @@ dom_oracle::~dom_oracle () // Register relation K between ssa_name OP1 and OP2 on STMT. void -relation_oracle::register_relation (gimple *stmt, relation_kind k, tree op1, - tree op2) +relation_oracle::record (gimple *stmt, relation_kind k, tree op1, tree op2) { gcc_checking_assert (TREE_CODE (op1) == SSA_NAME); gcc_checking_assert (TREE_CODE (op2) == SSA_NAME); @@ -1040,13 +1038,13 @@ relation_oracle::register_relation (gimple *stmt, relation_kind k, tree op1, return; } } - register_relation (gimple_bb (stmt), k, op1, op2); + record (gimple_bb (stmt), k, op1, op2); } // Register relation K between ssa_name OP1 and OP2 on edge E. void -relation_oracle::register_relation (edge e, relation_kind k, tree op1, tree op2) +relation_oracle::record (edge e, relation_kind k, tree op1, tree op2) { gcc_checking_assert (TREE_CODE (op1) == SSA_NAME); gcc_checking_assert (TREE_CODE (op2) == SSA_NAME); @@ -1064,7 +1062,7 @@ relation_oracle::register_relation (edge e, relation_kind k, tree op1, tree op2) fprintf (dump_file, " on (%d->%d)\n", e->src->index, e->dest->index); } - register_relation (e->dest, k, op1, op2); + record (e->dest, k, op1, op2); } // Register relation K between OP! and OP2 in block BB. @@ -1072,8 +1070,7 @@ relation_oracle::register_relation (edge e, relation_kind k, tree op1, tree op2) // tree to merge with. void -dom_oracle::register_relation (basic_block bb, relation_kind k, tree op1, - tree op2) +dom_oracle::record (basic_block bb, relation_kind k, tree op1, tree op2) { // If the 2 ssa_names are the same, do nothing. An equivalence is implied, // and no other relation makes sense. @@ -1082,7 +1079,7 @@ dom_oracle::register_relation (basic_block bb, relation_kind k, tree op1, // Equivalencies are handled by the equivalence oracle. if (relation_equiv_p (k)) - equiv_oracle::register_relation (bb, k, op1, op2); + equiv_oracle::record (bb, k, op1, op2); else { // if neither op1 nor op2 are in a relation before this is registered, @@ -1283,8 +1280,7 @@ dom_oracle::find_relation_block (unsigned bb, const_bitmap b1, // and B2, starting with block BB. relation_kind -dom_oracle::query_relation (basic_block bb, const_bitmap b1, - const_bitmap b2) +dom_oracle::query (basic_block bb, const_bitmap b1, const_bitmap b2) { relation_kind r; if (bitmap_equal_p (b1, b2)) @@ -1371,7 +1367,7 @@ dom_oracle::find_relation_dom (basic_block bb, unsigned v1, unsigned v2) const // dominator of BB relation_kind -dom_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) +dom_oracle::query (basic_block bb, tree ssa1, tree ssa2) { relation_kind kind; unsigned v1 = SSA_NAME_VERSION (ssa1); @@ -1401,7 +1397,7 @@ dom_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) return kind; // Query using the equivalence sets. - kind = query_relation (bb, equiv1, equiv2); + kind = query (bb, equiv1, equiv2); return kind; } @@ -1565,8 +1561,7 @@ path_oracle::killing_def (tree ssa) // querying from BB. void -path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, - tree ssa2) +path_oracle::record (basic_block bb, relation_kind k, tree ssa1, tree ssa2) { // If the 2 ssa_names are the same, do nothing. An equivalence is implied, // and no other relation makes sense. @@ -1581,7 +1576,7 @@ path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, fprintf (dump_file, " (root: bb%d)\n", bb->index); } - relation_kind curr = query_relation (bb, ssa1, ssa2); + relation_kind curr = query (bb, ssa1, ssa2); if (curr != VREL_VARYING) k = relation_intersect (curr, k); @@ -1604,7 +1599,7 @@ path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, // starting at block BB. relation_kind -path_oracle::query_relation (basic_block bb, const_bitmap b1, const_bitmap b2) +path_oracle::query (basic_block bb, const_bitmap b1, const_bitmap b2) { if (bitmap_equal_p (b1, b2)) return VREL_EQ; @@ -1618,7 +1613,7 @@ path_oracle::query_relation (basic_block bb, const_bitmap b1, const_bitmap b2) return k; if (k == VREL_VARYING && m_root) - k = m_root->query_relation (bb, b1, b2); + k = m_root->query (bb, b1, b2); return k; } @@ -1627,7 +1622,7 @@ path_oracle::query_relation (basic_block bb, const_bitmap b1, const_bitmap b2) // starting at block BB. relation_kind -path_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) +path_oracle::query (basic_block bb, tree ssa1, tree ssa2) { unsigned v1 = SSA_NAME_VERSION (ssa1); unsigned v2 = SSA_NAME_VERSION (ssa2); @@ -1640,7 +1635,7 @@ path_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) if (bitmap_bit_p (equiv_1, v2) && bitmap_bit_p (equiv_2, v1)) return VREL_EQ; - return query_relation (bb, equiv_1, equiv_2); + return query (bb, equiv_1, equiv_2); } // Reset any relations registered on this path. ORACLE is the root diff --git a/gcc/value-relation.h b/gcc/value-relation.h index 528f00aecbb..cf009e6aa19 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -100,15 +100,14 @@ public: virtual ~relation_oracle () { } // register a relation between 2 ssa names. - void register_relation (gimple *, relation_kind, tree, tree); - void register_relation (edge, relation_kind, tree, tree); - virtual void register_relation (basic_block, relation_kind, tree, tree) { } + void record (gimple *, relation_kind, tree, tree); + void record (edge, relation_kind, tree, tree); + virtual void record (basic_block, relation_kind, tree, tree) { } // Query if there is any relation between SSA1 and SSA2. - relation_kind query_relation (gimple *s, tree ssa1, tree ssa2); - relation_kind query_relation (edge e, tree ssa1, tree ssa2); - virtual relation_kind query_relation (basic_block, tree, tree) - { return VREL_VARYING; } + relation_kind query (gimple *s, tree ssa1, tree ssa2); + relation_kind query (edge e, tree ssa1, tree ssa2); + virtual relation_kind query (basic_block, tree, tree) { return VREL_VARYING; } virtual void dump (FILE *, basic_block) const { } virtual void dump (FILE *) const { } @@ -121,8 +120,8 @@ protected: virtual const class pe_slice *partial_equiv_set (tree) { return NULL; } void valid_equivs (bitmap b, const_bitmap equivs, basic_block bb); // Query for a relation between two equivalency sets in a basic block. - virtual relation_kind query_relation (basic_block, const_bitmap, - const_bitmap) { return VREL_VARYING; } + virtual relation_kind query (basic_block, const_bitmap, const_bitmap) + { return VREL_VARYING; } friend class path_oracle; }; @@ -162,13 +161,11 @@ public: ~equiv_oracle (); const_bitmap equiv_set (tree ssa, basic_block bb) final override; - void register_relation (basic_block bb, relation_kind k, tree ssa1, - tree ssa2) override; + void record (basic_block bb, relation_kind k, tree ssa1, tree ssa2) override; relation_kind partial_equiv (tree ssa1, tree ssa2, tree *base = NULL) const; - relation_kind query_relation (basic_block, tree, tree) override; - relation_kind query_relation (basic_block, const_bitmap, const_bitmap) - override; + relation_kind query (basic_block, tree, tree) override; + relation_kind query (basic_block, const_bitmap, const_bitmap) override; void dump (FILE *f, basic_block bb) const override; void dump (FILE *f) const override; @@ -222,13 +219,12 @@ public: dom_oracle (); ~dom_oracle (); - void register_relation (basic_block bb, relation_kind k, tree op1, tree op2) + void record (basic_block bb, relation_kind k, tree op1, tree op2) final override; - relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2) + relation_kind query (basic_block bb, tree ssa1, tree ssa2) final override; + relation_kind query (basic_block bb, const_bitmap b1, const_bitmap b2) final override; - relation_kind query_relation (basic_block bb, const_bitmap b1, - const_bitmap b2) final override; void dump (FILE *f, basic_block bb) const final override; void dump (FILE *f) const final override; @@ -269,11 +265,10 @@ public: path_oracle (relation_oracle *oracle = NULL); ~path_oracle (); const_bitmap equiv_set (tree, basic_block) final override; - void register_relation (basic_block, relation_kind, tree, tree) final override; + void record (basic_block, relation_kind, tree, tree) final override; void killing_def (tree); - relation_kind query_relation (basic_block, tree, tree) final override; - relation_kind query_relation (basic_block, const_bitmap, const_bitmap) - final override; + relation_kind query (basic_block, tree, tree) final override; + relation_kind query (basic_block, const_bitmap, const_bitmap) final override; void reset_path (relation_oracle *oracle = NULL); void set_root_oracle (relation_oracle *oracle) { m_root = oracle; } void dump (FILE *, basic_block) const final override; -- 2.41.0