From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Improve uninit_analysis::collect_phi_def_edges
Date: Thu, 25 Aug 2022 17:01:54 +0200 (CEST) [thread overview]
Message-ID: <20220825150154.BC5F313A8E@imap2.suse-dmz.suse.de> (raw)
This avoids expanding an edge to those of a PHI def if it is not
may-undefined, reducing the number of compute_control_dep_chain calls.
Bootstrap and regtest in progress on x86_64-unknown-linux-gnu.
* gimple-predicate-analysis.cc
(uninit_analysis::collect_phi_def_edges): Only expand a
PHI def edge when it is possibly undefined.
---
gcc/gimple-predicate-analysis.cc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 079e06009fd..0d973a9e25a 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -605,11 +605,7 @@ uninit_analysis::collect_phi_def_edges (gphi *phi, basic_block cd_root,
{
gimple *def = SSA_NAME_DEF_STMT (opnd);
- if (gimple_code (def) == GIMPLE_PHI
- && dominated_by_p (CDI_DOMINATORS, gimple_bb (def), cd_root))
- collect_phi_def_edges (as_a<gphi *> (def), cd_root, edges,
- visited);
- else if (!m_eval (opnd))
+ if (!m_eval (opnd))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -622,6 +618,10 @@ uninit_analysis::collect_phi_def_edges (gphi *phi, basic_block cd_root,
}
edges->safe_push (opnd_edge);
}
+ else if (gimple_code (def) == GIMPLE_PHI
+ && dominated_by_p (CDI_DOMINATORS, gimple_bb (def), cd_root))
+ collect_phi_def_edges (as_a<gphi *> (def), cd_root, edges,
+ visited);
}
else
{
--
2.35.3
reply other threads:[~2022-08-25 15:01 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=20220825150154.BC5F313A8E@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).