public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Change form of iterating blocks
@ 2022-12-28  5:19 juzhe.zhong
  0 siblings, 0 replies; only message in thread
From: juzhe.zhong @ 2022-12-28  5:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, palmer, jeffreyalaw, Ju-Zhe Zhong

From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>

gcc/ChangeLog:

        * config/riscv/riscv-vsetvl.cc (pass_vsetvl::compute_global_backward_infos): Change iterator form.
        (pass_vsetvl::prune_expressions): Change iterator form.

---
 gcc/config/riscv/riscv-vsetvl.cc | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 0d66765e09c..ce1e9e3609f 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -1962,10 +1962,11 @@ pass_vsetvl::compute_global_backward_infos (void)
   if (dump_file)
     {
       fprintf (dump_file, "\n\nDirty blocks list: ");
-      for (const bb_info *bb : crtl->ssa->bbs ())
-	if (m_vector_manager->vector_block_infos[bb->index ()]
+      basic_block cfg_bb;
+      FOR_EACH_BB_FN (cfg_bb, cfun)
+	if (m_vector_manager->vector_block_infos[cfg_bb->index]
 	      .reaching_out.dirty_p ())
-	  fprintf (dump_file, "%d ", bb->index ());
+	  fprintf (dump_file, "%d ", cfg_bb->index);
       fprintf (dump_file, "\n\n");
     }
 }
@@ -1974,16 +1975,17 @@ pass_vsetvl::compute_global_backward_infos (void)
 void
 pass_vsetvl::prune_expressions (void)
 {
-  for (const bb_info *bb : crtl->ssa->bbs ())
+  basic_block cfg_bb;
+  FOR_EACH_BB_FN (cfg_bb, cfun)
     {
-      if (m_vector_manager->vector_block_infos[bb->index ()]
+      if (m_vector_manager->vector_block_infos[cfg_bb->index]
 	    .local_dem.valid_or_dirty_p ())
 	m_vector_manager->create_expr (
-	  m_vector_manager->vector_block_infos[bb->index ()].local_dem);
-      if (m_vector_manager->vector_block_infos[bb->index ()]
+	  m_vector_manager->vector_block_infos[cfg_bb->index].local_dem);
+      if (m_vector_manager->vector_block_infos[cfg_bb->index]
 	    .reaching_out.valid_or_dirty_p ())
 	m_vector_manager->create_expr (
-	  m_vector_manager->vector_block_infos[bb->index ()].reaching_out);
+	  m_vector_manager->vector_block_infos[cfg_bb->index].reaching_out);
     }
 
   if (dump_file)
-- 
2.36.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-28  5:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28  5:19 [PATCH] RISC-V: Change form of iterating blocks juzhe.zhong

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).