From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Improve uninit pass dumping
Date: Tue, 30 Aug 2022 13:37:40 +0000 (UTC) [thread overview]
Message-ID: <20220830133740.-1srx8psTiX0f9LXZSy8b6lZLnqYTWEAHyGQ_qJ-ITY@z> (raw)
This produces less redundancy and more complete info dumping
the control dependence chains.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
* gimple-predicate-analysis.cc (format_edge_vec): Dump
both source and destination.
(dump_dep_chains): Remove.
(uninit_analysis::init_use_preds): Remove redundant
dumping of chains.
---
gcc/gimple-predicate-analysis.cc | 34 ++++----------------------------
1 file changed, 4 insertions(+), 30 deletions(-)
diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 62a13c39d7a..f9ae8910a26 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -122,10 +122,10 @@ format_edge_vec (const vec<edge> &ev)
{
char es[32];
const_edge e = ev[i];
- sprintf (es, "%u", e->src->index);
+ sprintf (es, "%u -> %u", e->src->index, e->dest->index);
str += es;
if (i + 1 < n)
- str += " -> ";
+ str += ", ";
}
return str;
}
@@ -180,28 +180,6 @@ dump_pred_chain (const pred_chain &chain)
}
}
-/* Dump the first NCHAINS elements of the DEP_CHAINS array into DUMP_FILE. */
-
-static void
-dump_dep_chains (const auto_vec<edge> dep_chains[], unsigned nchains)
-{
- if (!dump_file)
- return;
-
- for (unsigned i = 0; i != nchains; ++i)
- {
- const auto_vec<edge> &v = dep_chains[i];
- unsigned n = v.length ();
- for (unsigned j = 0; j != n; ++j)
- {
- fprintf (dump_file, "%u", v[j]->src->index);
- if (j + 1 < n)
- fprintf (dump_file, " -> ");
- }
- fputc ('\n', dump_file);
- }
-}
-
/* Return the 'normalized' conditional code with operand swapping
and condition inversion controlled by SWAP_COND and INVERT. */
@@ -1922,12 +1900,8 @@ uninit_analysis::init_use_preds (predicate &use_preds, basic_block def_bb,
}
if (DEBUG_PREDICATE_ANALYZER && dump_file)
- {
- fprintf (dump_file, "predicate::predicate (def_bb = %u, use_bb = %u, func_t) "
- "initialized from %u dep_chains:\n\t",
- def_bb->index, use_bb->index, num_chains);
- dump_dep_chains (dep_chains, num_chains);
- }
+ fprintf (dump_file, "init_use_preds (def_bb = %u, use_bb = %u)\n",
+ def_bb->index, use_bb->index);
/* From the set of edges computed above initialize *THIS as the OR
condition under which the definition in DEF_BB is used in USE_BB.
--
2.35.3
next reply other threads:[~2022-08-30 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 13:37 Richard Biener [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-30 13:37 Richard Biener
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=20220830133740.-1srx8psTiX0f9LXZSy8b6lZLnqYTWEAHyGQ_qJ-ITY@z \
--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).