@@ -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)
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(-)