From patchwork Wed May 10 11:57:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 92065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3561283vqo; Wed, 10 May 2023 04:58:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Gw1R77lagc1WR2/Vb3yYpOrP57w89toYrONtAu65VRmKeAjrswm6rA/9dGITpX7rI1VzR X-Received: by 2002:aa7:d845:0:b0:500:47ed:9784 with SMTP id f5-20020aa7d845000000b0050047ed9784mr15446519eds.14.1683719894062; Wed, 10 May 2023 04:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683719894; cv=none; d=google.com; s=arc-20160816; b=aVko6R/ILD+h97nWXCCXupaQVEmjJr0N+hlMlxlM9snDTSSi5WGVGXdPSd4saBlqFe 4YHsx0XHeAreHwNy5bcTWTOH4ci93TCapVvOk+6Z8sSrz0xI0qkSicchwrdp5jvG7xn4 m5Gw7UW1gcKjjI1VVTITNhLslUjuKq16A3cx6aolON4hcfp2fEN4YzQrFRg0ra+xHcqj T2wbXdJctZ3+n6iLj2AkN/PWLai3MCksl2kIuK0LesHTxMl5ZxPUYlz1o5C3jisCCd+g d4JlbBfC5tBm4CrN2+XTjZqSXhCCQ6HUnx7sFw6afcW5Gs4b9XecHgVwzKdnXLnio8pa UyZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=6G2Lyt5iQO/FxmN1rkU9ymCRVvau+xMxnRmeQFSGqew=; b=rZbQQu2C5ZHwgL+NT6GvW00Zu6ysO5DZv9hctnh3QKjJcnj3mOwGuxiF6qQ8HRAJcX ByQw8KdPIDGijywdSGjX5UFKMthyoqdIb3DpTHpyNUma5T37Jtwt0bc2/dg/4eG06n/p iSGQyroDOCqFq1rDS741HiZrf4583xXBsiwbGv/x181GDsx59epLNCVcSZHAhZ2qzyd/ e9tO4BC5LesmU3ofZ5tsMKd49lNR3Vnme8UNU8pJWg+c/FNsnxqMcMC5gaouCYGb7Oji 99/5G7dM8uzhyEtokr1GEVJBSuC1XqyFQBvBi17hwiVNOmTSMctAon2/MsDqcGmK4z7/ /LOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SZ03jXee; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p12-20020a056402044c00b0050bc5a558c2si2680063edw.381.2023.05.10.04.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 04:58:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SZ03jXee; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 866B3385AC29 for ; Wed, 10 May 2023 11:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 866B3385AC29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683719881; bh=6G2Lyt5iQO/FxmN1rkU9ymCRVvau+xMxnRmeQFSGqew=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=SZ03jXeepzNEpY40RAeax9sPGPgDaPe/o1T4Fv5I3C81pfY5eYd0UzKvcJs6d4Km3 u0sW/gJRo3TmzpRtK2UvYqojY3yyFjtFttdob1dHDjQBToArd22xq2NJZWrkQv98L0 nk57wlbLjmV/5ofIg++oCfk8848I2MK9dU7cQ6eY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by sourceware.org (Postfix) with ESMTPS id 2EF3B3856DC2 for ; Wed, 10 May 2023 11:57:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2EF3B3856DC2 X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="349025742" X-IronPort-AV: E=Sophos;i="5.99,264,1677571200"; d="scan'208";a="349025742" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2023 04:57:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10705"; a="702234477" X-IronPort-AV: E=Sophos;i="5.99,264,1677571200"; d="scan'208";a="702234477" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga007.fm.intel.com with ESMTP; 10 May 2023 04:57:07 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail03.sh.intel.com (Postfix) with ESMTP id DE888100518B; Wed, 10 May 2023 19:57:06 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@sifive.com, pan2.li@intel.com, yanzhang.wang@intel.com, jeffreyalaw@gmail.com, jakub@redhat.com, rguenther@suse.de, richard.sandiford@arm.com Subject: [PATCH v2] Var-Tracking: Typedef pointer_mux as decl_or_value Date: Wed, 10 May 2023 19:57:05 +0800 Message-Id: <20230510115705.2420805-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230510071758.2098860-1-pan2.li@intel.com> References: <20230510071758.2098860-1-pan2.li@intel.com> MIME-Version: 1.0 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, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pan Li via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: pan2.li@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765508271756051518?= X-GMAIL-MSGID: =?utf-8?q?1765508271756051518?= From: Pan Li The decl_or_value is defined as void * before this PATCH. It will take care of both the tree_node and rtx_def. Unfortunately, given a void pointer cannot tell the input is tree_node or rtx_def. Then we have some implicit structure layout requirement similar as below. Or we will touch unreasonable bits when cast void * to tree_node or rtx_def. +--------+-----------+----------+ | offset | tree_node | rtx_def | +--------+-----------+----------+ | 0 | code: 16 | code: 16 | <- require the location and bitssize +--------+-----------+----------+ | 16 | ... | mode: 8 | +--------+-----------+----------+ | ... | +--------+-----------+----------+ | 24 | ... | ... | +--------+-----------+----------+ This behavior blocks the PATCH that extend the rtx_def mode from 8 to 16 bits for running out of machine mode. This PATCH introduced the pointer_mux to tell the input is tree_node or rtx_def, and decouple the above implicition dependency. Signed-off-by: Pan Li Co-Authored-By: Richard Sandiford Co-Authored-By: Richard Biener Co-Authored-By: Jakub Jelinek gcc/ChangeLog: * mux-utils.h: Add overload operator == and != for pointer_mux.. * var-tracking.cc: Included mux-utils.h for pointer_tmux. (decl_or_value): Changed from void * to pointer_mux. (dv_is_decl_p): Reconciled to the new type, aka pointer_mux. (dv_as_decl): Likewise. (dv_as_value): Likewise. (dv_as_opaque): Likewise. (variable_hasher::equal): Likewise. (dv_from_decl): Likewise. (dv_from_value): Likewise. (attrs_list_member): Likewise. (shared_hash_find_slot_unshare_1): Likewise. (shared_hash_find_slot_1): Likewise. (shared_hash_find_slot_noinsert_1): Likewise. (shared_hash_find_1): Likewise. (unshare_variable): Likewise. (vars_copy): Likewise. (var_reg_decl_set): Likewise. (var_reg_delete_and_set): Likewise. (find_loc_in_1pdv): Likewise. (canonicalize_values_star): Likewise. (variable_post_merge_new_vals): Likewise. (find_mem_expr_in_1pdv): Likewise. (dump_onepart_variable_differences): Likewise. (variable_different_p): Likewise. (dataflow_set_different): Likewise. (variable_from_dropped): Likewise. (variable_was_changed): Likewise. (set_slot_part): Likewise. (clobber_slot_part): Likewise. (loc_exp_insert_dep): Likewise. (notify_dependents_of_resolved_value): Likewise. (vt_expand_loc_callback): Likewise. (remove_value_from_changed_variables): Likewise (notify_dependents_of_changed_value): Likewise. (emit_notes_for_differences_1): Likewise. (emit_notes_for_differences_2): Likewise. --- gcc/mux-utils.h | 12 ++++ gcc/var-tracking.cc | 145 +++++++++++++++++++++++--------------------- 2 files changed, 87 insertions(+), 70 deletions(-) diff --git a/gcc/mux-utils.h b/gcc/mux-utils.h index a2b6a316899..3eec4edc833 100644 --- a/gcc/mux-utils.h +++ b/gcc/mux-utils.h @@ -72,6 +72,18 @@ public: // Return true unless the pointer is a null A pointer. explicit operator bool () const { return m_ptr; } + // Return true if class has the same m_ptr, or false. + bool operator == (const pointer_mux &other) + { + return this->m_ptr == other.m_ptr; + } + + // Return true if class has the different m_ptr, or false. + bool operator != (const pointer_mux &other) + { + return this->m_ptr != other.m_ptr; + } + // Assign A and B pointers respectively. void set_first (T1 *ptr) { *this = first (ptr); } void set_second (T2 *ptr) { *this = second (ptr); } diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc index fae0c73e02f..48a585423d9 100644 --- a/gcc/var-tracking.cc +++ b/gcc/var-tracking.cc @@ -116,9 +116,14 @@ #include "fibonacci_heap.h" #include "print-rtl.h" #include "function-abi.h" +#include "mux-utils.h" typedef fibonacci_heap bb_heap_t; +/* A declaration of a variable, or an RTL value being handled like a + declaration by pointer_mux. */ +typedef pointer_mux decl_or_value; + /* var-tracking.cc assumes that tree code with the same value as VALUE rtx code has no chance to appear in REG_EXPR/MEM_EXPRs and isn't a decl. Currently the value is the same as IDENTIFIER_NODE, which has such @@ -196,15 +201,11 @@ struct micro_operation }; -/* A declaration of a variable, or an RTL value being handled like a - declaration. */ -typedef void *decl_or_value; - /* Return true if a decl_or_value DV is a DECL or NULL. */ static inline bool dv_is_decl_p (decl_or_value dv) { - return !dv || (int) TREE_CODE ((tree) dv) != (int) VALUE; + return dv.is_first (); } /* Return true if a decl_or_value is a VALUE rtl. */ @@ -219,7 +220,7 @@ static inline tree dv_as_decl (decl_or_value dv) { gcc_checking_assert (dv_is_decl_p (dv)); - return (tree) dv; + return dv.known_first (); } /* Return the value in the decl_or_value. */ @@ -227,14 +228,15 @@ static inline rtx dv_as_value (decl_or_value dv) { gcc_checking_assert (dv_is_value_p (dv)); - return (rtx)dv; + return dv.known_second (); } /* Return the opaque pointer in the decl_or_value. */ static inline void * dv_as_opaque (decl_or_value dv) { - return dv; + return dv.is_first () ? (void *) dv.known_first () + : (void *) dv.known_second (); } @@ -503,9 +505,7 @@ variable_hasher::hash (const variable *v) inline bool variable_hasher::equal (const variable *v, const void *y) { - decl_or_value dv = CONST_CAST2 (decl_or_value, const void *, y); - - return (dv_as_opaque (v->dv) == dv_as_opaque (dv)); + return dv_as_opaque (v->dv) == y; } /* Free the element of VARIABLE_HTAB (its type is struct variable_def). */ @@ -1396,8 +1396,7 @@ onepart_pool_allocate (onepart_enum onepart) static inline decl_or_value dv_from_decl (tree decl) { - decl_or_value dv; - dv = decl; + decl_or_value dv = decl_or_value::first (decl); gcc_checking_assert (dv_is_decl_p (dv)); return dv; } @@ -1406,8 +1405,7 @@ dv_from_decl (tree decl) static inline decl_or_value dv_from_value (rtx value) { - decl_or_value dv; - dv = value; + decl_or_value dv = decl_or_value::second (value); gcc_checking_assert (dv_is_value_p (dv)); return dv; } @@ -1519,7 +1517,7 @@ static attrs * attrs_list_member (attrs *list, decl_or_value dv, HOST_WIDE_INT offset) { for (; list; list = list->next) - if (dv_as_opaque (list->dv) == dv_as_opaque (dv) && list->offset == offset) + if (list->dv == dv && list->offset == offset) return list; return NULL; } @@ -1661,7 +1659,8 @@ shared_hash_find_slot_unshare_1 (shared_hash **pvars, decl_or_value dv, { if (shared_hash_shared (*pvars)) *pvars = shared_hash_unshare (*pvars); - return shared_hash_htab (*pvars)->find_slot_with_hash (dv, dvhash, ins); + return shared_hash_htab (*pvars)->find_slot_with_hash (dv_as_opaque (dv), + dvhash, ins); } static inline variable ** @@ -1678,7 +1677,8 @@ shared_hash_find_slot_unshare (shared_hash **pvars, decl_or_value dv, static inline variable ** shared_hash_find_slot_1 (shared_hash *vars, decl_or_value dv, hashval_t dvhash) { - return shared_hash_htab (vars)->find_slot_with_hash (dv, dvhash, + return shared_hash_htab (vars)->find_slot_with_hash (dv_as_opaque (dv), + dvhash, shared_hash_shared (vars) ? NO_INSERT : INSERT); } @@ -1695,7 +1695,8 @@ static inline variable ** shared_hash_find_slot_noinsert_1 (shared_hash *vars, decl_or_value dv, hashval_t dvhash) { - return shared_hash_htab (vars)->find_slot_with_hash (dv, dvhash, NO_INSERT); + return shared_hash_htab (vars)->find_slot_with_hash (dv_as_opaque (dv), + dvhash, NO_INSERT); } static inline variable ** @@ -1710,7 +1711,7 @@ shared_hash_find_slot_noinsert (shared_hash *vars, decl_or_value dv) static inline variable * shared_hash_find_1 (shared_hash *vars, decl_or_value dv, hashval_t dvhash) { - return shared_hash_htab (vars)->find_with_hash (dv, dvhash); + return shared_hash_htab (vars)->find_with_hash (dv_as_opaque (dv), dvhash); } static inline variable * @@ -1807,7 +1808,7 @@ unshare_variable (dataflow_set *set, variable **slot, variable *var, if (var->in_changed_variables) { variable **cslot - = changed_variables->find_slot_with_hash (var->dv, + = changed_variables->find_slot_with_hash (dv_as_opaque (var->dv), dv_htab_hash (var->dv), NO_INSERT); gcc_assert (*cslot == (void *) var); @@ -1831,8 +1832,8 @@ vars_copy (variable_table_type *dst, variable_table_type *src) { variable **dstp; var->refcount++; - dstp = dst->find_slot_with_hash (var->dv, dv_htab_hash (var->dv), - INSERT); + dstp = dst->find_slot_with_hash (dv_as_opaque (var->dv), + dv_htab_hash (var->dv), INSERT); *dstp = var; } } @@ -1866,8 +1867,7 @@ var_reg_decl_set (dataflow_set *set, rtx loc, enum var_init_status initialized, dv = dv_from_decl (var_debug_decl (dv_as_decl (dv))); for (node = set->regs[REGNO (loc)]; node; node = node->next) - if (dv_as_opaque (node->dv) == dv_as_opaque (dv) - && node->offset == offset) + if (node->dv == dv && node->offset == offset) break; if (!node) attrs_list_insert (&set->regs[REGNO (loc)], dv, offset, loc); @@ -1966,7 +1966,7 @@ var_reg_delete_and_set (dataflow_set *set, rtx loc, bool modify, for (node = *nextp; node; node = next) { next = node->next; - if (dv_as_opaque (node->dv) != decl || node->offset != offset) + if (node->dv.first_or_null () != decl || node->offset != offset) { delete_variable_part (set, node->loc, node->dv, node->offset); delete node; @@ -3242,7 +3242,7 @@ find_loc_in_1pdv (rtx loc, variable *var, variable_table_type *vars) if (!var->n_var_parts) return NULL; - gcc_checking_assert (loc != dv_as_opaque (var->dv)); + gcc_checking_assert (loc != var->dv.second_or_null ()); loc_code = GET_CODE (loc); for (node = var->var_part[0].loc_chain; node; node = node->next) @@ -3286,7 +3286,7 @@ find_loc_in_1pdv (rtx loc, variable *var, variable_table_type *vars) gcc_checking_assert (!node->next); dv = dv_from_value (node->loc); - rvar = vars->find_with_hash (dv, dv_htab_hash (dv)); + rvar = vars->find_with_hash (dv_as_opaque (dv), dv_htab_hash (dv)); return find_loc_in_1pdv (loc, rvar, vars); } @@ -3832,16 +3832,14 @@ canonicalize_values_star (variable **slot, dataflow_set *set) while (list) { - if (list->offset == 0 - && (dv_as_opaque (list->dv) == dv_as_opaque (dv) - || dv_as_opaque (list->dv) == dv_as_opaque (cdv))) + if (list->offset == 0 && (list->dv == dv || list->dv == cdv)) break; list = list->next; } gcc_assert (list); - if (dv_as_opaque (list->dv) == dv_as_opaque (dv)) + if (list->dv == dv) { list->dv = cdv; for (listp = &list->next; (list = *listp); listp = &list->next) @@ -3849,7 +3847,7 @@ canonicalize_values_star (variable **slot, dataflow_set *set) if (list->offset) continue; - if (dv_as_opaque (list->dv) == dv_as_opaque (cdv)) + if (list->dv == cdv) { *listp = list->next; delete list; @@ -3857,17 +3855,17 @@ canonicalize_values_star (variable **slot, dataflow_set *set) break; } - gcc_assert (dv_as_opaque (list->dv) != dv_as_opaque (dv)); + gcc_assert (list->dv != dv); } } - else if (dv_as_opaque (list->dv) == dv_as_opaque (cdv)) + else if (list->dv == cdv) { for (listp = &list->next; (list = *listp); listp = &list->next) { if (list->offset) continue; - if (dv_as_opaque (list->dv) == dv_as_opaque (dv)) + if (list->dv == dv) { *listp = list->next; delete list; @@ -3875,7 +3873,7 @@ canonicalize_values_star (variable **slot, dataflow_set *set) break; } - gcc_assert (dv_as_opaque (list->dv) != dv_as_opaque (cdv)); + gcc_assert (list->dv != cdv); } } else @@ -3884,9 +3882,7 @@ canonicalize_values_star (variable **slot, dataflow_set *set) if (flag_checking) while (list) { - if (list->offset == 0 - && (dv_as_opaque (list->dv) == dv_as_opaque (dv) - || dv_as_opaque (list->dv) == dv_as_opaque (cdv))) + if (list->offset == 0 && (list->dv == dv || list->dv == cdv)) gcc_unreachable (); list = list->next; @@ -4475,7 +4471,7 @@ variable_post_merge_new_vals (variable **slot, dfset_post_merge *dfpm) check_dupes = true; break; } - else if (dv_as_opaque (att->dv) == dv_as_opaque (var->dv)) + else if (att->dv == var->dv) curp = attp; } @@ -4485,7 +4481,7 @@ variable_post_merge_new_vals (variable **slot, dfset_post_merge *dfpm) while (*curp) if ((*curp)->offset == 0 && GET_MODE ((*curp)->loc) == GET_MODE (node->loc) - && dv_as_opaque ((*curp)->dv) == dv_as_opaque (var->dv)) + && (*curp)->dv == var->dv) break; else curp = &(*curp)->next; @@ -4664,7 +4660,7 @@ find_mem_expr_in_1pdv (tree expr, rtx val, variable_table_type *vars) && !VALUE_RECURSED_INTO (val)); dv = dv_from_value (val); - var = vars->find_with_hash (dv, dv_htab_hash (dv)); + var = vars->find_with_hash (dv_as_opaque (dv), dv_htab_hash (dv)); if (!var) return NULL; @@ -4989,7 +4985,7 @@ dump_onepart_variable_differences (variable *var1, variable *var2) gcc_assert (var1 != var2); gcc_assert (dump_file); - gcc_assert (dv_as_opaque (var1->dv) == dv_as_opaque (var2->dv)); + gcc_assert (var1->dv == var2->dv); gcc_assert (var1->n_var_parts == 1 && var2->n_var_parts == 1); @@ -5054,8 +5050,7 @@ variable_different_p (variable *var1, variable *var2) if (var1->onepart && var1->n_var_parts) { - gcc_checking_assert (dv_as_opaque (var1->dv) == dv_as_opaque (var2->dv) - && var1->n_var_parts == 1); + gcc_checking_assert (var1->dv == var2->dv && var1->n_var_parts == 1); /* One-part values have locations in a canonical order. */ return onepart_variable_different_p (var1, var2); } @@ -5103,7 +5098,8 @@ dataflow_set_different (dataflow_set *old_set, dataflow_set *new_set) var1, variable, hi) { variable_table_type *htab = shared_hash_htab (new_set->vars); - variable *var2 = htab->find_with_hash (var1->dv, dv_htab_hash (var1->dv)); + variable *var2 = htab->find_with_hash (dv_as_opaque (var1->dv), + dv_htab_hash (var1->dv)); if (!var2) { @@ -5140,7 +5136,8 @@ dataflow_set_different (dataflow_set *old_set, dataflow_set *new_set) var1, variable, hi) { variable_table_type *htab = shared_hash_htab (old_set->vars); - variable *var2 = htab->find_with_hash (var1->dv, dv_htab_hash (var1->dv)); + variable *var2 = htab->find_with_hash (dv_as_opaque (var1->dv), + dv_htab_hash (var1->dv)); if (!var2) { if (details) @@ -7422,7 +7419,8 @@ variable_from_dropped (decl_or_value dv, enum insert_option insert) variable *empty_var; onepart_enum onepart; - slot = dropped_values->find_slot_with_hash (dv, dv_htab_hash (dv), insert); + slot = dropped_values->find_slot_with_hash (dv_as_opaque (dv), + dv_htab_hash (dv), insert); if (!slot) return NULL; @@ -7493,7 +7491,8 @@ variable_was_changed (variable *var, dataflow_set *set) /* Remember this decl or VALUE has been added to changed_variables. */ set_dv_changed (var->dv, true); - slot = changed_variables->find_slot_with_hash (var->dv, hash, INSERT); + slot = changed_variables->find_slot_with_hash (dv_as_opaque (var->dv), + hash, INSERT); if (*slot) { @@ -7520,9 +7519,10 @@ variable_was_changed (variable *var, dataflow_set *set) if (onepart == ONEPART_VALUE || onepart == ONEPART_DEXPR) { - dslot = dropped_values->find_slot_with_hash (var->dv, - dv_htab_hash (var->dv), - INSERT); + dslot = + dropped_values->find_slot_with_hash (dv_as_opaque (var->dv), + dv_htab_hash (var->dv), + INSERT); empty_var = *dslot; if (empty_var) @@ -7656,7 +7656,7 @@ set_slot_part (dataflow_set *set, rtx loc, variable **slot, onepart = dv_onepart_p (dv); gcc_checking_assert (offset == 0 || !onepart); - gcc_checking_assert (loc != dv_as_opaque (dv)); + gcc_checking_assert (loc != dv.second_or_null ()); if (! flag_var_tracking_uninit) initialized = VAR_INIT_STATUS_INITIALIZED; @@ -7684,7 +7684,7 @@ set_slot_part (dataflow_set *set, rtx loc, variable **slot, { int r = -1, c = 0; - gcc_assert (dv_as_opaque (var->dv) == dv_as_opaque (dv)); + gcc_assert (var->dv == dv); pos = 0; @@ -7950,8 +7950,7 @@ clobber_slot_part (dataflow_set *set, rtx loc, variable **slot, for (anode = *anextp; anode; anode = anext) { anext = anode->next; - if (dv_as_opaque (anode->dv) == dv_as_opaque (var->dv) - && anode->offset == offset) + if (anode->dv == var->dv && anode->offset == offset) { delete anode; *anextp = anext; @@ -8199,7 +8198,7 @@ loc_exp_insert_dep (variable *var, rtx x, variable_table_type *vars) /* ??? Build a vector of variables parallel to EXPANDING, to avoid an additional look up? */ - xvar = vars->find_with_hash (dv, dv_htab_hash (dv)); + xvar = vars->find_with_hash (dv_as_opaque (dv), dv_htab_hash (dv)); if (!xvar) { @@ -8307,7 +8306,7 @@ notify_dependents_of_resolved_value (variable *ivar, variable_table_type *vars) continue; } - var = vars->find_with_hash (dv, dv_htab_hash (dv)); + var = vars->find_with_hash (dv_as_opaque (dv), dv_htab_hash (dv)); if (!var) var = variable_from_dropped (dv, NO_INSERT); @@ -8552,7 +8551,7 @@ vt_expand_loc_callback (rtx x, bitmap regs, return NULL; } - var = elcd->vars->find_with_hash (dv, dv_htab_hash (dv)); + var = elcd->vars->find_with_hash (dv_as_opaque (dv), dv_htab_hash (dv)); if (!var) { @@ -8959,8 +8958,9 @@ remove_value_from_changed_variables (rtx val) variable **slot; variable *var; - slot = changed_variables->find_slot_with_hash (dv, dv_htab_hash (dv), - NO_INSERT); + slot = changed_variables->find_slot_with_hash (dv_as_opaque (dv), + dv_htab_hash (dv), + NO_INSERT); var = *slot; var->in_changed_variables = false; changed_variables->clear_slot (slot); @@ -8980,12 +8980,15 @@ notify_dependents_of_changed_value (rtx val, variable_table_type *htab, loc_exp_dep *led; decl_or_value dv = dv_from_rtx (val); - slot = changed_variables->find_slot_with_hash (dv, dv_htab_hash (dv), - NO_INSERT); + slot = changed_variables->find_slot_with_hash (dv_as_opaque (dv), + dv_htab_hash (dv), + NO_INSERT); if (!slot) - slot = htab->find_slot_with_hash (dv, dv_htab_hash (dv), NO_INSERT); + slot = htab->find_slot_with_hash (dv_as_opaque (dv), dv_htab_hash (dv), + NO_INSERT); if (!slot) - slot = dropped_values->find_slot_with_hash (dv, dv_htab_hash (dv), + slot = dropped_values->find_slot_with_hash (dv_as_opaque (dv), + dv_htab_hash (dv), NO_INSERT); var = *slot; @@ -9017,14 +9020,14 @@ notify_dependents_of_changed_value (rtx val, variable_table_type *htab, break; case ONEPART_VDECL: - ivar = htab->find_with_hash (ldv, dv_htab_hash (ldv)); + ivar = htab->find_with_hash (dv_as_opaque (ldv), dv_htab_hash (ldv)); gcc_checking_assert (!VAR_LOC_DEP_LST (ivar)); variable_was_changed (ivar, NULL); break; case NOT_ONEPART: delete led; - ivar = htab->find_with_hash (ldv, dv_htab_hash (ldv)); + ivar = htab->find_with_hash (dv_as_opaque (ldv), dv_htab_hash (ldv)); if (ivar) { int i = ivar->n_var_parts; @@ -9119,7 +9122,8 @@ emit_notes_for_differences_1 (variable **slot, variable_table_type *new_vars) variable *old_var, *new_var; old_var = *slot; - new_var = new_vars->find_with_hash (old_var->dv, dv_htab_hash (old_var->dv)); + new_var = new_vars->find_with_hash (dv_as_opaque (old_var->dv), + dv_htab_hash (old_var->dv)); if (!new_var) { @@ -9191,7 +9195,8 @@ emit_notes_for_differences_2 (variable **slot, variable_table_type *old_vars) variable *old_var, *new_var; new_var = *slot; - old_var = old_vars->find_with_hash (new_var->dv, dv_htab_hash (new_var->dv)); + old_var = old_vars->find_with_hash (dv_as_opaque (new_var->dv), + dv_htab_hash (new_var->dv)); if (!old_var) { int i;