From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Remove dead predicate analysis GENERIC expr building code
Date: Mon, 22 Aug 2022 15:37:19 +0200 (CEST) [thread overview]
Message-ID: <20220822133719.EF80E13523@imap2.suse-dmz.suse.de> (raw)
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<edge> *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<gphi *> *);
- /* 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. */
--
2.35.3
reply other threads:[~2022-08-22 13:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220822133719.EF80E13523@imap2.suse-dmz.suse.de \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).