From patchwork Mon Aug 22 13:37:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 650 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp496404wro; Mon, 22 Aug 2022 06:38:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HiLafmXWFp+xvvJe2a5ZYh/69PWVFZzFO9Ar86juvsXaB5LN9hBtxhaXaO6VDktSAQ5N7 X-Received: by 2002:a17:907:a061:b0:73d:5429:b5ad with SMTP id ia1-20020a170907a06100b0073d5429b5admr9063549ejc.612.1661175485615; Mon, 22 Aug 2022 06:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661175485; cv=none; d=google.com; s=arc-20160816; b=PN9h5W8yNPXLwKQs0yItnRG4y19ogFFLlWdLCFJtDJzLMUU8khtzB4TXMrEHCD7HXs vrcGjqBgEE9shWgnzbctRLiKbQFl8xZk4J4crBM5avexVoYOAIaGetnuNw1YKtWH+1X3 Y20YyIaXNIkDFDxBg3zOXG863aB4cZoIWA93iZbqyre6uX4/T0BfUEnZVETCtsgBtgp1 56lSeaKeJM0RHUWVOOmc6Hz2t8md70y7Z+vMx+QLTPkZbQ3OAdZC9G6Xygp2mPGplZuy 1xjvc9Oc18c+aFtBXg1ORnAnWPQkv5TJnDsVDNPaJ8Sa2nQopdvnHBjJQaAf2x77TYe0 xaMw== 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:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=nAVkwKtsi27k48Gih9YcJbtk/a3SmCKFGML8S5C5XRY=; b=Snd27QoOrgs15NYy7Uv6h2F4Sd5jnxWr63exwDgmpSiU0mD1c0M7OEvMtQsiN7iN3J hJ+8JM2hIY0uhtIWDzEJL299vK4nAOqftAHPoo+XuCuhsPKFCqXwpGiRVDSBB1s+coUg z56ZJ6AxwMCFQFUpfLTs/aWW826wLob1Pcz8iL0Nx129i03DXz/OI8FwWbtSrW+OUwXy RCQ0CNSI68m0QrCh+Bv23euG+lleW4otxld6ZvslGhF9wUmFZQKBbQuEBekk67aGj5RW FmH+nO9AZs4Apz4Iyx5/8fql7cp8vJA493sS8/SdmClPNFobsTV3t3/JVauRhIYfFciV NMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="F8S/oqWJ"; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pk9-20020a170906d7a900b00730add8d023si7505340ejb.837.2022.08.22.06.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 06:38:05 -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="F8S/oqWJ"; 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 84AA9385829A for ; Mon, 22 Aug 2022 13:38:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84AA9385829A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661175484; bh=nAVkwKtsi27k48Gih9YcJbtk/a3SmCKFGML8S5C5XRY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=F8S/oqWJ49Ch5m6bIPr4yInKZXy2QEiC/UAr88S3PQLbFOXObMgA+7P1zJzjWEYBH ojWADtyNZRaWygCX+AbRdznP1ZwVicp/AA0Txy2N+P9dWMCYUdiKXXP0B0M/3Uh1lP Ms2/HNNb8BxRMhtoPjuzUalrTZqDzbPgGCSePpMw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 469F338582B9 for ; Mon, 22 Aug 2022 13:37:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 469F338582B9 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0D8371F9C1 for ; Mon, 22 Aug 2022 13:37:20 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EF80E13523 for ; Mon, 22 Aug 2022 13:37:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ISdqOY+GA2MwZwAAMHmgww (envelope-from ) for ; Mon, 22 Aug 2022 13:37:19 +0000 Date: Mon, 22 Aug 2022 15:37:19 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Remove dead predicate analysis GENERIC expr building code MIME-Version: 1.0 Message-Id: <20220822133719.EF80E13523@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener 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?1741868745845619355?= X-GMAIL-MSGID: =?utf-8?q?1741868745845619355?= The following removes the unused def_expr, use_expr and expr APIs from the predicate class including the unconditional build of the GENERIC use_expr on each uninit analysis run. Bootstrap & regtest running on x86_64-unknown-linux-gnu. * gimple-predicate-analysis.h (predicate::m_use_expr): Remove. (predicate::def_expr): Likewise. (predicate::use_expr): Likewise. (predicate::expr): Likewise. * gimple-predicate-analysis.cc (predicate::def_expr): Remove. (predicate::use_expr): Likewise. (predicate::expr): Likewise. (predicate::is_use_guarded): Do not build m_use_expr. --- gcc/gimple-predicate-analysis.cc | 39 -------------------------------- gcc/gimple-predicate-analysis.h | 16 ++----------- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc index 820a9bde28a..d1b0d1283dc 100644 --- a/gcc/gimple-predicate-analysis.cc +++ b/gcc/gimple-predicate-analysis.cc @@ -1892,7 +1892,6 @@ predicate::is_use_guarded (gimple *use_stmt, basic_block use_bb, /* Lazily initialize *THIS from the PHI and build its use expression. */ init_from_phi_def (phi); - m_use_expr = build_pred_expr (use_preds.m_preds); } /* The use is not guarded. */ @@ -1921,7 +1920,6 @@ predicate::is_use_guarded (gimple *use_stmt, basic_block use_bb, /* Lazily initialize *THIS from PHI. */ if (!init_from_phi_def (phi)) { - m_use_expr = build_pred_expr (use_preds.m_preds); return false; } @@ -1938,8 +1936,6 @@ predicate::is_use_guarded (gimple *use_stmt, basic_block use_bb, if (superset_of (use_preds)) return true; - m_use_expr = build_pred_expr (use_preds.m_preds); - return false; } @@ -2326,38 +2322,3 @@ predicate::init_from_control_deps (const vec *dep_chains, /* Clear M_PREDS to indicate failure. */ m_preds.release (); } - -/* Return the predicate expression guarding the definition of - the interesting variable. When INVERT is set, return the logical - NOT of the predicate. */ - -tree -predicate::def_expr (bool invert /* = false */) const -{ - /* The predicate is stored in an inverted form. */ - return build_pred_expr (m_preds, !invert); -} - -/* Return the predicate expression guarding the use of the interesting - variable or null if the use predicate hasn't been determined yet. */ - -tree -predicate::use_expr () const -{ - return m_use_expr; -} - -/* Return a logical AND expression with the (optionally inverted) predicate - expression guarding the definition of the interesting variable and one - guarding its use. Return null if the use predicate hasn't yet been - determined. */ - -tree -predicate::expr (bool invert /* = false */) const -{ - if (!m_use_expr) - return NULL_TREE; - - tree expr = build_pred_expr (m_preds, !invert); - return build2 (TRUTH_AND_EXPR, boolean_type_node, expr, m_use_expr); -} diff --git a/gcc/gimple-predicate-analysis.h b/gcc/gimple-predicate-analysis.h index c1843e89bbb..204cdbccfc7 100644 --- a/gcc/gimple-predicate-analysis.h +++ b/gcc/gimple-predicate-analysis.h @@ -69,11 +69,11 @@ class predicate /* Construct with the specified EVAL object. */ predicate (func_t &eval) - : m_preds (vNULL), m_eval (eval), m_use_expr () { } + : m_preds (vNULL), m_eval (eval) { } /* Copy. */ predicate (const predicate &rhs) - : m_preds (vNULL), m_eval (rhs.m_eval), m_use_expr () + : m_preds (vNULL), m_eval (rhs.m_eval) { *this = rhs; } @@ -109,15 +109,6 @@ class predicate bool is_use_guarded (gimple *, basic_block, gphi *, unsigned, hash_set *); - /* Return the predicate expression guarding the definition of - the interesting variable, optionally inverted. */ - tree def_expr (bool = false) const; - /* Return the predicate expression guarding the use of the interesting - variable. */ - tree use_expr () const; - - tree expr (bool = false) const; - private: bool includes (const pred_chain &) const; bool superset_of (const predicate &) const; @@ -145,9 +136,6 @@ private: pred_chain_union m_preds; /* Callback to evaluate an operand. Return true if it's interesting. */ func_t &m_eval; - /* The predicate expression guarding the use of the interesting - variable. */ - tree m_use_expr; }; /* Bit mask handling macros. */