public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Use mark_block_for_update properly in insert_updated_phi_nodes_for
Date: Tue, 28 Jun 2022 11:12:43 +0000 (UTC)	[thread overview]
Message-ID: <20220628111243.nr_tGbuTB4eORjMVmKOVcwgsZOoK125Ae1HZQTOsL-E@z> (raw)

This makes sure to use mark_block_for_update when adding a block for
rewriting in insert_updated_phi_nodes_for as otherwise stmt flags are not
initialized.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2022-06-28  Richard Biener  <rguenther@suse.de>

	* tree-into-ssa.cc (insert_updated_phi_nodes_for): Use
	mark_block_for_update.
	(update_ssa): Adjust.
---
 gcc/tree-into-ssa.cc | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc
index 9631d8c6556..f9655ce1a28 100644
--- a/gcc/tree-into-ssa.cc
+++ b/gcc/tree-into-ssa.cc
@@ -3109,7 +3109,7 @@ release_ssa_name_after_update_ssa (tree name)
 
 
 /* Insert new PHI nodes to replace VAR.  DFS contains dominance
-   frontier information.  BLOCKS is the set of blocks to be updated.
+   frontier information.
 
    This is slightly different than the regular PHI insertion
    algorithm.  The value of UPDATE_FLAGS controls how PHI nodes for
@@ -3132,8 +3132,8 @@ release_ssa_name_after_update_ssa (tree name)
      names is not pruned.  PHI nodes are inserted at every IDF block.  */
 
 static void
-insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks,
-                              unsigned update_flags)
+insert_updated_phi_nodes_for (tree var, bitmap_head *dfs,
+			      unsigned update_flags)
 {
   basic_block entry;
   def_blocks *db;
@@ -3197,16 +3197,16 @@ insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks,
 
       /* FIXME, this is not needed if we are updating symbols.  We are
 	 already starting at the ENTRY block anyway.  */
-      bitmap_ior_into (blocks, pruned_idf);
       EXECUTE_IF_SET_IN_BITMAP (pruned_idf, 0, i, bi)
 	{
 	  edge e;
 	  edge_iterator ei;
 	  basic_block bb = BASIC_BLOCK_FOR_FN (cfun, i);
 
+	  mark_block_for_update (bb);
 	  FOR_EACH_EDGE (e, ei, bb->preds)
 	    if (e->src->index >= 0)
-	      bitmap_set_bit (blocks, e->src->index);
+	      mark_block_for_update (e->src);
 	}
 
       insert_phi_nodes_for (var, pruned_idf, true);
@@ -3475,14 +3475,12 @@ update_ssa (unsigned update_flags)
 	  auto_sbitmap tmp (SBITMAP_SIZE (old_ssa_names));
 	  bitmap_copy (tmp, old_ssa_names);
 	  EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, sbi)
-	    insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update,
-	                                  update_flags);
+	    insert_updated_phi_nodes_for (ssa_name (i), dfs, update_flags);
 	}
 
       symbols_to_rename.qsort (insert_updated_phi_nodes_compare_uids);
       FOR_EACH_VEC_ELT (symbols_to_rename, i, sym)
-	insert_updated_phi_nodes_for (sym, dfs, blocks_to_update,
-	                              update_flags);
+	insert_updated_phi_nodes_for (sym, dfs, update_flags);
 
       FOR_EACH_BB_FN (bb, cfun)
 	bitmap_clear (&dfs[bb->index]);
-- 
2.35.3

             reply	other threads:[~2022-06-28 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 11:12 Richard Biener [this message]
2022-06-28 11:12 Richard Biener
2022-06-28 11:12 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=20220628111243.nr_tGbuTB4eORjMVmKOVcwgsZOoK125Ae1HZQTOsL-E@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).