* [PATCH] Improve uninit_analysis::collect_phi_def_edges
@ 2022-08-25 15:01 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-08-25 15:01 UTC (permalink / raw)
To: gcc-patches
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-25 15:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25 15:01 [PATCH] Improve uninit_analysis::collect_phi_def_edges Richard Biener
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).