public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Filip Kastl <pheeck@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/pheeck/heads/sccp)] added phi debug function
Date: Mon,  5 Sep 2022 16:54:33 +0000 (GMT)	[thread overview]
Message-ID: <20220905165433.2EE24385275A@sourceware.org> (raw)

https://gcc.gnu.org/g:a4bde9752ad292dd7cf54a8edb8fe0b324e98bbc

commit a4bde9752ad292dd7cf54a8edb8fe0b324e98bbc
Author: Filip Kastl <filip.kastl@gmail.com>
Date:   Mon Sep 5 18:54:23 2022 +0200

    added phi debug function

Diff:
---
 gcc/sccp.cc | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index bcb3b313782..e29754fb37d 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -126,6 +126,23 @@ finalize_sccp (void)
 {
 }
 
+static void
+debug_phis (void) // DEBUG
+{
+  std::cerr << "List of PHIs" << std::endl;
+  basic_block bb;
+  FOR_EACH_BB_FN (bb, cfun)
+    {
+      gphi_iterator pi;
+      for (pi = gsi_start_phis (bb); !gsi_end_p (pi); gsi_next (&pi))
+	{
+	  gphi *phi = pi.phi ();
+	  debug_gimple_stmt (phi);
+	}
+    }
+  std::cerr << std::endl;
+}
+
 /* Return vector of all PHI functions from all basic blocks.  */
 
 static vec<gphi *>
@@ -474,10 +491,18 @@ public:
 unsigned
 pass_sccp::execute (function *)
 {
+  //debug_phis (); // DEBUG
+
   init_sccp ();
   remove_redundant_phis (get_all_phis ());
   finalize_sccp ();
 
+  /*
+  // DEBUG
+  std::cerr << std::endl;
+  debug_phis ();
+  */
+
   return 0;
 }

             reply	other threads:[~2022-09-05 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 16:54 Filip Kastl [this message]
2023-02-15 10:14 Filip Kastl

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=20220905165433.2EE24385275A@sourceware.org \
    --to=pheeck@gcc.gnu.org \
    --cc=gcc-cvs@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).